/* Inherit previous vars */
:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;

    /* RGB Values for opacity (r, g, b) */
    --primary-rgb: 59, 130, 246;
    --accent-rgb: 6, 182, 212;
    --success-rgb: 16, 185, 129;
    --warning-rgb: 245, 158, 11;
    --card-bg-subtle: rgba(255, 255, 255, 0.03);
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-dark: #f1f5f9;
    /* Slate 100 */
    --bg-darker: #f8fafc;
    /* Slate 50 */
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.3);
    --accent: #0891b2;
    --success: #059669;
    --warning: #d97706;
    --glass-bg: rgba(255, 255, 255, 0.85);
    /* Slightly clearer to show bg texture */
    --glass-border: rgba(0, 0, 0, 0.1);
    /* Dark border for contrast on light bg */
    --text-main: #000000;
    /* Pure Black */
    --text-dim: #333333;
    /* High contrast gray */
    --card-bg-subtle: rgba(0, 0, 0, 0.05);

    /* RGB Values for Light Mode */
    --primary-rgb: 37, 99, 235;
    --accent-rgb: 8, 145, 178;
    --success-rgb: 5, 150, 105;
    --warning-rgb: 217, 119, 6;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg-darker);
    height: 100%;
    width: 100%;
    overscroll-behavior: none;
    /* Prevent bounce revealing background */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-main);
    overflow: hidden;
    height: 100%;
    /* Match html */
    width: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GLOBAL SCROLLBAR KILLER */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: var(--bg-darker);
    /* Dark track */
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-corner {
    background: var(--bg-darker);
}

[data-theme="light"] body {
    background-color: #f8fafc;
    background-image:
        radial-gradient(at 0% 0%, rgba(var(--accent-rgb), 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(var(--primary-rgb), 0.12) 0px, transparent 50%),
        radial-gradient(circle at 50% 50%, #f8fafc 0%, #cbd5e1 100%);
    background-repeat: no-repeat;
    background-size: cover;
}

/* Force slightly thicker fonts in light mode if needed */
[data-theme="light"] body {
    font-weight: 400;
    /* Ensure no 300 weight is inherited as default */
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] strong {
    font-weight: 700 !important;
    /* Force bold to be BOLD */
}

/* Force slightly thicker fonts in light mode if needed */
[data-theme="light"] body {
    font-weight: 400;
    /* Ensure no 300 weight is inherited as default */
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] strong {
    font-weight: 700 !important;
    /* Force bold to be BOLD */
}

.bg-grid-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(var(--glass-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.1;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 20s linear infinite;
    z-index: -1;
    pointer-events: none;
    position: fixed;
    /* Fix bg */
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px);
    }
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar (Fixed) */
.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 100;
    flex-shrink: 0;
}

[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid var(--glass-border);
}

[data-theme="light"] .chapter-head {
    color: #334155;
}

[data-theme="light"] .nav-links li:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .detail-list li {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .data-table tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .sd-col {
    border-right: 1px solid var(--glass-border);
}

[data-theme="light"] .hero-image-split {
    background: transparent;
    border: none;
    box-shadow: -30px 30px 80px rgba(0, 0, 0, 0.2);
    /* Lighter shadow for light mode */
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.logo-icon {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.5em;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

[data-theme="light"] .logo-icon {
    text-shadow: none;
    font-weight: 800;
}

.nav-links {
    list-style: none;
    padding: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-links::-webkit-scrollbar {
    width: 0px;
}

.nav-links li {
    padding: 8px 12px;
    margin-bottom: 4px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    color: var(--text-dim);
    font-size: 0.85em;
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-links li.active {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.2), transparent);
    color: var(--accent);
    border-left: 3px solid var(--accent);
}

.chapter-head {
    margin-top: 15px;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    font-weight: bold;
    color: #fff;
    opacity: 0.9;
}

.chapter-head .icon {
    font-family: 'Orbitron';
    margin-right: 10px;
    opacity: 0.7;
    width: 20px;
}

.sub-item {
    padding-left: 45px !important;
    font-size: 0.8em !important;
    opacity: 0.8;
}

.sub-item.active {
    color: var(--accent);
    opacity: 1;
}

.system-status {
    flex-shrink: 0;
    margin-top: 10px;
    font-family: 'Rajdhani', monospace;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.8em;
}

.bar {
    width: 100px;
    height: 4px;
    background: #334155;
    border-radius: 2px;
}

.bar .fill {
    height: 100%;
    background: var(--success);
    border-radius: 2px;
    box-shadow: 0 0 5px var(--success);
}

/* --- NEW CORE ENGINE: SCROLL SNAP --- */

.main-display {
    flex-grow: 1;
    height: 100vh;
    overflow-y: auto;
    /* Allow vertical scroll */
    scroll-snap-type: y mandatory;
    /* Enable Snapping */
    scroll-behavior: smooth;
    position: relative;
    padding: 0;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* Hide Main Scrollbar but keep functionality */
.main-display::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.slider-container {
    /* No transforms anymore. It just flows. */
    width: 100%;
    height: auto;
}

.slide {
    width: 100%;
    min-height: 100vh;
    /* Critical: Allow growth */
    height: auto;

    /* Center content by default, but allow top-align if long */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    scroll-snap-align: start;
    /* Snap to top */
    scroll-snap-stop: always;

    padding: 60px 40px;
    /* Safe area */
    box-sizing: border-box;
    opacity: 0.4;
    transition: opacity 0.5s ease;
    position: relative;
    /* Ensure absolute children are scoped */
}

.slide.active {
    opacity: 1;
}

.slide.long-content {
    justify-content: flex-start;
    /* Start from top if long */
}

/* Content Wrapper: UNLEASHED */
.content-wrapper {
    width: 95%;
    max-width: 1600px;
    /* Massive width limit */
    height: auto;
    /* Let it grow */
    padding: 0;

    /* Layout Logic */
    display: flex;
    flex-direction: column;
}

/* Component Styles (Preserved) */
.sub-title {
    font-family: 'Orbitron';
    color: var(--accent);
    letter-spacing: 4px;
    margin-bottom: 10px;
    font-size: 1.8em;
    font-weight: 500;
}

.glitch-text {
    font-size: 4em;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .glitch-text {
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.mission-statement {
    font-size: 1.5em;
    color: var(--text-dim);
    margin-top: 20px;
}

.department-signature {
    font-size: 1em;
    color: var(--text-dim);
    text-align: right;
    margin-top: 20px;
    margin-right: 40px;
    font-weight: 400;
    font-style: italic;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.section-title {
    font-family: 'Orbitron';
    font-size: 2em;
    color: var(--text-dim);
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.color-success {
    border-color: var(--success);
    color: #fff;
}

.color-warning {
    border-color: var(--warning);
    color: #fff;
}

/* Split Layout: Flexible */
.split-layout {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
    /* Safety wrap for small screens */
}

.split-layout.reverse {
    flex-direction: row-reverse;
}

.text-content {
    flex: 1 1 500px;
}

.visual-content {
    flex: 1 1 500px;
    display: flex;
    justify-content: center;
}

.showcase-image {
    width: 100%;
    max-width: 600px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.hero-image {
    width: auto;
    max-width: 90%;
    max-height: 50vh;
    margin-top: 30px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    object-fit: contain;
}

.hero-header {
    text-align: center;
}


/* Article Layout: Flexible */
.article-layout {
    display: flex;
    flex-direction: row;
    gap: 40px;
    height: auto;
    flex-wrap: wrap;
}

.article-main {
    flex: 2 1 600px;
}

.article-sidebar {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Typography */
.report-text {
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--text-dim);
    margin-bottom: 20px;
    text-align: justify;
}

.report-text p {
    margin-bottom: 15px;
}

.report-text strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Tables */
.data-table-container {
    width: 100%;
    margin: 20px 0;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.data-table th {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    font-family: 'Rajdhani', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table td {
    color: var(--text-dim);
}

/* Tech Specs */
.tech-spec-block {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent);
    margin-top: 15px;
}

.tech-spec-title {
    color: var(--text-main);
    font-weight: bold;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 5px;
    margin-bottom: 10px;
    display: block;
}

.highlight-box {
    border-left: 4px solid var(--success);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), transparent);
    padding: 15px 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-main);
}

.metric-card {
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
    transform: translateY(-2px);
}

[data-theme="light"] .metric-card {
    background: rgba(0, 0, 0, 0.02);
}

/* Controls */
.controls {
    position: fixed;
    bottom: 10px;
    right: 40px;
    display: flex;
    gap: 15px;
    z-index: 100;
    opacity: 0.5;
}

.control-btn {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.control-btn:hover {
    background: var(--accent);
}

/* Grids */
.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.detail-list li {
    margin-bottom: 10px;
    border-left: 3px solid var(--primary);
    padding-left: 15px;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 15px;
    border-radius: 0 4px 4px 0;
}

.kpi-dashboard {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.kpi-card {
    width: 160px;
    text-align: center;
}

.kpi-card .value {
    font-family: 'Orbitron';
    font-size: 2.2em;
    color: var(--success);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.tag-cloud span {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(6, 182, 212, 0.3);
    font-size: 0.85em;
}

.strategy-dashboard {
    display: flex;
    width: 100%;
    margin-bottom: 20px;
    text-align: left;
    flex-wrap: wrap;
}

.sd-col {
    flex: 1;
    padding: 20px;
    min-width: 250px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== ENHANCED ANIMATIONS ===== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== COVER SPLIT LAYOUT ===== */
.cover-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 0 5%;
    gap: 40px;
}

.cover-content {
    flex: 1;
    text-align: left;
    z-index: 2;
}

.cover-image-wrapper {
    flex: 1.2;
    /* Give image more space than text */
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-split {
    width: 150%;
    /* Massive width */
    max-width: none;
    height: auto;
    object-fit: contain;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    /* Removed glass effect */
    background: transparent;
    border: none;
    box-shadow: -30px 30px 80px rgba(0, 0, 0, 0.6);
    transform: perspective(1000px) rotateY(-10deg) scale(1.3) translateX(10%);
    /* Aggressive 3D & Scale */
    transition: transform 0.5s ease;
    margin-right: -20%;
    /* Bleed off screen */
}





/* Maintain hover state when hovering wrapper OR when hovering sibling controls */
.cover-image-wrapper:hover .hero-image-split,
.main-display:has(.controls:hover) .hero-image-split {
    transform: scale(1.02) rotateY(2deg);
}

/* Mobile responsive for cover */
@media (max-width: 1024px) {
    .cover-layout {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding-top: 40px;
    }

    .cover-content {
        text-align: center;
        margin-bottom: 30px;
    }

    .department-signature {
        text-align: center !important;
        margin-right: 0 !important;
    }

    .sidebar {
        display: none;
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.1s;
    opacity: 0;
}

.delay-2 {
    animation-delay: 0.2s;
    opacity: 0;
}

.delay-3 {
    animation-delay: 0.3s;
    opacity: 0;
}

.delay-4 {
    animation-delay: 0.4s;
    opacity: 0;
}

/* Progress indicator */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--bg-darker);
    z-index: 1000;
}

.progress-indicator-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Custom scrollbar for main display */
.main-display::-webkit-scrollbar {
    width: 8px;
}

.main-display::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

.main-display::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.main-display::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* KPI card improvements */
.kpi-card .value {
    font-family: 'Orbitron';
    font-size: 2.2em;
    color: var(--success);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.kpi-card .label {
    font-size: 0.9em;
    color: var(--text-dim);
    margin-top: 8px;
}

/* Slide number indicator */
.slide-number {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Rajdhani', monospace;
    color: var(--text-dim);
    font-size: 0.85em;
    z-index: 99;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.slide-number:hover {
    opacity: 1;
}

/* Timer Digits Stabilization */
.timer-char {
    display: inline-block;
    width: 14px;
    /* Fixed width for each character */
    text-align: center;
}

.timer-colon {
    display: inline-block;
    width: 10px;
    text-align: center;
    position: relative;
    top: -1px;
}