/* CSS Custom Properties for Theme Tokens */
:root[data-theme="dark"] {
    --bg-primary: #0b0f19;
    --bg-secondary: #161c2a;
    --bg-tertiary: #1f293d;
    --bg-gradient: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%), 
                   radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 40%);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #6366f1;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-hover: #4f46e5;
    --border: #222e45;
    --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
    --badge-bg: rgba(99, 102, 241, 0.15);
    --badge-color: #a5b4fc;
}

:root[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-gradient: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 40%), 
                   radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #4f46e5;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --accent-hover: #4338ca;
    --border: #e2e8f0;
    --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    --badge-bg: rgba(79, 70, 229, 0.08);
    --badge-color: #4f46e5;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

/* Header / Navbar */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(var(--bg-primary), 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.app-logo {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.logo:hover .app-logo {
    transform: scale(1.05);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
}

.btn:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Show/Hide theme icons */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3.5rem;
    padding: 3rem 2rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.meta-dates {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.date-badge {
    background-color: var(--badge-bg);
    color: var(--badge-color);
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.hero p {
    max-width: 750px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Dashboard Overview Grid */
.dashboard-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.dash-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.dash-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: var(--card-shadow);
}

.dash-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: var(--bg-tertiary);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: background-color 0.2s ease;
}

.dash-card:hover .dash-icon {
    background: var(--accent-gradient);
    color: #ffffff;
}

.dash-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.dash-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.dash-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Search Section */
.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto 3rem auto;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-box svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Layout Grid */
.layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
}

/* Sidebar navigation */
aside {
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar for sidebar */
aside::-webkit-scrollbar {
    width: 4px;
}
aside::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
}

.sidebar-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-left: 0.75rem;
    font-weight: 700;
}

.toc-list {
    list-style: none;
}

.toc-item a {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid transparent;
}

.toc-item a:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.toc-item.active a {
    color: var(--accent);
    background-color: var(--badge-bg);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* Policy Article */
article {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--card-shadow);
}

.policy-section {
    scroll-margin-top: 100px;
    margin-bottom: 3.5rem;
}

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

.policy-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.policy-section h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.5rem;
    background: var(--accent-gradient);
    border-radius: 4px;
}

.policy-section p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.policy-section h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem 0;
    color: var(--text-primary);
}

.policy-section ul {
    list-style: none;
    margin-bottom: 1.5rem;
    padding-left: 0.25rem;
}

.policy-section li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 1.02rem;
}

.policy-section li::before {
    content: "";
    position: absolute;
    left: 0.25rem;
    top: 0.65rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent);
}

/* Highlight box for key notes */
.info-box {
    background-color: var(--bg-tertiary);
    border-left: 4px solid var(--accent);
    padding: 1.25rem 1.5rem;
    border-radius: 0 12px 12px 0;
    margin: 1.5rem 0;
}

.info-box p {
    margin-bottom: 0;
    font-size: 0.98rem;
    color: var(--text-primary);
}

.info-box p strong {
    color: var(--accent);
}

/* Highlight Matching Search Text */
.highlight {
    background-color: rgba(245, 158, 11, 0.3);
    color: #ffffff;
    border-radius: 2px;
    padding: 0 2px;
}

/* Contact Details Card */
.contact-card {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    margin-top: 1.5rem;
}

.contact-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.contact-card p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

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

.contact-card a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 0.5rem;
}

/* Back to top button */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--accent);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background-color: var(--accent-hover);
    transform: scale(1.1);
}

.scroll-top svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* Responsive Layouts */
@media (max-width: 968px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }

    aside {
        display: none; /* Hide sidebar list on tablets and mobile */
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    article {
        padding: 2rem;
    }
}

@media (max-width: 576px) {
    header {
        padding: 1rem;
    }

    .logo span {
        display: none; /* Hide text, only show shuttle icon on very small screens */
    }

    .container {
        padding: 1.5rem 1rem;
    }

    .hero {
        padding: 2rem 1.25rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    article {
        padding: 1.5rem 1rem;
    }

    .policy-section h2 {
        font-size: 1.4rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: #ffffff;
        color: #000000;
    }

    header, aside, .theme-toggle, .btn, .search-box, .scroll-top, .dashboard-grid, .dashboard-title {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    article {
        border: none;
        box-shadow: none;
        padding: 0;
        background: none;
    }

    .policy-section {
        page-break-inside: avoid;
    }
}
