@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;700&display=swap');

:root {
    /* Fluid Typography Tokens - Refined for Ultra-Small Screens */
    --fs-h1: clamp(2.2rem, 10vw, 5rem);
    --fs-h2: clamp(1.6rem, 8vw, 3rem);
    --fs-h3: clamp(1.2rem, 6vw, 2rem);
    --fs-body: clamp(0.95rem, 2vw, 1.1rem);

    /* Ultra-Premium Light Mode Tokens */
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-sidebar: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-cyan: #0891b2;
    --accent-purple: #7c3aed;
    --accent-emerald: #10b981;
    --accent-slate: #1e293b;
    --border-color: rgba(15, 23, 42, 0.08);
    --glass-blur: blur(24px);
    --shadow-premium: 0 12px 60px -12px rgba(8, 145, 178, 0.12);

    /* Animation Tokens */
    --transition-smooth: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
}

[data-theme="dark"] {
    /* Ultra-Premium Dark Mode Tokens */
    --bg-main: #020617;
    --bg-card: rgba(15, 23, 42, 0.4);
    --bg-sidebar: #020617;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-cyan: #22d3ee;
    --accent-purple: #a78bfa;
    --accent-emerald: #34d399;
    --accent-slate: #f8fafc;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(32px);
    --shadow-premium: 0 12px 80px -12px rgba(0, 0, 0, 0.9);
}

:root {
    --radius-lg: 24px;
    --radius-md: 16px;
    --grad-primary: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    --shadow-premium: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
    --shadow-premium: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
}

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

html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    scroll-behavior: smooth;
}

::selection {
    background: rgba(34, 211, 238, 0.2);
    color: var(--accent-cyan);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

h1,
h2,
h3,
h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: var(--fs-h1);
}

h2 {
    font-size: var(--fs-h2);
}

h3 {
    font-size: var(--fs-h3);
}

p {
    font-size: var(--fs-body);
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    padding: clamp(1.25rem, 5vw, 4rem);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.5rem;
}

.logo-icon {
    width: auto;
    max-width: 160px;
    height: 38px;
    object-fit: contain;
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(8, 145, 178, 0.1));
}

[data-theme="dark"] .logo-icon {
    filter: invert(1) brightness(2) drop-shadow(0 0 10px rgba(8, 145, 178, 0.4));
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Premium Image Frames */
.strategic-image-box {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    margin-bottom: 2rem;
}

.strategic-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.strategic-image-box:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(2, 6, 23, 0.8) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.strategic-image-box:hover .image-overlay {
    opacity: 1;
}

.overlay-text {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Typography Hierarchy */
h1,
h2,
h3 {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.03em;
}

.executive-summary-text {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 800px;
}

/* Theme Switcher */
.theme-switcher {
    margin-top: auto;
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem;
    border-radius: 100px;
    position: relative;
    border: 1px solid var(--border-color);
}

.theme-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.theme-btn.active {
    background: var(--bg-main);
    color: var(--text-primary);
    box-shadow: var(--shadow-premium);
}

/* Main Content Styling */
.main-content {
    flex: 1;
    padding: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4rem;
}

.status-badge {
    padding: 0.6rem 1.25rem;
    border-radius: 100px;
    background: rgba(5, 150, 105, 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(5, 150, 105, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent-emerald);
}

/* Detailed Catalogue Layout */
.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
}

.catalogue-nav {
    grid-column: span 3;
    position: sticky;
    top: 3rem;
    height: fit-content;
}

.catalogue-content {
    grid-column: span 9;
}

.nav-catalogue-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-catalogue-item {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-catalogue-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-catalogue-item.active {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-premium);
}

/* Cards & Components */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800.2px at 0% 0%, rgba(8, 145, 178, 0.08) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition-smooth);
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(8, 145, 178, 0.3);
    box-shadow: var(--shadow-premium);
}

.card:hover::before {
    opacity: 1;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.catalogue-section {
    margin-bottom: 5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.catalogue-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Interactive Infographics */
.infographic-container {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin: 2rem 0;
}

.workflow-step {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 1.5rem;
    border-left: 2px solid var(--accent-cyan);
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 0 12px 12px 0;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--grad-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Typography Helpers */
.text-gradient {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    display: block;
}

/* Report Specific Styling */
.report-body {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.8;
}

.report-section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.report-section h3 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--accent-cyan);
}

.report-section p {
    margin-bottom: 1.5rem;
}

.visual-simulation-box {
    background: var(--bg-card);
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin: 3rem 0;
    box-shadow: var(--shadow-premium);
}

.simulation-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.simulation-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.chart-box {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    height: 250px;
    display: flex;
    flex-direction: column;
}

.control-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.report-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-12px);
    }

    100% {
        transform: translateY(0px);
    }
}

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

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

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

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

.reveal {
    animation: fadeIn 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.reveal-stagger {
    opacity: 0;
}

.reveal-stagger:nth-child(1) {
    animation-delay: 0.1s;
}

.reveal-stagger:nth-child(2) {
    animation-delay: 0.2s;
}

.reveal-stagger:nth-child(3) {
    animation-delay: 0.3s;
}

.reveal-stagger:nth-child(4) {
    animation-delay: 0.4s;
}

.reveal-stagger:nth-child(5) {
    animation-delay: 0.5s;
}

.floating {
    animation: float 4s ease-in-out infinite;
}

.carbon-mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(8, 145, 178, 0.08) 0%, transparent 40%);
}

[data-theme="light"] .carbon-mesh-bg {
    background: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(8, 145, 178, 0.03) 0%, transparent 40%);
}

/* --- Universal Mobile Optimization: Ultra-Premium Standard --- */

/* Mobile Header (Hidden on Desktop) */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1001;
    justify-content: space-between;
    align-items: center;
}

[data-theme="light"] .mobile-header {
    background: rgba(255, 255, 255, 0.8);
}

.menu-trigger {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 1024px) {
    .mobile-header {
        display: flex;
    }

    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        width: 300px;
        height: 100vh;
        background: var(--bg-sidebar) !important;
        z-index: 2000;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 4rem 1.5rem !important;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.3);
        display: flex !important;
        flex-direction: column !important;
    }

    .sidebar.active {
        transform: translateX(320px);
    }

    .main-content {
        padding: 1.5rem !important;
        margin-top: 0 !important;
    }

    /* Universal Stacking */
    .kpi-grid,
    .detail-grid,
    .simulation-results-grid,
    .catalogue-grid {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .card {
        width: 100% !important;
        grid-column: span 12 !important;
    }

    .header-section {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .strategic-image-box {
        height: 250px !important;
    }

    .status-badge {
        font-size: 0.75rem !important;
        padding: 0.5rem 1rem !important;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1.25rem 1rem !important;
    }

    .logo-icon {
        max-width: 120px;
    }

    h1 {
        font-size: clamp(2rem, 12vw, 2.5rem) !important;
        letter-spacing: -0.04em !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    .status-badge {
        width: 100%;
        justify-content: center;
    }

    .kpi-grid {
        gap: 1rem !important;
    }

    .card {
        padding: 1.5rem !important;
    }
}

/* Stability: Prevent hidden overflow */
img,
video,
canvas {
    max-width: 100%;
    height: auto;
}

.premium-table-wrapper {
    margin: 1.5rem -1.25rem;
    padding: 0 1.25rem;
    width: calc(100% + 2.5rem);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}