/* ═══════════════════════════════════════════════════════════════
   TIP Student Marketplace — styles.css
   Theme: TIP Gold × Professional Dark Mode × Glassmorphism
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & Variables ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:           #D4AF37;
  --gold-light:     #e8c84a;
  --gold-dark:      #a88a25;
  --gold-glow:      rgba(212,175,55,0.25);
  --gold-subtle:    rgba(212,175,55,0.08);

  --bg-base:        #0d0d0f;
  --bg-elevated:    #131317;
  --bg-card:        rgba(255,255,255,0.04);
  --bg-card-hover:  rgba(255,255,255,0.07);
  --bg-glass:       rgba(18,18,22,0.75);
  --bg-input:       rgba(255,255,255,0.06);

  --border:         rgba(255,255,255,0.08);
  --border-gold:    rgba(212,175,55,0.3);
  --border-hover:   rgba(255,255,255,0.14);

  --text-primary:   #f0ede6;
  --text-secondary: #8a8590;
  --text-muted:     #504d5a;
  --text-gold:      #D4AF37;

  --danger:         #e85555;
  --success:        #4caf82;
  --info:           #5b9cf6;

  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      18px;
  --radius-xl:      24px;
  --radius-full:    9999px;

  --shadow-sm:      0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:      0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg:      0 16px 48px rgba(0,0,0,0.6);
  --shadow-gold:    0 0 24px rgba(212,175,55,0.15);

  --nav-h:          68px;
  --bottom-nav-h:   72px;
  --font-display:   'Syne', sans-serif;
  --font-body:      'DM Sans', sans-serif;
  --transition:     0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
  /* Subtle noise texture */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(212,175,55,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 85% 80%, rgba(212,175,55,0.04) 0%, transparent 50%);
  background-attachment: fixed;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,0.4); }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

a { text-decoration: none; color: inherit; }

/* ── Utility ─────────────────────────────────────────────────── */
.hidden { display: none !important; }
.gold-text { color: var(--gold); }

/* ══════════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}

.navbar.scrolled { box-shadow: 0 4px 32px rgba(0,0,0,0.4); }

.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: #000;
  font-weight: 900;
  box-shadow: var(--shadow-gold);
  transition: transform var(--transition);
}
.navbar-brand:hover .brand-icon { transform: rotate(10deg) scale(1.05); }

.brand-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand-text span { color: var(--gold); }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
  display: flex; align-items: center; gap: 6px;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-link.active { color: var(--gold); background: var(--gold-subtle); }

.msg-badge {
  background: var(--gold);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

.navbar-search {
  position: relative;
  flex: 0 1 260px;
}
.navbar-search .search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}
.navbar-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 14px 8px 36px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}
.navbar-search input:focus {
  border-color: var(--gold);
  background: rgba(212,175,55,0.06);
}
.navbar-search input::placeholder { color: var(--text-muted); }

.navbar-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}

.nav-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}
.nav-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.nav-btn-ghost:hover { border-color: var(--border-hover); color: var(--text-primary); background: var(--bg-card); }
.nav-btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  box-shadow: 0 4px 14px rgba(212,175,55,0.3);
}
.nav-btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(212,175,55,0.4); }

.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  color: #000;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 0 0 2px transparent;
}
.avatar-btn:hover { box-shadow: 0 0 0 3px var(--gold-glow); transform: scale(1.05); }

/* ══ Bottom Nav ════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 100;
}
.bottom-nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 8px;
}
.bottom-nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  background: none; border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.68rem;
  cursor: pointer;
  transition: color var(--transition);
  padding: 4px;
  border-radius: var(--radius-md);
}
.bottom-nav-item .nav-icon { font-size: 1.3rem; }
.bottom-nav-item.active { color: var(--gold); }
.bottom-nav-item.sell-btn {
  flex: 0 0 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(212,175,55,0.4);
}

/* ══════════════════════════════════════════════════════════════
   PAGE WRAPPER & SECTIONS
   ══════════════════════════════════════════════════════════════ */
.page-wrapper {
  padding-top: calc(var(--nav-h) + 0px);
  min-height: 100vh;
}
.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.35s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 72px 24px 56px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(212,175,55,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold-subtle);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero h1 .highlight {
  background: linear-gradient(135deg, var(--gold) 0%, #f0d060 50%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 40px;
  font-size: 1rem;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  display: block;
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════
   FILTER BAR
   ══════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 24px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.filter-chip {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--gold); color: var(--gold); }
.filter-chip.active {
  background: var(--gold-subtle);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

.filter-select {
  margin-left: auto;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--gold); }
.filter-select option { background: #1a1a22; color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════════
   PRODUCTS GRID
   ══════════════════════════════════════════════════════════════ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 20px;
  padding: 0 24px 120px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Product Card ──────────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  animation: cardReveal 0.4s ease both;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), var(--shadow-gold);
  background: var(--bg-card-hover);
}

.product-card .card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #1a1a22, #222230);
}

.card-image-placeholder {
  width: 100%;
  height: 180px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(212,175,55,0.06), rgba(212,175,55,0.02));
  font-size: 3rem;
}

.card-body {
  padding: 16px;
}

.card-category {
  display: inline-block;
  padding: 3px 10px;
  background: var(--gold-subtle);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-price {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold);
}

.card-seller {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}
.card-seller .seller-avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
}

.card-condition-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-actions {
  display: flex; gap: 8px;
  padding: 0 16px 16px;
}

.btn-chat {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--gold-subtle);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.btn-chat:hover { background: var(--gold); color: #000; }

.btn-save {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-save:hover, .btn-save.saved { color: var(--gold); border-color: var(--border-gold); background: var(--gold-subtle); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  box-shadow: 0 4px 14px rgba(212,175,55,0.3);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(212,175,55,0.45); }
.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-primary); }
.btn-danger {
  background: rgba(232,85,85,0.15);
  border: 1px solid rgba(232,85,85,0.3);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 14px 24px; font-size: 0.95rem; border-radius: var(--radius-lg); }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.02em; }

.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold);
  background: rgba(212,175,55,0.05);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-select option { background: #1a1a22; }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.char-count { font-size: 0.72rem; color: var(--text-muted); text-align: right; margin-top: 2px; }

/* ── Email username + suffix input ──────────────────────────── */
.email-suffix-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-input);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.email-suffix-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.email-prefix-input {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 11px 0 11px 14px !important;
  min-width: 0;
}
.email-prefix-input:focus {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
.email-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(212,175,55,0.08);
  border-left: 1px solid var(--border);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-display);
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.price-input-wrap { position: relative; }
.price-prefix {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-weight: 700;
  font-family: var(--font-display);
}
.price-input-wrap .form-input { padding-left: 30px; }

/* ══════════════════════════════════════════════════════════════
   UPLOAD PAGE
   ══════════════════════════════════════════════════════════════ */
.upload-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 120px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.img-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.img-upload-zone:hover { border-color: var(--gold); background: var(--gold-subtle); }
.img-upload-zone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.img-preview {
  display: none;
  width: 100%; max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.img-preview.visible { display: block; }
.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-text { font-weight: 600; color: var(--text-secondary); font-size: 0.9rem; }
.upload-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   PROFILE PAGE
   ══════════════════════════════════════════════════════════════ */
.profile-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 120px;
}

.profile-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
}

.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--gold-subtle);
}

.profile-info h3 { font-size: 1.3rem; margin-bottom: 4px; }
.profile-info p { font-size: 0.85rem; color: var(--text-secondary); }
.profile-badges { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.profile-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--gold-subtle);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
}

.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 4px;
}
.profile-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.profile-tab:hover { color: var(--text-primary); }
.profile-tab.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }

.profile-tab-content { display: none; }
.profile-tab-content.active { display: block; animation: fadeIn 0.2s ease; }

/* ══════════════════════════════════════════════════════════════
   CHAT
   ══════════════════════════════════════════════════════════════ */
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - var(--nav-h));
}

.chat-sidebar {
  background: var(--bg-glass);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.chat-sidebar-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}
.chat-list-item:hover { background: var(--bg-card); }
.chat-list-item.active { background: var(--gold-subtle); border: 1px solid var(--border-gold); }

.chat-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.chat-list-info { flex: 1; min-width: 0; }
.chat-list-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-list-preview {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  gap: 8px;
}
.chat-empty-icon { font-size: 2.5rem; opacity: 0.5; }

.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  animation: bubbleIn 0.25s ease;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-bubble.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.chat-bubble.received {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-bubble .bubble-time {
  font-size: 0.65rem;
  opacity: 0.6;
  display: block;
  margin-top: 4px;
  text-align: right;
}
.chat-bubble.received .bubble-time { text-align: left; }

.typing-indicator {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 4px;
  animation: bubbleIn 0.25s ease;
}
.typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%,60%,100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex !important;
  gap: 12px;
  align-items: center;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--gold); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  color: #000;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}
.chat-send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(212,175,55,0.4); }

/* ══════════════════════════════════════════════════════════════
   ADMIN DASHBOARD
   ══════════════════════════════════════════════════════════════ */
.admin-page {
  padding: 40px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: border-color var(--transition), transform var(--transition);
}
.admin-stat-card:hover { border-color: var(--border-gold); transform: translateY(-2px); }

.admin-stat-icon { font-size: 1.8rem; margin-bottom: 10px; }
.admin-stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  display: block;
}
.admin-stat-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }

.admin-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.admin-table-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }

.table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-card); }

.admin-item-cell { display: flex; align-items: center; gap: 10px; }
.admin-item-img {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-input);
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-category {
  background: var(--gold-subtle);
  border: 1px solid var(--border-gold);
  color: var(--gold);
}

/* ══════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }

.modal {
  background: #18181f;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  animation: modalSlide 0.25s ease;
}
.modal-lg { max-width: 700px; }

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ── Auth Tabs ──────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.auth-tab.active { background: var(--gold); color: #000; }

.auth-form { display: none; flex-direction: column; gap: 16px; }
.auth-form.active { display: flex; animation: fadeIn 0.2s ease; }

.divider {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
}
.divider::before, .divider::after {
  content: '';
  position: absolute; top: 50%;
  width: 38%; height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* ── Product Detail ─────────────────────────────────────────── */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.product-detail-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1a1a22, #222230);
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}
.product-detail-image img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.product-detail-info { display: flex; flex-direction: column; gap: 14px; }
.product-detail-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
}
.product-detail-meta { display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.product-detail-meta span { display: flex; align-items: center; gap: 8px; }

/* ══════════════════════════════════════════════════════════════
   ABOUT PAGE
   ══════════════════════════════════════════════════════════════ */
.about-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px 120px;
}

.about-hero {
  text-align: center;
  margin-bottom: 56px;
}

.tip-logo-text {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), #f0d060, var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -2px;
  margin-bottom: 12px;
}

.about-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
  backdrop-filter: blur(10px);
}
.about-card:hover { border-color: var(--border-gold); transform: translateY(-3px); box-shadow: var(--shadow-gold); }
.about-card-icon { font-size: 1.8rem; margin-bottom: 12px; }
.about-card h4 { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; }

/* ══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 90px; right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1e1e2a;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 240px;
  max-width: 320px;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--gold); }
.toast.fade-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  .page-wrapper { padding-top: var(--nav-h); padding-bottom: var(--bottom-nav-h); }

  .nav-links { display: none; }
  .navbar-search { display: none; }
  .navbar-actions .nav-btn { display: none; }
  .avatar-btn { display: flex !important; }
  .navbar-actions .logout-btn { display: none; }

  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 0 12px 120px; }
  .card-image-placeholder, .product-card .card-image { height: 130px; }

  .hero { padding: 40px 16px 32px; }
  .hero-stats { gap: 24px; }

  .filter-bar { padding: 0 12px 16px; gap: 6px; overflow-x: auto; flex-wrap: nowrap; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-select { display: none; }

  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar {
    position: fixed; bottom: var(--bottom-nav-h); left: 0; right: 0;
    height: calc(100vh - var(--nav-h) - var(--bottom-nav-h));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 50;
  }
  .chat-sidebar.open { transform: translateX(0); }
  .chat-main { height: calc(100vh - var(--nav-h) - var(--bottom-nav-h)); }

  .product-detail { grid-template-columns: 1fr; }

  .admin-page { padding: 24px 12px 80px; }

  .upload-card { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }

  .profile-header { flex-direction: column; text-align: center; }

  #toast-container { bottom: calc(var(--bottom-nav-h) + 12px); right: 12px; left: 12px; }
  .toast { min-width: unset; max-width: unset; }
}

@media (min-width: 769px) {
  .chat-input-area { display: flex !important; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.9rem; letter-spacing: -1px; }
  .products-grid { grid-template-columns: 1fr 1fr; }
}