/**
 * SafeClick - Legal Pages Stylesheet (Privacy Policy & Terms of Service)
 * Location: assets/css/legal.css
 * Standard: Modern Dark Cyberpunk Aesthetic, Belgian & EU Compliance UI
 */

:root {
    --bg-page: #070b13;
    --bg-surface: #0d1322;
    --bg-card: rgba(18, 26, 44, 0.7);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(56, 189, 248, 0.3);
    --text-heading: #f8fafc;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --accent-cyan: #38bdf8;
    --accent-emerald: #10b981;
    --accent-indigo: #6366f1;
    --accent-rose: #f43f5e;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body.legal-page-privacy,
body.legal-page-terms {
    background: var(--bg-page);
    color: var(--text-body);
    font-family: var(--font-sans);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Ambient Glow Background Elements */
.ambient-glow {
    position: fixed;
    top: -150px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.ambient-glow-2 {
    position: fixed;
    bottom: 100px;
    left: -150px;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* Specific glows for Terms page */
body.legal-page-terms .ambient-glow {
    right: auto;
    left: -100px;
}

body.legal-page-terms .ambient-glow-2 {
    left: auto;
    right: -150px;
    bottom: 80px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
}

/* Header Navigation */
.legal-header {
    background: rgba(9, 13, 22, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.legal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.legal-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==========================================================================
   Admin Dashboard Unified Language Switcher (.sa-lang-dropdown)
   ========================================================================== */
.sa-lang-dropdown {
    position: relative;
    display: inline-block;
}

.sa-lang-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 175px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.15), 0 4px 8px -2px rgba(15, 23, 42, 0.05);
    padding: 6px;
    z-index: 99999;
}

.sa-lang-dropdown.open .sa-lang-dropdown-menu {
    display: block !important;
    animation: saDropdownFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes saDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sa-lang-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    border-radius: 6px;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

.sa-lang-dropdown-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.sa-lang-dropdown-item.active {
    background: rgba(0, 242, 254, 0.12);
    color: #0891b2;
}

.lang-switch-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    outline: none;
    user-select: none;
}

.lang-switch-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.legal-header-right .lang-switch-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Back to SafeClick Header Navigation Button */
.legal-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    font-size: 0.80rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 16px;
    height: 38px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1;
}

.legal-back-btn:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
    text-decoration: none;
    transform: translateY(-1px);
}

/* Hero Banner */
.legal-hero {
    position: relative;
    z-index: 1;
    padding: 60px 24px 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, rgba(13, 19, 34, 0.6) 0%, rgba(7, 11, 19, 0) 100%);
}

.legal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-mono);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    margin-bottom: 18px;
}

.legal-hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.legal-hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 760px;
    margin: 0 auto 16px;
}

.legal-meta-bar {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Two-Column Document Layout */
.legal-container {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
    flex: 1;
}

/* Sticky Sidebar TOC */
.legal-toc {
    position: sticky;
    top: 100px;
    height: fit-content;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.legal-toc-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--accent-cyan);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-toc-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.83rem;
    font-weight: 500;
    display: block;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.legal-toc-link:hover {
    color: var(--text-heading);
    background: rgba(255, 255, 255, 0.05);
    padding-left: 14px;
}

/* Main Legal Content */
.legal-body {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px 48px;
}

.legal-section {
    margin-bottom: 44px;
    scroll-margin-top: 110px;
}

.legal-section:last-child {
    margin-bottom: 0;
}

.legal-section h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.01em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 20px 0 10px;
}

.legal-section p {
    margin-bottom: 14px;
    color: var(--text-body);
    font-size: 0.94rem;
}

.legal-section ul {
    margin-left: 24px;
    margin-bottom: 16px;
    color: var(--text-body);
    font-size: 0.92rem;
}

.legal-section li {
    margin-bottom: 8px;
}

/* Callout & Information Boxes */
.legal-callout-box {
    background: rgba(56, 189, 248, 0.06);
    border-left: 4px solid var(--accent-cyan);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 0.9rem;
    color: #e0f2fe;
}

/* Terms Penal Warning (Red / Rose border) */
body.legal-page-terms .legal-callout-box {
    background: rgba(244, 63, 94, 0.06);
    border-left: 4px solid #f43f5e;
    color: #ffe4e6;
}

.legal-info-box {
    background: rgba(56, 189, 248, 0.06);
    border-left: 4px solid var(--accent-cyan);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 0.9rem;
    color: #e0f2fe;
}

.legal-authority-box {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin: 20px 0;
    font-size: 0.9rem;
    color: #d1fae5;
}

/* Unified Global Footer */
.sa-global-footer {
    background: #090d16;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 32px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 20;
}

.sa-footer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    max-width: 1920px;
    margin: 0 auto;
}

.sa-footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.81rem;
    color: #94a3b8;
    flex-wrap: wrap;
}

.sa-footer-title {
    color: #f1f5f9;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sa-footer-ver {
    color: #38bdf8;
    font-family: var(--font-mono);
    font-weight: 700;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.77rem;
}

.sa-footer-divider {
    color: rgba(255, 255, 255, 0.15);
}

.sa-footer-copyright {
    color: #64748b;
}

.sa-footer-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sa-footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: #94a3b8;
}

.sa-footer-link {
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.15s ease;
    font-weight: 500;
}

.sa-footer-link:hover,
.sa-footer-link.active {
    color: #38bdf8;
    text-decoration: underline;
    text-underline-offset: 4px;
}

@media (max-width: 900px) {
    .legal-container {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 32px 16px;
    }
    .legal-toc {
        position: static;
    }
    .legal-body {
        padding: 24px 20px;
    }
    .legal-header {
        padding: 14px 18px;
    }
    .legal-hero h1 {
        font-size: 2rem;
    }
    .sa-global-footer {
        padding: 12px 16px;
    }
    .sa-footer-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
