/* ============================================================
   BloxMarkt — Premium Trading Platform (Overhaul)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  /* Colors */
  --bg-dark: #050505;
  --bg-card: #0f0a1d;
  --bg-card-hover: #160e29;
  --bg-header: rgba(5, 5, 5, 0.9);

  --accent-purple: #6339f9;
  --accent-purple-dim: #4a2cb5;
  --accent-purple-soft: rgba(99, 57, 249, 0.1);
  --accent-purple-glow: rgba(99, 57, 249, 0.2);

  --text-primary: #ffffff;
  --text-secondary: #9fa1b4;
  --text-muted: #626470;

  --border: #1e1b2e;
  --border-active: #3b3558;

  --green: #10b981;
  --red: #ef4444;
  --gold: #f59e0b;

  /* Layout */
  --header-height: 80px;

  /* Utils */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border: none;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* === TOP HEADER === */
.header {
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo span {
  color: var(--accent-purple);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-link:hover {
  color: #fff;
  background: var(--accent-purple-soft);
}

.nav-link.active {
  color: #fff;
  background: var(--accent-purple);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* === PROFILE DROPDOWN === */
.profile-wrapper {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.user-trigger:hover {
  border-color: var(--accent-purple);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-purple-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.username {
  font-size: 0.9rem;
  font-weight: 500;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  padding: 8px;
  animation: dropdownIn 0.2s ease-out;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.dropdown-item i {
  width: 18px;
  text-align: center;
}

.dropdown-item:hover {
  background: var(--accent-purple-soft);
  color: #fff;
}

.dropdown-item.logout {
  color: var(--red);
}

.dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* === MAIN CONTENT === */
.content {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-height));
}

/* === MARKETPLACE FILTERS === */
.marketplace-header {
  margin-bottom: 32px;
}

.search-filter-bar {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-field {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px 12px 48px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.input-field:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

/* === ITEM GRID === */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.item-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-purple-dim);
  box-shadow: 0 12px 40px var(--accent-purple-glow);
}

.item-img-container {
  aspect-ratio: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.item-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.item-stats {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.item-price {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-purple);
}

.item-rap {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.item-footer {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.seller {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-buy {
  background: var(--accent-purple);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-buy:hover {
  background: var(--accent-purple-dim);
}

/* === STAT CARDS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius-lg);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

/* === CHAT === */
.chat-widget {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 2000;
}

.chat-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 10px 30px var(--accent-purple-glow);
  cursor: pointer;
}

.chat-panel {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 380px;
  height: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: chatIn 0.3s ease-out;
}

@keyframes chatIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-header {
  background: var(--accent-purple);
  padding: 16px;
  color: #fff;
  display: flex;
  justify-content: space-between;
}

.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.msg.bot {
  background: var(--border);
  color: #fff;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.msg.user {
  background: var(--accent-purple);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

/* === GLASS MODALS === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.glass-modal {
  background: rgba(15, 10, 29, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.glass-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-step-num {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: var(--accent-purple);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.glass-step-text h4 {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.glass-step-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.video-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
  background: #000;
}

/* === BUTTON OVERRIDES === */
.btn-primary {
  background: var(--accent-purple);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--accent-purple-dim);
  box-shadow: 0 0 20px var(--accent-purple-glow);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* === UTILS === */
.hidden {
  display: none !important;
}

.text-accent {
  color: var(--accent-purple);
}

.text-green {
  color: var(--green);
}

.text-red {
  color: var(--red);
}

/* === SKELETON ANIMATIONS === */
.skeleton-container {
  pointer-events: none;
  border-color: transparent !important;
}

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--border-active) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-img {
  width: 100%;
  height: 100%;
}

.skeleton-text {
  height: 16px;
}

/* === SECONDARY LAYOUT === */
.account-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: flex-start;
}

.secondary-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.sidebar-link:hover {
  background: var(--bg-card);
  color: #fff;
}

.sidebar-link.active {
  background: var(--accent-purple-soft);
  color: var(--accent-purple);
  border-left: 3px solid var(--accent-purple);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* === BUY MODAL SPECIFICS === */
.buy-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a1a1a;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 2;
}

.buy-step.active {
  background: #f43f5e;
  /* Red color matching the screenshot */
  color: #fff;
}

.buy-step-line {
  flex: 1;
  height: 3px;
  background: #1a1a1a;
  margin: 0 -4px;
  z-index: 1;
}

.buy-step-line.active-solid {
  background: #f43f5e;
}

.buy-step-line.active-half {
  background: linear-gradient(90deg, #f43f5e 50%, #1a1a1a 50%);
}

/* === AUTHENTICATION LAYOUT === */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  /* header offset */
  padding: 40px 20px;
}

.auth-card {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 900px;
  width: 100%;
  animation: fadeUp 0.6s ease-out;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.auth-form-side {
  flex: 1;
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-image-side {
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-left: 1px solid var(--border);
}

.auth-image-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .auth-card {
    flex-direction: column-reverse;
  }

  .auth-image-side {
    border-left: none;
    border-bottom: 1px solid var(--border);
    height: 200px;
  }

  .auth-form-side {
    padding: 40px 20px;
  }
}