/*
 * ViViDly — Legal Pages Shared Stylesheet (legal.css)
 * Dark + Light theme toggle support | Outfit font | Glass cards
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

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

/* ============================================================
   DARK THEME VARIABLES (default)
   ============================================================ */
:root {
    --bg: #060b18;
    --bg2: #0d1424;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.07);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #4facfe;
    --accent-2: #a18cd1;
    --gradient: linear-gradient(90deg, #ff9a9e 0%, #a18cd1 50%, #4facfe 100%);
    --card-radius: 16px;
    --nav-bg: rgba(6, 11, 24, 0.85);
    --hero-glow: rgba(161, 140, 209, 0.15);
    --contact-bg: linear-gradient(135deg, rgba(79, 172, 254, 0.06), rgba(161, 140, 209, 0.06));
    --contact-border: rgba(79, 172, 254, 0.15);
    --nav-h: 64px;
    --toggle-track: rgba(255, 255, 255, 0.08);
    --toggle-icon: #94a3b8;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   LIGHT THEME VARIABLES
   ============================================================ */
body.light-theme {
    --bg: #f0f4ff;
    --bg2: #e8edf8;
    --surface: rgba(255, 255, 255, 0.8);
    --surface-hover: rgba(255, 255, 255, 1);
    --border: rgba(0, 0, 0, 0.07);
    --text: #1e293b;
    --text-muted: #475569;
    --nav-bg: rgba(240, 244, 255, 0.9);
    --hero-glow: rgba(161, 140, 209, 0.1);
    --contact-bg: linear-gradient(135deg, rgba(79, 172, 254, 0.05), rgba(161, 140, 209, 0.05));
    --contact-border: rgba(79, 172, 254, 0.2);
    --toggle-track: rgba(0, 0, 0, 0.06);
    --toggle-icon: #475569;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Smooth theme transition */
body,
.legal-nav,
.policy-card,
.vividly-footer,
.callout,
.table-wrapper,
.contact-card,
.policy-nav-card,
td,
th {
    transition: background 0.25s ease, color 0.2s ease, border-color 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.7;
}

/* Background subtle gradient */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 80% 10%, rgba(161, 140, 209, 0.07), transparent),
        radial-gradient(ellipse 50% 40% at 10% 90%, rgba(79, 172, 254, 0.05), transparent);
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.legal-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 17px;
}

.nav-logo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: white;
    padding: 3px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-back {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all 0.2s;
}

.nav-back:hover {
    color: var(--text);
    border-color: rgba(79, 172, 254, 0.4);
    background: rgba(79, 172, 254, 0.06);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--toggle-track);
    color: var(--toggle-icon);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: rgba(79, 172, 254, 0.1);
    border-color: rgba(79, 172, 254, 0.3);
    color: var(--accent);
}

/* ============================================================
   HERO
   ============================================================ */
.legal-hero {
    text-align: center;
    padding: 64px 24px 44px;
    position: relative;
    z-index: 1;
}

.legal-hero::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse, var(--hero-glow), transparent 70%);
    pointer-events: none;
}

.hero-icon {
    font-size: 52px;
    margin-bottom: 16px;
    display: block;
    filter: drop-shadow(0 4px 20px rgba(161, 140, 209, 0.4));
}

.legal-hero h1 {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.hero-meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
.legal-content {
    flex: 1;
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px 60px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

/* ============================================================
   POLICY CARDS
   ============================================================ */
.policy-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 28px 32px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    transition: border-color 0.2s, transform 0.2s;
}

.policy-card:hover {
    border-color: rgba(79, 172, 254, 0.2);
    transform: translateY(-1px);
}

.policy-card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.policy-card p {
    font-size: 14.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.policy-card p:last-child {
    margin-bottom: 0;
}

.policy-card p strong {
    color: var(--text);
    font-weight: 600;
}

.policy-card ul,
.policy-card ol {
    margin: 10px 0 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.policy-card li {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

.policy-card li strong {
    color: var(--text);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 10px;
    border: 1px solid var(--border);
}

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

thead {
    background: rgba(79, 172, 254, 0.06);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #a18cd1;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.5;
}

td strong {
    color: var(--text);
}

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

tbody tr:hover td {
    background: var(--surface-hover);
}

/* ============================================================
   CALLOUTS
   ============================================================ */
.callout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 18px;
    border-radius: 10px;
    margin: 14px 0;
    font-size: 14px;
    line-height: 1.6;
}

.callout-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.callout-warning {
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: #b45309;
}

body:not(.light-theme) .callout-warning {
    color: #fbbf24cc;
}

.callout-info {
    background: rgba(79, 172, 254, 0.06);
    border: 1px solid rgba(79, 172, 254, 0.2);
    color: var(--text-muted);
}

.callout-success {
    background: rgba(74, 222, 128, 0.06);
    border: 1px solid rgba(74, 222, 128, 0.2);
    color: #15803d;
}

body:not(.light-theme) .callout-success {
    color: #4ade80aa;
}

.callout strong {
    font-weight: 600;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-green {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.badge-red {
    background: rgba(248, 113, 113, 0.1);
    color: #ef4444;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.badge-blue {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
    border: 1px solid rgba(79, 172, 254, 0.2);
}

.badge-purple {
    background: rgba(161, 140, 209, 0.1);
    color: #a18cd1;
    border: 1px solid rgba(161, 140, 209, 0.2);
}

body.light-theme .badge-green {
    color: #15803d;
}

body.light-theme .badge-red {
    color: #dc2626;
}

/* ============================================================
   CONTACT CARD
   ============================================================ */
.contact-card {
    background: var(--contact-bg);
    border: 1px solid var(--contact-border);
    border-radius: var(--card-radius);
    padding: 28px 32px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.contact-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-card p {
    color: var(--text-muted);
    font-size: 14.5px;
    margin-bottom: 6px;
}

.contact-card a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.contact-card a:hover {
    text-decoration: underline;
}

/* ============================================================
   POLICY NAV GRID
   ============================================================ */
.policy-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.policy-nav-card {
    display: block;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.policy-nav-card:hover {
    color: var(--text);
    border-color: rgba(79, 172, 254, 0.3);
    background: rgba(79, 172, 254, 0.05);
    transform: translateY(-1px);
}

/* ============================================================
   FOOTER (matches main app)
   ============================================================ */
.vividly-footer {
    background: #0a0f1e;
    color: #c8b89a;
    font-family: 'Outfit', sans-serif;
    padding: 36px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

/* Footer is always dark regardless of page theme */
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
}

.footer-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: contain;
    background: white;
    padding: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.footer-brand-name {
    font-size: 17px;
    font-weight: 700;
    color: #e8d9c0;
}

.footer-socials {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-social-link {
    color: #c8b89a;
    display: flex;
    align-items: center;
    transition: color 0.2s, transform 0.2s;
    text-decoration: none;
}

.footer-social-link:hover {
    color: white;
    transform: translateY(-2px);
}

.footer-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0;
}

.footer-policies {
    padding: 20px 0;
    text-align: center;
}

.footer-policies-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(200, 184, 154, 0.5);
    text-transform: uppercase;
    margin-bottom: 14px;
}

.footer-policy-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 0;
}

.footer-policy-link {
    color: #c8b89a;
    font-size: 13px;
    text-decoration: none;
    padding: 4px 14px;
    transition: color 0.2s;
    white-space: nowrap;
    position: relative;
}

.footer-policy-link:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 12px;
    background: rgba(200, 184, 154, 0.25);
}

.footer-policy-link:hover {
    color: white;
}

.footer-policy-link.active {
    color: white;
    font-weight: 600;
}

.footer-copyright {
    padding: 16px 0 20px;
    text-align: center;
    font-size: 12px;
    color: rgba(200, 184, 154, 0.45);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .legal-nav {
        padding: 0 16px;
    }

    .legal-hero {
        padding: 48px 16px 32px;
    }

    .legal-content {
        padding: 0 16px 50px;
    }

    .policy-card {
        padding: 20px 18px;
    }

    .footer-inner {
        padding: 0 20px;
    }

    .footer-brand-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-policy-link {
        font-size: 12px;
        padding: 4px 10px;
    }

    .footer-copyright {
        font-size: 11px;
        line-height: 1.6;
    }

    .policy-nav-grid {
        grid-template-columns: 1fr 1fr;
    }

    .nav-brand span {
        display: none;
    }
}

@media (max-width: 480px) {
    .legal-hero {
        padding: 40px 16px 28px;
    }

    .policy-nav-grid {
        grid-template-columns: 1fr;
    }

    .footer-policy-link {
        font-size: 11px;
        padding: 4px 7px;
    }
}