/* ==================== CORE STYLES (FROM APP) ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea, #764ba2);
    --bg-light: #f8f9fa;
    --bg-dark: #1e1e2e;
    --text-light: #333;
    --text-dark: #e0e0e0;
    --card-light: white;
    --card-dark: #2a2a3e;
    --accent: #667eea;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

body.dark-mode {
    background: #1a1a2e;
    /* Slightly darker than app container for contrast */
    color: var(--text-dark);
}

/* ==================== SCROLLBARS ==================== */
::-webkit-scrollbar {
    width: 10px;
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.8);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 1);
}

body.dark-mode ::-webkit-scrollbar {
    background: rgba(255, 255, 255, 0.05);
}

/* ==================== LAYOUT ==================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease;
}

body.dark-mode .app-header {
    background: rgba(42, 42, 62, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.app-logo {
    width: 40px;
    height: 40px;
}

.app-logo svg,
.app-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

h1.brand-title {
    font-size: 1.8em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 100px auto 40px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
}

/* ==================== SIDEBAR NAV ==================== */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 10px;
}

.nav-link {
    display: block;
    padding: 8px 0;
    color: #666;
    text-decoration: none;
    font-size: 0.9em;
    border-right: 2px solid transparent;
    transition: all 0.2s;
}

body.dark-mode .nav-link {
    color: #aaa;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    border-right-color: var(--accent);
    padding-left: 5px;
}

/* ==================== CONTENT CARD ==================== */
.policy-content {
    background: var(--card-light);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

body.dark-mode .policy-content {
    background: var(--card-dark);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/*Typography*/
h2 {
    font-size: 1.8em;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--accent);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    padding-bottom: 10px;
}

h2:first-child {
    margin-top: 0;
}

h3 {
    font-size: 1.3em;
    margin-top: 25px;
    margin-bottom: 15px;
    color: #444;
}

body.dark-mode h3 {
    color: #ccc;
}

h4 {
    font-size: 1.1em;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #555;
}

body.dark-mode h4 {
    color: #bbb;
}

p,
ul,
li,
ol {
    margin-bottom: 15px;
}

.policy-content a {
    color: #5D6DEA;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.policy-content a:hover {
    opacity: 0.8;
}

ul,
ol {
    padding-left: 20px;
}

.note {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid var(--accent);
    padding: 15px;
    border-radius: 0 8px 8px 0;
    font-size: 0.95em;
    margin: 20px 0;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

body.dark-mode .info-table {
    background: rgba(255, 255, 255, 0.05);
}

.info-table th,
.info-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .info-table th,
body.dark-mode .info-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.info-table th {
    width: 30%;
    color: var(--accent);
}

/* ==================== BUTTONS ==================== */
.theme-toggle {
    position: fixed;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 10px;
    width: 45px;
    height: 45px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body.dark-mode .theme-toggle {
    background: rgba(42, 42, 62, 0.95);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.theme-toggle:hover {
    transform: scale(1.05);
}

/* ==================== MOBILE ==================== */
@media (max-width: 992px) {
    .container {
        display: block;
        /* Use block to avoid grid issues with fixed children on mobile */
        margin: 80px auto 20px;
        padding: 0 10px;
        width: 100%;
        max-width: 100%;
    }

    .sidebar {
        display: none;
        /* Hide sidebar in layout flow */
    }

    .policy-content {
        padding: 25px 20px;
        margin: 0 auto;
        width: 100%;
        border-radius: 12px;
    }

    h1.brand-title {
        font-size: 1.4em;
    }

    h2 {
        font-size: 1.5em;
        margin-top: 30px;
    }

    .info-table {
        font-size: 0.85em;
        display: block;
        overflow-x: auto;
    }

    .info-table th,
    .info-table td {
        padding: 8px;
        word-break: break-word;
    }

    .info-table th {
        width: 40%;
    }
}