/* ==========================================================
   T.T.T PUBLICATIONS — PROFESSIONAL DUAL THEME
   Custom sub-background: #23364d (slate-blue) for dark theme
   ========================================================== */

/* ==========================================================
   DARK THEME (DEFAULT)
   ========================================================== */
:root,
html[data-theme="dark"] {
  /* --- Primary brand --- */
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --primary-bright: #60a5fa;
  --primary-glow: rgba(59, 130, 246, 0.35);

  /* --- Layer 0: Canvas (page bg) — near black --- */
  --dark-bg: #0b0f14;

  /* --- Layer 1: Surface (header, nav) --- */
  --dark-bg-2: #111721;

  /* --- Layer 2: Card / SUB-BACKGROUND — #23364d ✨ --- */
  --dark-card: #23364d;

  /* --- Layer 3: Elevated (thumbnails, hover) --- */
  --dark-card-2: #2a3f5c;

  /* --- Layer 4: Interactive (inputs, deeper panels) --- */
  --dark-section-bg: #1a2939;

  /* --- Borders --- */
  --dark-border-subtle: #1e2d3f;
  --dark-border: #2e445e;
  --dark-border-2: #3a5573;

  /* --- Book card specific --- */
  --book-card-bg: #23364d;
  --book-card-bg-2: #2a3f5c;

  /* --- Text hierarchy --- */
  --text-light: #e6edf3;
  --text-body: #c9d1d9;
  --text-muted: #8b949e;
  --text-placeholder: #6e7681;

  /* --- Top strip (darkest) --- */
  --top-strip-bg: #070a0e;
  --top-strip-text: #8b949e;

  /* --- Accents --- */
  --accent-yellow: #facc15;
  --accent-amber: #f59e0b;
  --accent-green: #3fb950;
  --accent-cyan: #06b6d4;
  --accent-red: #f85149;
  --accent-gold: #fbbf24;

  /* --- Tints --- */
  --tint-blue: rgba(59, 130, 246, 0.18);
  --tint-blue-2: rgba(59, 130, 246, 0.32);
  --tint-blue-3: rgba(96, 165, 250, 0.15);

  /* --- Hero overlay --- */
  --hero-overlay: linear-gradient(90deg, rgba(11, 15, 20, 0.92) 0%, rgba(11, 15, 20, 0.78) 45%, rgba(11, 15, 20, 0.5) 100%);
  
  /* --- Shared hero/chat surfaces --- */
  --hero-search-bg: #091325;
  --hero-search-border: #192c4f;
  --hero-frame-bg: #0d1a30;
  --hero-img-bg: #070e1c;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 12px 32px rgba(59, 130, 246, 0.35);
  --shadow-deep: 0 16px 48px rgba(0, 0, 0, 0.7);

  color-scheme: dark;
}

/* ==========================================================
   LIGHT THEME
   ========================================================== */
html[data-theme="light"] {
  /* --- Primary brand --- */
  --primary-color: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-bright: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.15);

  /* --- Layer 0: Canvas --- */
  --dark-bg: #f6f8fa;

  /* --- Layer 1: Surface --- */
  --dark-bg-2: #ffffff;

  /* --- Layer 2: Card / SUB-BACKGROUND — clean white in light mode --- */
  --dark-card: #ffffff;

  /* --- Layer 3: Elevated --- */
  --dark-card-2: #f6f8fa;

  /* --- Layer 4: Interactive --- */
  --dark-section-bg: #eef2f6;

  /* --- Borders --- */
  --dark-border-subtle: #eaeef2;
  --dark-border: #d0d7de;
  --dark-border-2: #a8b3bd;

  /* --- Book card specific --- */
  --book-card-bg: #ffffff;
  --book-card-bg-2: #f6f8fa;

  /* --- Text hierarchy --- */
  --text-light: #0d1117;
  --text-body: #24292f;
  --text-muted: #57606a;
  --text-placeholder: #6e7781;

  /* --- Top strip (stays navy) --- */
  --top-strip-bg: #0d1117;
  --top-strip-text: #8b949e;

  /* --- Accents --- */
  --accent-yellow: #d4a017;
  --accent-amber: #d97706;
  --accent-green: #1a7f37;
  --accent-cyan: #0284c7;
  --accent-red: #cf222e;
  --accent-gold: #d4a017;

  /* --- Tints --- */
  --tint-blue: #eef4fc;
  --tint-blue-2: #dbeafe;
  --tint-blue-3: #e0f2fe;

  /* --- Hero overlay --- */
  --hero-overlay: linear-gradient(90deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.65) 45%, rgba(15, 23, 42, 0.35) 100%);
  
  /* --- Shared hero/chat surfaces --- */
  --hero-search-bg: #ffffff;
  --hero-search-border: #cbd5e1;
  --hero-frame-bg: #ffffff;
  --hero-img-bg: #e2e8f0;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(27, 31, 36, 0.04);
  --shadow-card: 0 1px 3px rgba(27, 31, 36, 0.06), 0 1px 2px rgba(27, 31, 36, 0.04);
  --shadow-hover: 0 8px 24px rgba(29, 78, 216, 0.12);
  --shadow-deep: 0 16px 40px rgba(27, 31, 36, 0.1);

  color-scheme: light;
}

/* ==========================================================
   BASE BODY
   ========================================================== */
html[data-theme="dark"] body {
  background-color: var(--dark-bg) !important;
  color: var(--text-body) !important;
}

html[data-theme="light"] body {
  background-color: var(--dark-bg) !important;
  color: var(--text-body) !important;
}

/* ==========================================================
   SMOOTH TRANSITIONS
   ========================================================== */
html, body,
.site-header, .secondary-nav, .top-strip,
.stats-panel, .stat-item,
.book-card, .book-body, .book-thumb-wrap,
.category-tile, .category-tile-icon,
.section-head, .section-title,
.cart-btn, .account-chip, .icon-btn, .theme-toggle-btn {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}