:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --accent-primary: #3b82f6;
    --accent-glow: #60a5fa;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #1e293b 0%, #0f172a 100%);
}

/* 3D Scene Container */
.scene-3d {
    perspective: 1000px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 3D Cards */
.card-3d {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: translateY(-5px) rotateX(2deg);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Buttons */
.btn-3d {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* Inputs */
.input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.4);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* Landing Page Specifics */
.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.04);
}

/* Dashboard Specifics */
.main-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.trend-badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.1);
    color: #4ade80;
}

.trend-badge.down {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Chat Interface */
.chat-container {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.msg {
    padding: 1rem;
    border-radius: 12px;
    max-width: 80%;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

.msg.user {
    background: var(--accent-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.msg.ai {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-input-area {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--card-border);
    display: flex;
    gap: 1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Analysis Matrix */
.analysis-matrix {
    display: table;
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.analysis-matrix th,
.analysis-matrix td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

.analysis-matrix th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analysis-matrix tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Print Styles */
@media screen {
    #printable-report {
        display: none !important;
    }
}

@media print {
    @page {
        margin: 10mm;
        size: A4;
    }

    body {
        background: white !important;
        color: black !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        font-family: 'Times New Roman', Times, serif;
        /* Professional Report Font */
    }

    /* Hide UI */
    nav,
    .navbar,
    .btn-3d,
    .no-print,
    .chat-container,
    .slider-container,
    input,
    button,
    .fa-circle-notch,
    .landing-nav,
    .grid-2>.card-3d:not(#printable-report) {
        display: none !important;
    }

    /* Report Container */
    #printable-report {
        display: block !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: white !important;
        color: black !important;
        padding: 20px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Report Typography */
    h1 {
        font-size: 24pt;
        border-bottom: 2px solid #333;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 18pt;
        color: #333;
        margin-top: 20px;
    }

    p,
    td,
    th,
    li {
        font-size: 12pt;
        line-height: 1.5;
        color: black !important;
    }

    /* Tables */
    .report-table,
    .analysis-matrix {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 20px 0 !important;
    }

    .report-table th,
    .report-table td,
    .analysis-matrix th,
    .analysis-matrix td {
        border: 1px solid #ccc !important;
        padding: 10px !important;
        text-align: left;
    }

    /* Chart Image */
    #print-chart-img {
        max-width: 90% !important;
        max-height: 400px;
        display: block;
        margin: 20px auto;
        border: 1px solid #eee;
    }

    /* Reset 3D cards for flat print */
    .card-3d,
    .scene-3d {
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: none !important;
        perspective: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .container>* {
        display: none !important;
    }

    .container>#printable-report,
    body>#printable-report {
        display: block !important;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.text-danger {
    color: #ef4444;
}

.text-success {
    color: #4ade80;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}