/* --- CSS Variables & Reset --- */
:root {
    /* === LIGHT THEME (default) === */
    --bg-primary: #FAF7F2;
    --bg-secondary: #FFFFFF;
    --bg-elevated: #F1E8DE;
    --bg-sidebar: #FAF7F2;

    --text-primary: #1F1F1F;
    --text-secondary: #3F3F3F;
    --text-muted: #6B6B6B;

    --brand-primary: #D4A017;
    --brand-secondary: #B08900;

    --btn-primary: #3B6EF5;
    --btn-primary-hover: #2F5BD3;
    --btn-secondary: #E8EEFF;

    --success: #2E7D32;
    --warning: #E09F3E;
    --danger: #C62828;

    /* Premium Effects */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(212, 160, 23, 0.15);
    --glass-shadow: 0 8px 32px rgba(31, 31, 31, 0.08);
    --gradient-1: radial-gradient(ellipse at 20% 20%, rgba(212, 160, 23, 0.08) 0%, transparent 50%);
    --gradient-2: radial-gradient(ellipse at 80% 80%, rgba(212, 160, 23, 0.05) 0%, transparent 50%);

    /* Legacy mappings for compatibility */
    --bg-body: var(--bg-primary);
    --bg-card: var(--bg-secondary);
    --text-main: var(--text-primary);
    --text-muted: var(--text-muted);
    --primary: var(--brand-primary);
    --primary-hover: var(--brand-secondary);
    --border: var(--bg-elevated);
    --accent-alert: var(--danger);
    --accent-success: var(--success);

    --font-main: 'Inter', sans-serif;
    --sidebar-width: 280px;
    --header-height: 56px;
}

[data-theme='dark'] {
    /* === DARK THEME === */
    --bg-primary: #2E1B13;
    --bg-secondary: #4A2E21;
    --bg-elevated: #6B3F2A;
    --bg-sidebar: #2E1B13;

    --text-primary: #F5F5F5;
    --text-secondary: #D1D1D1;
    --text-muted: #9E9E9E;

    --brand-primary: #F2C94C;
    --brand-secondary: #D4A017;

    --btn-primary: #3B6EF5;
    --btn-primary-hover: #2F5BD3;
    --btn-secondary: #5B8CFF;

    --success: #4CAF50;
    --warning: #FFB703;
    --danger: #D62828;

    /* Premium Effects - Dark Theme */
    --glass-bg: rgba(74, 46, 33, 0.6);
    --glass-border: rgba(242, 201, 76, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --gradient-1: radial-gradient(ellipse at 20% 20%, rgba(242, 201, 76, 0.06) 0%, transparent 50%);
    --gradient-2: radial-gradient(ellipse at 80% 80%, rgba(242, 201, 76, 0.04) 0%, transparent 50%);

    /* Legacy mappings for compatibility */
    --bg-body: var(--bg-primary);
    --bg-card: var(--bg-secondary);
    --text-main: var(--text-primary);
    --text-muted: var(--text-muted);
    --primary: var(--brand-primary);
    --primary-hover: var(--brand-secondary);
    --border: var(--bg-elevated);
    --accent-alert: var(--danger);
    --accent-success: var(--success);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Accessibility: Visually Hidden (for screen readers) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--brand-secondary);
}

/* --- Layout --- */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo span {
    color: var(--brand-primary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: opacity 0.3s ease;
}

.lang-switcher {
    display: flex;
    align-items: center;
}

.lang-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    height: 32px;
    transition: all 0.2s;
    outline: none;
}

.lang-select:hover {
    border-color: var(--brand-primary);
    background: var(--bg-elevated);
}

.lang-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(242, 201, 76, 0.2);
}

/* Dark theme specific adjustments */
[data-theme='dark'] .lang-select {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme='dark'] .lang-select:hover {
    background: var(--bg-elevated);
}

/* --- Main Content Area --- */
.main-wrapper {
    display: flex;
    margin-top: var(--header-height);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* --- Sidebar Navigation --- */
.sidebar {
    width: var(--sidebar-width);
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    height: fit-content;
    padding-right: 2rem;
    display: none;
}

@media (min-width: 900px) {
    .sidebar {
        display: block;
    }
}

.nav-list {
    list-style: none;
    border-left: 1px solid var(--border);
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-left: 2px solid transparent;
    margin-left: -1px;
}

.nav-link:hover {
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(90deg, rgba(242, 201, 76, 0.1), transparent);
}

.nav-link.active {
    color: var(--brand-primary);
    border-left-color: var(--brand-primary);
    font-weight: 500;
}

/* --- Content --- */
.content {
    flex: 1;
    padding: 2rem;
    background: var(--bg-body);
    min-width: 0;
}

.policy-header {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
}

.policy-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.policy-meta {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    background: rgba(242, 201, 76, 0.1);
    color: var(--brand-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- Typography & Sections --- */
section {
    margin-bottom: 4rem;
    scroll-margin-top: calc(var(--header-height) + 2rem);
}

.section-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-number {
    color: var(--brand-primary);
    font-variant-numeric: tabular-nums;
}

p {
    margin-bottom: 1.25rem;
}

ul, ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    color: var(--text-main);
}

li {
    margin-bottom: 0.5rem;
}

.list-legal {
    list-style-type: none;
    padding-left: 0;
}

.list-legal li {
    position: relative;
    padding-left: 1.5rem;
}

.list-legal li::before {
    content: "•";
    color: var(--brand-primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* --- Info Cards --- */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-card-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-link {
    color: var(--brand-primary);
    font-weight: 500;
    word-break: break-all;
}

/* --- Warning Box --- */
.warning-box {
    background: rgba(244, 63, 94, 0.05);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    color: #fda4af;
    margin-top: 1rem;
}

/* --- Footer --- */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.copyright {
    margin: 0;
    text-align: center;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--brand-primary);
}

.footer-divider {
    color: var(--border);
}

/* --- Custom Scrollbar --- */
/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: #D4C4B0;
    border-radius: 4px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary);
}

/* Firefox scrollbar */
:root {
    scrollbar-color: #D4C4B0 #FAF7F2;
}

[data-theme='dark'] {
    scrollbar-color: #6B3F2A #2E1B13;
}

/* --- Responsive Tweaks --- */
@media (max-width: 600px) {
    .header {
        padding: 0 0.75rem;
    }
    .content {
        padding: 1.5rem 1rem;
    }
    .policy-title {
        font-size: 1.75rem;
    }
    .section-title {
        font-size: 1.25rem;
    }
    .policy-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ========================================
   PREMIUM LANDING PAGE STYLES
   ======================================== */

/* Glassmorphism Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Animated Background Gradients */
.gradient-bg {
    background:
        var(--gradient-1),
        var(--gradient-2);
    background-attachment: fixed;
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Animation Delays */
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }

/* Premium Button Styles */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.98);
}

/* Premium Card Hover */
.premium-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(212, 160, 23, 0.15);
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float {
    animation: float 6s ease-in-out infinite;
}

/* Pulse Glow Animation */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 160, 23, 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 160, 23, 0.2);
    }
}

.pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* Subtle Gradient Animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

/* Premium Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Smooth Section Transitions */
section {
    position: relative;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    opacity: 0;
    transition: opacity 0.5s;
}

section:hover::before {
    opacity: 1;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}
