/* ═══════════════════════════════════════════════════════════
   CHATBER — Shared CSS for all public pages
   Used by: landing page, privacy policy, terms, refund, contact
═══════════════════════════════════════════════════════════ */

/* ─── Dark Theme (default) ─── */
:root, [data-theme="dark"] {
    --brand: #25D366;
    --brand-dark: #128C7E;
    --accent: #4A6CF7;
    --accent-dark: #3451c7;
    --dark: #0a0e1a;
    --dark-card: #111827;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --surface: #1e293b;
    --surface-light: #334155;
    --white: #ffffff;
    --glow: rgba(37, 211, 102, 0.15);
    --nav-scrolled-bg: rgba(10, 14, 26, 0.95);
    --nav-border: rgba(255,255,255,0.05);
    --card-border: rgba(255,255,255,0.05);
}

/* ─── Light Theme ─── */
[data-theme="light"] {
    --dark: #f8fafc;
    --dark-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --surface: #e2e8f0;
    --surface-light: #cbd5e1;
    --white: #0f172a;
    --nav-scrolled-bg: rgba(255,255,255,0.95);
    --nav-border: rgba(0,0,0,0.06);
    --card-border: rgba(0,0,0,0.06);
}
[data-theme="light"] .nav-logo { color: #0f172a; }
[data-theme="light"] .navbar.scrolled { background: var(--nav-scrolled-bg); border-bottom-color: var(--nav-border); }
[data-theme="light"] .btn-ghost { border-color: #d1d5db; color: #1e293b; }
[data-theme="light"] .footer-socials a { background: #e2e8f0; }
[data-theme="light"] .footer-col h4 { color: #0f172a; }

/* Light theme — Legal page overrides */
[data-theme="light"] .legal-hero { background: #f8fafc; }
[data-theme="light"] .legal-hero h1 { color: #0f172a; }
[data-theme="light"] .legal-hero .subtitle { color: #64748b; }
[data-theme="light"] .legal-hero .last-updated { background: #e2e8f0; color: #475569; border-color: #d1d5db; }
[data-theme="light"] .legal-hero .hero-label { background: rgba(37,211,102,0.08); border-color: rgba(37,211,102,0.2); }
[data-theme="light"] .legal-sub-nav a { background: #fff; border-color: #d1d5db; color: #475569; }
[data-theme="light"] .legal-sub-nav a:hover { border-color: var(--brand); color: var(--brand); }
[data-theme="light"] .legal-sub-nav a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme="light"] .legal-content { background: #fff; border-color: rgba(0,0,0,0.06); box-shadow: 0 4px 30px rgba(0,0,0,0.04); }
[data-theme="light"] .legal-content h2 { color: #0f172a; border-bottom-color: #e2e8f0; }
[data-theme="light"] .legal-content h3 { color: var(--accent); }
[data-theme="light"] .legal-content p { color: #475569; }
[data-theme="light"] .legal-content ul li { color: #475569; }
[data-theme="light"] .legal-content strong { color: #0f172a; }
[data-theme="light"] .toc { background: #f1f5f9; }
[data-theme="light"] .toc h4 { color: var(--brand); }
[data-theme="light"] .toc ol li a { color: #475569; }
[data-theme="light"] .toc ol li a:hover { color: var(--brand); }
[data-theme="light"] .highlight-box { background: #f1f5f9; }
[data-theme="light"] .highlight-box p { color: #1e293b; }
[data-theme="light"] .contact-card { background: #f1f5f9; }
[data-theme="light"] .contact-card p { color: #1e293b; }
[data-theme="light"] .footer-bottom { border-top-color: rgba(0,0,0,0.06); }

/* Smooth transitions */
body, .navbar, .legal-content, .toc, .highlight-box, .contact-card,
.btn-ghost, .theme-toggle, .footer-socials a {
    transition: background-color 0.4s ease, color 0.4s ease,
                border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ─── Reset ─── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Outfit', sans-serif;
    background: var(--dark);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ═══ NAVBAR ═══ */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 16px 0; transition: all 0.3s ease; background: transparent;
}
.navbar.scrolled {
    background: var(--nav-scrolled-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--nav-border);
    padding: 12px 0;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 1.5rem; color: var(--white);
}
.nav-logo .logo-icon {
    width: 36px; height: 36px; 
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #fff;
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
    font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
    transition: color 0.2s; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--white); }
.nav-links a::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 2px; background: var(--brand); transition: width 0.3s;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.btn-ghost {
    padding: 10px 20px; border-radius: 10px; font-weight: 500; font-size: 0.9rem;
    border: 1px solid var(--surface-light); color: var(--text);
    background: transparent; cursor: pointer; transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary {
    padding: 10px 24px; border-radius: 10px; font-weight: 600; font-size: 0.9rem;
    background: var(--brand); color: var(--dark); border: none;
    cursor: pointer; transition: all 0.2s; font-family: 'Outfit', sans-serif;
}
.btn-primary:hover { background: #1ebe5a; transform: translateY(-1px); }

/* ═══ THEME TOGGLE ═══ */
.theme-toggle {
    width: 40px; height: 40px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--card-border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease;
    color: var(--text-muted); font-size: 1rem;
    position: relative; overflow: hidden;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); transform: scale(1.05); }
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

/* ═══ FOOTER ═══ */
.footer {
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
[data-theme="light"] .footer { border-top-color: rgba(0,0,0,0.06); }
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px; margin-bottom: 40px;
}
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin: 16px 0; }
.footer-socials { display: flex; gap: 12px; }
.footer-socials a {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--surface); display: flex; align-items: center;
    justify-content: center; color: var(--text-muted);
    transition: all 0.2s; font-size: 0.85rem;
}
.footer-socials a:hover { background: var(--brand); color: #fff; }
.footer-col h4 { font-size: 0.9rem; font-weight: 600; color: var(--white); margin-bottom: 16px; }
.footer-col a { display: block; font-size: 0.85rem; color: var(--text-muted); padding: 4px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 24px; display: flex; justify-content: space-between; align-items: center;
}
[data-theme="light"] .footer-bottom { border-top-color: rgba(0,0,0,0.06); }
.footer-bottom p { font-size: 0.8rem; color: var(--text-muted); }
.footer-bottom-links { display: flex; gap: 24px; }
.footer-bottom-links a { font-size: 0.8rem; color: var(--text-muted); }
.footer-bottom-links a:hover { color: var(--brand); }

/* ═══ LEGAL PAGE STYLES ═══ */
.legal-hero {
    background: var(--dark);
    padding: 160px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.legal-hero::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(37,211,102,0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 30%, rgba(74,108,247,0.05) 0%, transparent 60%);
}
.legal-hero::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--card-border), transparent);
}
.legal-hero .hero-label {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 16px; border-radius: 50px;
    background: rgba(37,211,102,0.1); border: 1px solid rgba(37,211,102,0.2);
    font-size: 0.8rem; font-weight: 500; color: var(--brand);
    margin-bottom: 20px; position: relative;
}
.legal-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.2rem; color: var(--white); margin-bottom: 12px; position: relative;
}
[data-theme="light"] .legal-hero h1 { color: #0f172a; }
.legal-hero .subtitle { color: var(--text-muted); font-size: 1.1rem; position: relative; max-width: 500px; margin: 0 auto; }
.legal-hero .last-updated {
    display: inline-block; margin-top: 20px;
    background: var(--surface); padding: 6px 20px;
    border-radius: 50px; color: var(--text-muted);
    font-size: 0.8rem; position: relative;
    border: 1px solid var(--card-border);
}
/* Legal page nav links */
.legal-sub-nav {
    display: flex; justify-content: center; gap: 8px;
    margin-top: 28px; position: relative; flex-wrap: wrap;
}
.legal-sub-nav a {
    padding: 6px 16px; border-radius: 8px; font-size: 0.82rem; font-weight: 500;
    color: var(--text-muted); background: var(--surface);
    border: 1px solid var(--card-border); transition: all 0.2s;
}
.legal-sub-nav a:hover { color: var(--brand); border-color: var(--brand); }
.legal-sub-nav a.active {
    color: var(--dark); background: var(--brand); border-color: var(--brand); color: #fff;
}
[data-theme="light"] .legal-sub-nav a { background: #fff; }
[data-theme="light"] .legal-sub-nav a.active { color: #fff; }

.legal-content {
    background: var(--dark-card);
    border-radius: 20px; padding: 48px 56px;
    margin: -40px auto 60px; max-width: 900px;
    position: relative;
    box-shadow: 0 4px 30px rgba(0,0,0,0.15);
    border: 1px solid var(--card-border);
    animation: fadeUp 0.6s ease-out;
}
.legal-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem; color: var(--white);
    margin: 2.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--surface);
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 {
    font-size: 1.02rem; font-weight: 600;
    color: var(--brand); margin: 1.5rem 0 0.5rem;
}
.legal-content p { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.95rem; line-height: 1.75; }
.legal-content ul { list-style: none; margin: 0.5rem 0 1rem; padding: 0; }
.legal-content ul li {
    position: relative; padding-left: 1.5rem;
    margin-bottom: 0.6rem; color: var(--text-muted); font-size: 0.95rem; line-height: 1.7;
}
.legal-content ul li::before {
    content: ''; position: absolute; left: 0; top: 0.65rem;
    width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
}
.legal-content strong { color: var(--text); font-weight: 600; }
[data-theme="light"] .legal-content strong { color: #0f172a; }

.toc {
    background: var(--surface); border-radius: 14px;
    padding: 24px 28px; margin-bottom: 2rem;
}
.toc h4 {
    font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 2px; color: var(--brand); margin-bottom: 12px;
}
.toc ol { padding-left: 1.25rem; margin: 0; }
.toc ol li { margin-bottom: 6px; }
.toc ol li a {
    color: var(--text-muted); text-decoration: none;
    font-size: 0.9rem; transition: color 0.2s;
}
.toc ol li a:hover { color: var(--brand); }

.highlight-box {
    background: var(--surface); border-left: 4px solid var(--brand);
    padding: 16px 20px; border-radius: 0 12px 12px 0; margin: 1rem 0;
}
.highlight-box p { margin-bottom: 0; color: var(--text); }

.contact-card {
    background: var(--surface); border-radius: 14px; padding: 24px; margin-top: 1rem;
}
.contact-card p { margin-bottom: 6px; color: var(--text); }

/* ═══ ANIMATIONS ═══ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.reveal {
    opacity: 0; transform: translateY(30px);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .legal-content { padding: 32px 24px; margin: -24px 12px 40px; }
    .legal-hero h1 { font-size: 2rem; }
    .legal-hero { padding: 120px 0 60px; }
    .nav-links { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}