/* =========================================================
   ChatAndgetPaid – Global Theme (cleaned)
   - Keeps your current look
   - Removes duplicate/conflicting blocks
   - Removes old header/nav system (you use header.php now)
   - Adds header theme tokens for day/night toggle
   ========================================================= */

/* ---------- RESET / BASE ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select {
  font-family: inherit;
}

/* ---------- ROOT TOKENS (your existing “light” tokens) ---------- */
:root {
  /* Brand */
  --accent: #ff68a5;
  --accent-soft: rgba(255, 104, 165, 0.12);
  --accent-strong: #f97316;
  --accent-strong-soft: rgba(249, 115, 22, 0.16);
  --gold: #c6a559;

  /* Base surfaces */
  --bg-page: #e5e7eb;
  --bg-frame: #f9fafb;
  --bg-card: #ffffff;

  /* Text */
  --text-main: #020617;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;
  --text-invert: #f9fafb;

  /* Borders & shadows */
  --border-subtle: rgba(148, 163, 184, 0.55);
  --border-strong: rgba(31, 41, 55, 0.16);
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.20);

  /* Links */
  --link: #38bdf8;
  --link-hover: #0ea5e9;

  /* Radii */
  --radius-frame: 28px;
  --radius-pill: 999px;

  /* Layout */
  --page-max-width: 1050px;

  /* Header tokens (used by /include/header.php) */
  --header-bg: rgba(2,6,23,0.72);
  --header-border: rgba(31,41,55,0.9);
  --header-link: var(--text-muted, #9ca3af);
  --header-link-hover: var(--text-invert, #f9fafb);
  --header-pill-bg: rgba(15,23,42,0.9);
  --header-pill-border: rgba(148,163,184,0.5);
  --header-pill-text: #e5e7eb;
}

/* =========================================================
   GLOBAL DARK / LIGHT THEME BEHAVIOR
   ========================================================= */

/* -------------------------
   LIGHT MODE (body.theme-light ON)
   ------------------------- */
body.theme-light{
  background: radial-gradient(circle at top, #f9fafb 0, #e5e7eb 40%, #d1d5db 100%);
  color: #111827;

  /* Header tokens in light */
  --header-bg: rgba(255,255,255,0.88);
  --header-border: #e5e7eb;
  --header-link: #374151;
  --header-link-hover: #111827;
  --header-pill-bg: #f3f4f6;
  --header-pill-border: #d1d5db;
  --header-pill-text: #111827;
}

/* Ensure page outside frame is light, no black strip (kept) */
body.theme-light::before{
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #f9fafb 0, #e5e7eb 40%, #d1d5db 100%);
  z-index: -1;
}

/* -------------------------
   DARK MODE (default)
   body has NO .theme-light
   ------------------------- */
body:not(.theme-light){
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
  color: #e5e7eb;
}

/* =========================================================
   PAGE BACKGROUND & FRAME
   ========================================================= */
.page-frame{
  max-width: var(--page-max-width);
  margin: 22px auto 24px;
  background: var(--bg-frame);
  border-radius: var(--radius-frame);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 540px;
}

/* For pages that don’t use .page-frame */
.page-main{ padding: 16px 22px 18px; }

.content-max{
  max-width: calc(var(--page-max-width) - 60px);
  margin: 0 auto;
}

/* Frame and main area in light */
body.theme-light .page-frame{
  background: #f9fafb;
  color: #111827;
  box-shadow: 0 18px 40px rgba(148, 163, 184, 0.45);
}

/* Frame and main area in dark */
body:not(.theme-light) .page-frame{
  background: #020617;
  color: #e5e7eb;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.9);
  border-radius: 28px;
}

/* =========================================================
   (REMOVED) TOP HEADER / NAVIGATION
   - Old classes: .nav-main .nav-link .brand-row etc.
   - Your active header lives in /include/header.php
   ========================================================= */

/* =========================================================
   BUTTONS
   ========================================================= */
.btn,
.btn-primary,
.btn-outline,
.btn-hero-primary{
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}

/* Solid brand button */
.btn-primary,
.btn-hero-primary{
  background: linear-gradient(135deg, #f97316, #ec4899);
  color: #f9fafb;
  box-shadow: 0 10px 26px rgba(248, 113, 22, 0.5);
}
.btn-primary:hover,
.btn-hero-primary:hover{ filter: brightness(1.06); }

/* Outline button */
.btn-outline{
  background: transparent;
  color: #4b5563;
  border: 1px solid rgba(148, 163, 184, 0.9);
  padding: 5px 12px;
}
.btn-outline:hover{ background: rgba(148, 163, 184, 0.12); }

/* Pill “Upgrade” (legacy class; safe to keep if used somewhere) */
.btn-upgrade-pill{
  background: linear-gradient(135deg, #f97316, #ec4899);
  color: #fdf2ff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.6);
}

/* =========================================================
   BADGES & LABELS
   ========================================================= */
.badge-pill{
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-live{ background: rgba(34, 197, 94, 0.16); color: #15803d; }
.badge-chat{ background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.badge-earn{ background: rgba(147, 51, 234, 0.14); color: #6d28d9; }

/* =========================================================
   HERO / LANDING CONTENT
   ========================================================= */
.hero-layout{
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px 18px 20px;
}
@media (max-width: 900px){
  .hero-layout{
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 14px 18px;
  }
}

.hero-text h1{
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 8px;
  color: #111827;
}
body:not(.theme-light) .hero-text h1{ color: #f9fafb; }

.hero-text p{
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.hero-cta-row{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Small stat pills under hero */
.hero-stats{
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.hero-stat-pill{
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(148, 163, 184, 0.12);
  color: #111827;
}
body:not(.theme-light) .hero-stat-pill{ color: #e5e7eb; }

/* =========================================================
   RIGHT HERO CARD (EARNING PREVIEW)
   ========================================================= */
.hero-preview-card{
  background: radial-gradient(circle at top left, #0f172a 0, #020617 65%);
  border-radius: 22px;
  padding: 12px 12px 10px;
  color: #e5e7eb;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(30, 64, 175, 0.6);
}

.hero-preview-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hero-preview-user{
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-preview-avatar{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: radial-gradient(circle at top, #22c55e 0, #16a34a 50%, #0f766e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.hero-preview-meta{ font-size: 10px; color: #9ca3af; }

.hero-preview-bubble{
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 14px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.3;
}

/* =========================================================
   DASHBOARD / CARDS
   ========================================================= */
.section-heading{
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 6px;
}
.section-subtitle{
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-grid-3{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 900px){
  .card-grid-3{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .card-grid-3{ grid-template-columns: minmax(0, 1fr); }
}

.card{
  background: var(--bg-card);
  border-radius: 18px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
}

.card-title{
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.card-text{
  font-size: 11px;
  color: var(--text-muted);
}

/* Dark mode cards */
body:not(.theme-light) .card,
body:not(.theme-light) .stat-card,
body:not(.theme-light) .table-wrap,
body:not(.theme-light) .section-panel{
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(55, 65, 81, 0.8);
  color: #e5e7eb;
}

/* Light mode cards */
body.theme-light .card,
body.theme-light .stat-card,
body.theme-light .table-wrap,
body.theme-light .section-panel{
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #111827;
}

/* Dashboard stats card */
.stat-card{ display: flex; flex-direction: column; gap: 4px; }
.stat-label{ font-size: 11px; color: var(--text-muted); }
.stat-value{ font-size: 18px; font-weight: 700; }

.stat-pill{
  font-size: 10px;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: #9f1239;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* =========================================================
   FORMS / INPUTS
   ========================================================= */
.form-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}
@media (max-width: 800px){
  .form-grid{ grid-template-columns: minmax(0, 1fr); }
}

.form-group{
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.form-group label{ font-size: 11px; color: #4b5563; }
body:not(.theme-light) .form-group label{ color: #e5e7eb; }

.input, select, textarea{
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  background: #ffffff;
  color: var(--text-main);
}
textarea{ resize: vertical; }

.input:focus, select:focus, textarea:focus{
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #93c5fd;
}

/* Dark mode form surfaces */
body:not(.theme-light) .input,
body:not(.theme-light) select,
body:not(.theme-light) textarea{
  background: rgba(15, 23, 42, 0.98);
  color: #f9fafb;
  border-color: rgba(75, 85, 99, 0.95);
}
body:not(.theme-light) .input::placeholder,
body:not(.theme-light) textarea::placeholder{ color: #9ca3af; }

/* Light mode form surfaces */
body.theme-light .input,
body.theme-light select,
body.theme-light textarea{
  background: #ffffff;
  color: #111827;
  border-color: #d1d5db;
}
body.theme-light .input::placeholder,
body.theme-light textarea::placeholder{ color: #9ca3af; }

/* =========================================================
   REFERRALS / TABLES
   ========================================================= */
.table-wrap{
  margin-top: 10px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
}

.table{
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th, .table td{
  padding: 6px 10px;
  border-bottom: 1px solid rgba(229, 231, 235, 1);
}

.table th{
  text-align: left;
  background: #f3f4f6;
  font-size: 11px;
  color: #4b5563;
}

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

/* Tables in dark mode */
body:not(.theme-light) .table-wrap{ background: rgba(15, 23, 42, 0.98); }
body:not(.theme-light) .table{ color: #e5e7eb; }
body:not(.theme-light) .table th{
  background: rgba(31, 41, 55, 0.98);
  color: #e5e7eb;
  border-bottom-color: rgba(55, 65, 81, 1);
}
body:not(.theme-light) .table td{ border-bottom-color: rgba(31, 41, 55, 1); }

/* Tables in light mode */
body.theme-light .table{ color: #111827; }
body.theme-light .table th{
  background: #f3f4f6;
  color: #4b5563;
  border-bottom-color: #e5e7eb;
}
body.theme-light .table td{ border-bottom-color: #e5e7eb; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{
  margin-top: auto;
  border-top: 1px solid rgba(209, 213, 219, 1);
  padding: 6px 14px 8px;
  font-size: 11px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer-links a{
  font-size: 11px;
  text-decoration: none;
  color: var(--text-soft);
  margin-left: 10px;
}
.site-footer-links a:hover{ color: var(--link-hover); }

/* Footer in light mode */
body.theme-light .site-footer{
  border-top-color: #e5e7eb;
  color: #6b7280;
  background: #f9fafb;
}
body.theme-light .site-footer-links a{ color: #6b7280; }
body.theme-light .site-footer-links a:hover{ color: #0ea5e9; }

/* Footer in dark mode */
body:not(.theme-light) .site-footer{
  border-top-color: rgba(31, 41, 55, 1);
  color: #9ca3af;
  background: #020617;
}
body:not(.theme-light) .site-footer-links a{ color: #9ca3af; }
body:not(.theme-light) .site-footer-links a:hover{ color: #38bdf8; }

/* =========================================================
   SMALL UTILITIES
   ========================================================= */
.text-muted{ color: var(--text-muted); }
.text-soft{ color: var(--text-soft); }
.text-gold{ color: var(--gold); }

.mt-0{ margin-top: 0; }
.mt-1{ margin-top: 4px; }
.mt-2{ margin-top: 8px; }

.mb-0{ margin-bottom: 0; }
.mb-1{ margin-bottom: 4px; }
.mb-2{ margin-bottom: 8px; }
.mb-3{ margin-bottom: 12px; }

.d-flex{ display: flex; }
.flex-center{ align-items: center; justify-content: center; }
.gap-1{ gap: 4px; }
.gap-2{ gap: 8px; }
