/* ============================================================
   TRADING CARD COLLECTION SHOWCASE
   Premium Dark Theme — Collector's Vault
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Courier+Prime&display=swap');

/* ============================================================
   1. RESET + CUSTOM PROPERTIES
   ============================================================ */

:root {
  /* — Palette: Modern Premium Dark — */
  --bg-deep:             #040814; /* Deep midnight navy */
  --bg-surface:          #0b1221; /* Slightly lighter navy for cards */
  --bg-elevated:         #131b2f; /* Elevated panels */
  --bg-hover:            #1a243d; /* Hovered elements */
  --wood-light:          #3b82f6; /* We'll use this for Electric Blue borders */
  --wood-dark:           #0b1221; /* Same as surface */
  --accent:              #00a8ff; /* Electric Blue */
  --accent-dim:          #005b8a; /* Dimmed Electric Blue */
  --accent-glow:         rgba(0, 168, 255, 0.2);
  --accent-glow-strong:  rgba(0, 168, 255, 0.4);
  --text:                #ffffff; /* Crisp White text */
  --text-muted:          #9ca3af; /* Silver/grey text */
  --text-dim:            #6b7280; /* Darker grey text */
  --border:              #1f2937; /* Slate border */
  --border-hover:        #3b82f6; /* Electric Blue hover */
  --danger:              #ef4444; /* Bright Red */
  --success:             #10b981; /* Bright Green */

  /* — Typography — */
  --font-display: 'Montserrat', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* — Spacing (4px base) — */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* — Radii (Sleek modern edges) — */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  /* — Motion — */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* — Layout — */
  --header-height: 160px;
  --container-max: 1400px;
}

@media (max-width: 768px) {
  :root {
    --header-height: 110px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* — Scrollbar: WebKit — */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* — Scrollbar: Firefox — */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) var(--bg-deep);
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

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

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}


/* ============================================================
   2. BASE TYPOGRAPHY
   ============================================================ */

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: clamp(2.25rem, 1.8rem + 2vw, 4rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 1.5rem + 1.2vw, 2.75rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.875rem);
}

h4 {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.5rem);
}

h5 {
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.25rem);
}

h6 {
  font-size: clamp(0.875rem, 0.85rem + 0.15vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

.text-gold {
  color: var(--accent);
}

.text-mono {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.875em;
}

small,
.text-small {
  font-size: 0.8125rem;
  color: var(--text-muted);
}


/* ============================================================
   3. LAYOUT UTILITIES
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (max-width: 768px) {
  .container {
    padding-inline: var(--space-4);
  }
}

.grid-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .grid-gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
  }
  .grid-gallery .card-item {
    border-radius: var(--radius-sm);
  }
  .grid-gallery .card-info {
    padding: var(--space-2);
  }
  .grid-gallery .card-title {
    font-size: 0.7rem;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .grid-gallery .card-category-badge,
  .grid-gallery .card-meta {
    display: none;
  }
  .grid-gallery .favorite-star {
    top: var(--space-1);
    right: var(--space-1);
    font-size: 0.85rem;
    width: 20px;
    height: 20px;
  }
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }


/* ============================================================
   4. NAVIGATION / HEADER
   ============================================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(4, 8, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-logo {
  display: flex;
  align-items: center;
}

.header-logo-img {
  height: 144px;
  width: auto;
  object-fit: contain;
  transition: height var(--transition);
}

@media (max-width: 768px) {
  .header-logo-img {
    height: 84px;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--transition), text-shadow var(--transition);
  padding-block: var(--space-2);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link--admin {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-link--admin::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-2);
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(4, 8, 20, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: var(--space-3) 0;
    width: 100%;
  }
}


/* ============================================================
   5. HERO SECTION
   ============================================================ */

.hero {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-6);
  padding-top: calc(var(--header-height) + var(--space-16));
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, var(--accent-glow) 0%, transparent 60%),
    linear-gradient(180deg, transparent 0%, var(--bg-deep) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-title {
  margin-bottom: var(--space-6);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.25rem);
  color: var(--text-muted);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: var(--space-10);
  line-height: 1.7;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.hero-stat-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 480px) {
  .hero-stats {
    flex-wrap: wrap;
    gap: var(--space-6);
  }

  .hero-stat {
    flex: 0 0 calc(50% - var(--space-3));
  }
}


/* ============================================================
   6. FAVORITES CAROUSEL
   ============================================================ */

.favorites-section {
  padding: var(--space-16) 0;
  overflow: hidden;
}

.favorites-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.favorites-section-header h2 {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.favorites-section-header .section-count {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  font-weight: 400;
}

.favorites-wrapper {
  position: relative;
}

.favorites-track {
  display: flex;
  gap: var(--space-6);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--space-6);
  padding: var(--space-4) var(--space-2);
  -ms-overflow-style: none;
}

.favorites-track::-webkit-scrollbar {
  display: none;
}

.favorite-card {
  position: relative;
  flex: 0 0 260px;
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

.favorite-card:hover {
  transform: scale(1.03);
  border-color: var(--accent);
  box-shadow:
    0 0 20px var(--accent-glow-strong),
    0 8px 32px rgba(0, 0, 0, 0.4);
}

.favorite-card-rank {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-deep);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.favorite-card-image {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg-deep);
  padding: var(--space-2);
}

.favorite-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 40%, transparent 60%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
}

.favorite-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.favorite-card:hover .favorite-card-image img {
  transform: scale(1.05);
}

.favorite-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-12) var(--space-4) var(--space-4);
  background: linear-gradient(
    to top,
    rgba(12, 14, 20, 0.95) 0%,
    rgba(12, 14, 20, 0.6) 50%,
    transparent 100%
  );
}

.favorite-card-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: var(--space-1);
}

.favorite-card-subtitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Scroll buttons */
.favorites-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.favorites-scroll-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 12px var(--accent-glow);
}

.favorites-scroll-btn--left {
  left: var(--space-3);
}

.favorites-scroll-btn--right {
  right: var(--space-3);
}

/* Scroll indicators (dots) */
.favorites-indicators {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.favorites-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: none;
  transition: background var(--transition), transform var(--transition);
}

.favorites-indicator.active {
  background: var(--accent);
  transform: scale(1.3);
}

.favorites-indicator:hover {
  background: var(--accent);
}

@media (max-width: 768px) {
  .favorite-card {
    flex: 0 0 220px;
  }

  .favorites-scroll-btn {
    display: none;
  }
}


/* ============================================================
   7. CARD GRID ITEMS
   ============================================================ */

.card-item {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.card-item::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(201, 168, 76, 0.06) 45%,
    rgba(201, 168, 76, 0.12) 50%,
    rgba(201, 168, 76, 0.06) 55%,
    transparent 60%
  );
  background-size: 300% 100%;
  background-position: 200% 0;
  pointer-events: none;
  transition: background-position 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-item:hover {
  border-color: var(--border-hover);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px var(--border-hover);
  transform: translateY(-4px);
}

.card-item:hover::before {
  background-position: -100% 0;
}

/* Favorited card accent */
.card-item.is-favorite {
  border-color: var(--accent-dim);
}

.card-item.is-favorite::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  z-index: 2;
}

.card-image {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg-deep);
}

.card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 40%, transparent 60%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.card-item:hover .card-image img {
  transform: scale(1.04);
}

/* Favorite star */
.favorite-star {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 3;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--accent);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.favorite-star::before {
  content: '★';
}

.card-info {
  padding: var(--space-4);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.card-title a {
  transition: color var(--transition);
}

.card-title a:hover {
  color: var(--accent);
}

.card-category-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  padding: var(--space-1) var(--space-3);
  background: rgba(123, 107, 58, 0.25);
  color: var(--accent);
  border-radius: 100px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.card-meta span {
  white-space: nowrap;
}

.card-meta-divider {
  color: var(--text-dim);
}

.card-meta-divider::before {
  content: '·';
}


/* ============================================================
   8. GALLERY & CATEGORY FILTER
   ============================================================ */

.gallery-header {
  padding-top: calc(var(--header-height) + var(--space-8));
  margin-bottom: var(--space-6);
}

.category-filters {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-2) 0;
  margin-bottom: var(--space-8);
  -ms-overflow-style: none;
}

.category-filters::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: var(--space-2) var(--space-5);
  border-radius: 100px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid transparent;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.filter-tab:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.filter-tab.active {
  background: var(--accent);
  color: var(--bg-deep);
  font-weight: 600;
}


/* ============================================================
   9. CARD DETAIL PAGE
   ============================================================ */

.card-detail {
  padding-top: calc(var(--header-height) + var(--space-10));
  padding-bottom: var(--space-16);
}

.card-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

.card-detail-image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--accent-dim);
  box-shadow: 0 0 40px var(--accent-glow);
  cursor: zoom-in;
}

.card-detail-image img {
  width: 100%;
  display: block;
}

.card-detail-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.card-detail-title {
  margin-bottom: var(--space-2);
}

.card-detail-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.card-detail-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.card-detail-value {
  font-size: 1rem;
  color: var(--text);
}

.card-detail-description {
  color: var(--text-muted);
  line-height: 1.7;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  transition: color var(--transition);
}

.back-button:hover {
  color: var(--accent);
}

.back-button::before {
  content: '←';
  font-size: 1.125rem;
  transition: transform var(--transition);
}

.back-button:hover::before {
  transform: translateX(-3px);
}

@media (max-width: 768px) {
  .card-detail-layout {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}


/* ============================================================
   10. LIGHTBOX
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox-close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--transition),
    transform var(--transition);
}

.lightbox-close::before {
  content: '✕';
}

.lightbox-close:hover {
  background: rgba(201, 168, 76, 0.1);
  transform: scale(1.1);
}


/* ============================================================
   11. ADMIN PANEL
   ============================================================ */

/* Layout */
.admin-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: calc(var(--header-height) + var(--space-4));
  padding-bottom: var(--space-16);
}

.admin-sidebar {
  display: none;
}

.admin-sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}

.admin-sidebar-link:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.admin-sidebar-link.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-right: 2px solid var(--accent);
}

.admin-main {
  padding: var(--space-8);
}

.admin-page-title {
  margin-bottom: var(--space-8);
}

.admin-actions {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    top: auto;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: var(--space-3) 0;
    display: flex;
    overflow-x: auto;
  }

  .admin-sidebar-link {
    padding: var(--space-2) var(--space-4);
    white-space: nowrap;
    border-right: none;
  }

  .admin-sidebar-link.active {
    border-right: none;
    border-bottom: 2px solid var(--accent);
  }

  .admin-main {
    padding: var(--space-4);
  }
  
  .admin-actions .btn {
    width: 100%;
  }
}

/* Forms */
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .admin-grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9375rem;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238A8690' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: var(--space-1);
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: var(--space-1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition:
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition),
    border-color var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
}

.btn-primary:hover {
  box-shadow: 0 0 20px var(--accent-glow-strong), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent-dim);
}

.btn-secondary:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  color: var(--text);
}

.btn-danger:hover {
  box-shadow: 0 0 16px rgba(201, 76, 76, 0.3);
  transform: translateY(-1px);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.8125rem;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
}

/* File upload */
.file-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  transition:
    border-color var(--transition),
    background var(--transition);
  cursor: pointer;
}

.file-upload:hover,
.file-upload.drag-over {
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-icon {
  font-size: 2rem;
  color: var(--text-dim);
  margin-bottom: var(--space-3);
}

.file-upload-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.file-upload-text strong {
  color: var(--accent);
}

/* Stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-card-content {
  display: flex;
  flex-direction: column;
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Table */
.admin-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:nth-child(even) td {
  background: rgba(22, 24, 34, 0.5);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--bg-hover);
}

.admin-table-thumbnail {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Admin card grid (favorites selection) */
.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-4);
}

.admin-card-grid .card-item {
  cursor: pointer;
}

.admin-card-grid .card-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.admin-card-grid .card-item.selected::after {
  content: '✓';
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 3;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-deep);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Drag handle */
.drag-handle {
  cursor: grab;
  padding: var(--space-2);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
  user-select: none;
}

.drag-handle:hover {
  color: var(--accent);
}

.drag-handle::before {
  content: '⠿';
  font-size: 1.25rem;
}

.drag-handle:active {
  cursor: grabbing;
}


/* ============================================================
   12. LOGIN PAGE
   ============================================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + var(--space-6)) var(--space-6) var(--space-6);
  background: var(--bg-deep);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.login-card-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--accent-dim));
}

.login-card-body {
  padding: var(--space-10) var(--space-8);
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: var(--space-2);
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-error {
  padding: var(--space-3) var(--space-4);
  background: rgba(201, 76, 76, 0.1);
  border: 1px solid rgba(201, 76, 76, 0.3);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 0.8125rem;
  margin-bottom: var(--space-5);
}

.login-card .btn-primary {
  width: 100%;
  margin-top: var(--space-4);
}


/* ============================================================
   13. PAGINATION
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-8) 0;
}

.pagination-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}

.pagination-link:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-hover);
}

.pagination-link.active {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
}

.pagination-ellipsis {
  color: var(--text-dim);
  padding: 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}


/* ============================================================
   14. CATEGORY PREVIEW SECTIONS
   ============================================================ */

.category-section {
  padding: var(--space-12) 0;
  border-bottom: 1px solid var(--border);
}

.category-section:last-child {
  border-bottom: none;
}

.category-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.category-section-title {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.category-section-count {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-weight: 400;
}

.category-view-all {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: gap var(--transition);
}

.category-view-all::after {
  content: '→';
  transition: transform var(--transition);
}

.category-view-all:hover {
  gap: var(--space-3);
}

.category-view-all:hover::after {
  transform: translateX(2px);
}

.category-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .category-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .category-preview-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   15. UTILITIES & ANIMATION
   ============================================================ */

/* Fade in */
.fade-in {
  animation: fadeIn 0.5s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Slide up */
.slide-up {
  animation: slideUp 0.5s ease both;
}

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

/* Shimmer */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 0%,
    var(--bg-elevated) 40%,
    var(--bg-surface) 60%,
    var(--bg-surface) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: toastIn 0.4s ease both;
}

.toast.toast-leaving {
  animation: toastOut 0.3s ease both;
}

.toast--success {
  border-left: 3px solid var(--success);
}

.toast--error {
  border-left: 3px solid var(--danger);
}

.toast--info {
  border-left: 3px solid var(--accent);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* Staggered children animation */
.stagger-children > * {
  animation: slideUp 0.4s ease both;
}

.stagger-children > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8)  { animation-delay: 0.40s; }
.stagger-children > *:nth-child(9)  { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.50s; }
.stagger-children > *:nth-child(11) { animation-delay: 0.55s; }
.stagger-children > *:nth-child(12) { animation-delay: 0.60s; }


/* ============================================================
   16. FOOTER
   ============================================================ */

.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--accent-dim);
  padding: var(--space-10) 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
}

.footer-stats {
  display: flex;
  gap: var(--space-6);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer-stats span {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-stats-value {
  color: var(--text-muted);
}

.footer-copyright {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }

  .footer-stats {
    justify-content: center;
  }
}


/* ============================================================
   17. EMPTY STATES
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-6);
  min-height: 300px;
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--text-dim);
  margin-bottom: var(--space-5);
  opacity: 0.5;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--text-dim);
  max-width: 360px;
  margin-bottom: var(--space-6);
  line-height: 1.6;
}


/* ============================================================
   RESPONSIVE BREAKPOINTS — TABLET (768px)
   ============================================================ */

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding: var(--space-16) var(--space-4);
    padding-top: calc(var(--header-height) + var(--space-12));
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ============================================================
   RESPONSIVE BREAKPOINTS — MOBILE (480px)
   ============================================================ */

@media (max-width: 480px) {
  .hero {
    padding-top: calc(var(--header-height) + var(--space-8));
    padding-bottom: var(--space-10);
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }

  .admin-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
  }
}
