/* ============================================
   CRAMP 2025/2026 - PROFESSIONAL GLASSMORPHISM
   Cohérent, Moderne, Clean
   ============================================ */

:root {
    /* Brand */
    --primary: #5B9C5B;
    --primary-rgb: 91, 156, 91;

    /* Light Theme */
    --bg: #F8F9FA;
    --bg-glass: rgba(255, 255, 255, 0.92);
    --text: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: rgba(0, 0, 0, 0.1);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 8px 16px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.07), 0 12px 24px rgba(0, 0, 0, 0.06);

    /* Layout */
    --nav-width: 260px;
    --max-width: 1400px;
    --radius: 12px;
    --blur: 12px;

    /* Spacing */
    --gap: 1.5rem;
    --padding: 1.5rem;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg: #1A1A1A;
    --bg-glass: rgba(30, 30, 30, 0.92);
    --text: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.4), 0 12px 24px rgba(0, 0, 0, 0.3);
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* Force text colors to respect theme */
p, span, div, li, td, th, label, a {
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
}

/* Subtle background gradient blobs for glassmorphism effect */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -25%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.03) 0%, transparent 60%);
    filter: blur(80px);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    right: -15%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.02) 0%, transparent 60%);
    filter: blur(100px);
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] body::before {
    opacity: 0.15;
}

[data-theme="dark"] body::after {
    opacity: 0.1;
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    width: 44px;
    height: 44px;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--nav-width);
    height: 100vh;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.nav-logo {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.nav-logo img {
    width: 100%;
    max-width: 120px;
    margin: 0 auto 1rem;
    display: block;
}

.logo-text {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    letter-spacing: -0.3px;
}

.logo-year {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
}

.nav-menu {
    flex: 1;
    list-style: none;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 2px;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.nav-number {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.6;
}

.nav-label {
    flex: 1;
}

.nav-progress {
    height: 3px;
    background: rgba(var(--primary-rgb), 0.1);
    margin: 0.75rem;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.4s ease;
}

/* ============================================
   SLIDES
   ============================================ */
.slides-container {
    margin-left: var(--nav-width);
    height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.slide {
    display: none;
    height: 100vh;
    padding: 2.5rem;
    overflow-y: auto;
}

.slide.active {
    display: block;
}

.slide::-webkit-scrollbar {
    width: 6px;
}

.slide::-webkit-scrollbar-track {
    background: transparent;
}

.slide::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.slide::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.slide-content {
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.kinetic-bg {
    display: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.slide-header {
    margin-bottom: 2.5rem;
}

.slide-header h1 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.25rem;
    letter-spacing: -0.3px;
}

/* ============================================
   GLASS CARDS
   ============================================ */
.card,
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    border-radius: var(--radius);
    padding: var(--padding);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.shadow-xl {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.glass-card:hover .card-icon {
    background: rgba(var(--primary-rgb), 0.15);
    transform: scale(1.05);
}

.icon-svg {
    width: 24px;
    height: 24px;
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.2px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ============================================
   GRIDS
   ============================================ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
}

/* ============================================
   METRICS
   ============================================ */
.metric-card {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.metric-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.metric-icon {
    width: 56px;
    height: 56px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin: 0 auto 1rem;
    transition: all 0.3s ease;
}

.metric-card:hover .metric-icon {
    background: rgba(var(--primary-rgb), 0.15);
    transform: scale(1.08);
}

.metric-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.metric-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.metric-sublabel {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   DATA TABLE
   ============================================ */
.data-table {
    width: 100%;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    transition: opacity 0.2s ease;
}

.data-row:hover {
    opacity: 0.7;
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.data-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.badge.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}

.badge.warning {
    background: rgba(251, 146, 60, 0.1);
    color: #FB923C;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --nav-width: 0; }
    .nav { transform: translateX(-100%); }
    .nav.open { transform: translateX(0); }
    .slides-container { margin-left: 0; }
    .slide { padding: 2rem 1rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .slide-header h1 { font-size: 32px; }
}

/* ============================================
   CHARTS
   ============================================ */
.chart-container {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    border-radius: var(--radius);
    padding: var(--padding);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.chart-container:hover {
    box-shadow: var(--shadow-lg);
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 350px;
    margin-top: 1rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.3px;
}

.chart-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Canvas styling */
canvas {
    max-width: 100%;
    height: auto;
}

/* ============================================
   IMAGES & LIGHTBOX
   ============================================ */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--gap);
}

.image-item {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.image-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.image-item:hover .image-caption {
    transform: translateY(0);
}

/* Note: Lightbox styles are managed by lightbox.js */

/* ============================================
   HELPER BACKGROUNDS (theme-aware)
   ============================================ */
.bg-white {
    background: var(--bg-glass) !important;
}

.bg-light {
    background: rgba(var(--primary-rgb), 0.03) !important;
}

.bg-lighter {
    background: rgba(var(--primary-rgb), 0.05) !important;
}

.bg-box {
    background: var(--bg-glass) !important;
    border-radius: 8px;
    padding: 15px;
}

.bg-box-border {
    background: var(--bg-glass) !important;
    border-radius: 8px;
    padding: 10px;
    border: 2px solid var(--primary);
}

/* ============================================
   TABLES (theme-aware)
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text);
}

thead {
    background: var(--primary) !important;
    color: white !important;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background: rgba(var(--primary-rgb), 0.08) !important;
}

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

th {
    font-weight: 600;
}

/* Table container */
.table-container {
    background: var(--bg-glass) !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.mb-sm { margin-bottom: 0.75rem; }
.mb-md { margin-bottom: 1.5rem; }
.mb-lg { margin-bottom: 2rem; }
.mb-xl { margin-bottom: 3rem; }
.mt-sm { margin-top: 0.75rem; }
.mt-md { margin-top: 1.5rem; }
.mt-lg { margin-top: 2rem; }
.mt-xl { margin-top: 3rem; }

/* ============================================
   PRINT
   ============================================ */
@media print {
    .nav, .theme-toggle { display: none; }
    .slides-container { margin-left: 0; }
    .slide { display: block !important; page-break-after: always; }
}
