﻿/* styles.css - Complete Modern Dashboard Styles */

/* ========================================
   1. CSS Variables & Reset
   ======================================== */

:root {
    /* Colors */
    --primary: #364558;
    --primary-dark: #3b4958;
    --primary-light: #f2fcff;
    --secondary: #00bcd4;
    --accent: #ff5722;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196f3;
    
    /* Neutrals */
    --dark: #263238;
    --gray-dark: #455a64;
    --gray: #78909c;
    --gray-light: #b0bec5;
    --gray-lighter: #eceff1;
    --light: #f5f7fa;
    --white: #ffffff;
    
    /* Text */
    --text-primary: #364558;
    --text-secondary: #364558;
    --text-muted: #999999;
    --text-light: #ffffff;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --shadow-xl: 0 12px 24px rgba(0,0,0,0.2);
    
    /* Borders */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light);
    overflow-x: hidden;
}

/* ========================================
   2. Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; text-align: center; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

       .code-block { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; padding: 15px; margin: 15px 0; overflow-x: auto; }
        .method { background: #e9ecef; padding: 3px 8px; border-radius: 4px; font-family: monospace; }
        .endpoint { color: #dc3545; font-weight: bold; }
        .example { background: #fff3cd; border-left: 4px solid #ffc107; padding: 15px; margin: 20px 0; }
        .viz-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 15px; margin: 20px 0; }
        .viz-item { background: white; border: 1px solid #dee2e6; padding: 15px; border-radius: 8px; }
        .viz-key { color: #dc3545; font-family: monospace; font-weight: bold; }
        .category { background: #1e3c72; color: white; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
  

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1.7;
}

/* ========================================
   3. Layout & Containers
   ======================================== */

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 4rem 0;
}

.section-alt {
    background-color: var(--white);
}

/* ========================================
   4. Accessibility
   ======================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    z-index: var(--z-tooltip);
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   5. Header Styles
   ======================================== */

.header { 
       background: 
        linear-gradient(180deg, var(--primary), var(--primary-light)),
        url('images/backtop.jpg') center/cover no-repeat;
    background-blend-mode: screen;  
    color: white;
    padding: 3rem 2rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%; 
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.header-content {
    position: relative;
    z-index: 1;
}

.header h1 {
    color: white;
    font-weight: 300;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: fadeInUp 1s ease;
}

.subtitle {
    font-size: 1.9rem;
    opacity: 0.9;background-color: #e3674b;   text-align: center; left: 50%;
    padding: 10px;padding-top: 5px;padding-bottom: 5px; border-radius: 10px; opacity: 68%; 
}

.tdi-badge {
    display: inline-block; color: #f18679;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    font-size: 0.875rem;
    margin-top: 1rem;
    animation: fadeInUp 1s ease 0.4s both;
}

.tdi-badge i {
    margin-right: 0.5rem;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    animation: fadeInUp 1s ease 0.6s both;
}

.header-stat {
    text-align: center;
}

.header-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.header-stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toggle-header {
    cursor: pointer;
    position: relative;
    padding-right: 40px !important;
    user-select: none;
    transition: opacity 0.2s;
}

.toggle-header:hover {
    opacity: 0.9;
}

/* Arrow styling */
.toggle-arrow {
    transition: transform 0.3s ease !important;
    color: #f18679 !important;
    font-size: 24px !important;
    font-weight: bold !important;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* Arrow hover effect */
.toggle-header:hover .toggle-arrow {
    color: #e3674b !important;
}

/* Content visibility control */
.toggle-header.closed + * {
    display: none !important;
    visibility: hidden !important;
}

.toggle-header:not(.closed) + * {
    display: block !important;
    visibility: visible !important;
}
 

/* Ensure content is visible when opened */
.toggle-header:not(.closed) + div,
.toggle-header:not(.closed) + section,
.toggle-header:not(.closed) + article,
.toggle-header:not(.closed) + .timeline-intro,
.toggle-header:not(.closed) + .timeline-content,
.toggle-header:not(.closed) + .content-block {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

  
        /* Gallery Modal Styles */
        .gallery-modal {
            display: none;
            position: fixed;
            z-index: 2000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.95);
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .gallery-modal.active {
            display: flex;
            opacity: 1;
        }
        
        .gallery-container {
            position: relative;
            width: 90%;
            max-width: 1200px;
            height: 90%;
            margin: auto;
            background: white;
            border-radius: 12px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        }
        
        .gallery-header {
            padding: 1.5rem 2rem; 
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .gallery-header h3 {
            margin: 0;
            font-size: 1.5rem;
        }
        
        .gallery-close {
            background: none;
            border: none;
            color: white;
            font-size: 2rem;
            cursor: pointer;
            padding: 0;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background 0.3s;
        }
        
        .gallery-close:hover {
            background: rgba(255, 255, 255, 0.2);
        }
        
        .gallery-body {
            flex: 1;
            overflow: hidden;
            display: flex;
        }
        
        .gallery-sidebar {
            width: 250px;
            background: #f5f7fa;
            overflow-y: auto;
            border-right: 1px solid #e0e0e0;
        }
        
        .gallery-main {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: #fafafa;
        }
        
        .gallery-folders {
            padding: 1rem;
        }
        
        .folder-item {
            padding: 0.75rem 1rem;
            margin-bottom: 0.5rem;
            background: white;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .folder-item:hover {
            background: var(--primary);
            color: white;
            transform: translateX(5px);
        }
        
        .folder-item.active {
            background: var(--primary);
            color: white;
        }
        
        .folder-item i {
            font-size: 1.25rem;
        }
        
        .gallery-viewer {
            flex: 1;
            padding: 2rem;
            overflow: auto;
        }
        
        .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 1.5rem;
        }
        
        .gallery-item {
            background: white;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }
        
        .gallery-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        }
        
        .gallery-item img {
            width: 100%;
            height: 150px;
            object-fit: cover;
        }
        
        .gallery-item-info {
            padding: 1rem;
        }
        
        .gallery-item-title {
            font-size: 0.875rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
            color: var(--dark);
        }
        
        .gallery-item-date {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }
        
        .gallery-controls {
            padding: 1rem 2rem;
            background: white;
            border-top: 1px solid #e0e0e0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .gallery-info {
            font-size: 0.875rem;
            color: var(--text-secondary);
        }
        
        .gallery-nav {
            display: flex;
            gap: 0.5rem;
        }
        
        .gallery-nav button {
            padding: 0.5rem 1rem;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: background 0.3s;
        }
        
        .gallery-nav button:hover {
            background: var(--primary-dark);
        }
        
        .gallery-nav button:disabled {
            background: #ccc;
            cursor: not-allowed;
        }
        
        /* Image viewer overlay */
        .image-viewer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2100;
        }
        
        .image-viewer.active {
            display: flex;
        }
        
        .image-viewer img {
            max-width: 90%;
            max-height: 90%;
            object-fit: contain;
        }
        
        .image-viewer-close {
            position: absolute;
            top: 2rem;
            right: 2rem;
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            font-size: 2rem;
            cursor: pointer;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.3s;
        }
        
        .image-viewer-close:hover {
            background: rgba(255, 255, 255, 0.3);
        }
        
        /* Gallery Section in main content */
        .gallery-section {
            padding: 3rem 0;
            background: var(--light);
        }
        
        .gallery-preview {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 2rem;
            margin-top: 2rem;
        }
        
        .gallery-preview-item {
            background: white;
            border-radius: var(--border-radius-lg);
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: all 0.3s;
            cursor: pointer;
        }
        
        .gallery-preview-item:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-lg);
        }
        
        .gallery-preview-img {
            width: 100%; 
            object-fit: cover;
            background: #f0f0f0;
        }
        
        .gallery-preview-content {
            padding: 1.5rem;
        }
        
        .gallery-preview-title {
            font-size: 1.125rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--dark);
        }
        
        .gallery-preview-desc {
            font-size: 0.875rem;
            color: var(--text-secondary);
            line-height: 1.6;
        }
        
        .btn-gallery {
            margin-top: 2rem;
            background: var(--primary);
            color: white;
            padding: 1rem 2rem;
            border: none;
            border-radius: var(--border-radius);
            cursor: pointer;
            font-size: 1rem;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s;
        }
        
        .btn-gallery:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
            box-shadow: var(--shadow);
        }
        
        /* Responsive */
        @media (max-width: 768px) {
            .gallery-container {
                width: 100%;
                height: 100%;
                border-radius: 0;
            }
            
            .gallery-body {
                flex-direction: column;
            }
            
            .gallery-sidebar {
                width: 100%;
                height: 150px;
                border-right: none;
                border-bottom: 1px solid #e0e0e0;
            }
            
            .gallery-folders {
                display: flex;
                gap: 0.5rem;
                overflow-x: auto;
            }
            
            .folder-item {
                flex-shrink: 0;
                margin-bottom: 0;
            }
        }


/* ========================================
   6. Navigation
   ======================================== */

/* Base Navigation */
.nav {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1020;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Initial state - slightly taller */
.nav {
    padding: 0.75rem 0;
}

/* Scrolled state - compact */
.nav.scrolled {
    padding: 0.25rem 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Container */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

/* Nav List - Centered with better spacing */
.nav-list {
    display: flex;
    list-style: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
}

/* Nav Items */
.nav-item {
    position: relative;
}

/* Nav Links - Optimized for readability and click targets */
.nav-link {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #495057;
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

/* Scrolled state - smaller padding */
.nav.scrolled .nav-link {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

/* Hover state */
.nav-link:hover {
    color: var(--primary);
    background: rgba(26, 35, 126, 0.08);
}

/* Active state with pill effect */
.nav-link.active {
    color: white;
    background: var(--primary);
}

.nav-link.active:hover {
    background: var(--primary-dark);
}

/* Remove the bottom bar indicator since we're using pill style */
.nav-link::after {
    display: none;
}

/* Mobile Toggle - Improved */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #495057;
    margin: 4px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Desktop - Horizontal scroll for many items */
@media (min-width: 769px) {
    .nav-list {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .nav-list::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    /* Fade edges for scroll indication */
    .nav-container::before,
    .nav-container::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 30px;
        z-index: 10;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    .nav-container::before {
        left: 0;
        background: linear-gradient(to right, rgba(255, 255, 255, 0.95), transparent);
    }
    
    .nav-container::after {
        right: 0;
        background: linear-gradient(to left, rgba(255, 255, 255, 0.95), transparent);
    }
    
    /* Show fade when scrollable */
    .nav-container.scrollable::before,
    .nav-container.scrollable::after {
        opacity: 1;
    }
}

/* Tablet and Mobile */
@media (max-width: 768px) {
    .nav {
        padding: 0.5rem 0;
    }
    
    .nav.scrolled {
        padding: 0.375rem 0;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-list {
        position: fixed;
        top: 54px; /* Adjust based on nav height */
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        gap: 0;
    }
    
    .nav.scrolled .nav-list {
        top: 46px; /* Smaller when scrolled */
    }
    
    .nav-list.active {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        padding: 1rem 2rem;
        border-radius: 0;
        text-align: left;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .nav-link:hover {
        background: rgba(26, 35, 126, 0.05);
    }
    
    .nav-link.active {
        background: var(--primary);
        color: white;
    }
}

/* Optional: Progress indicator */
.nav-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
    width: 0%;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .nav {
        background: rgba(30, 30, 30, 0.98);
    }
    
    .nav.scrolled {
        background: rgba(20, 20, 20, 0.95);
    }
    
    .nav-link {
        color: #e0e0e0;
    }
    
    .nav-link:hover {
        color: white;
        background: rgba(255, 255, 255, 0.1);
    }
    
    .nav-link.active {
        background: var(--primary);
        color: white;
    }
    
    .nav-toggle span {
        background: #e0e0e0;
    }
    
    .nav-list {
        background: rgba(30, 30, 30, 0.98);
    }
}

/* Smooth scroll behavior for the page */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for sticky nav */
}

html.nav-scrolled {
    scroll-padding-top: 60px; /* Smaller when scrolled */
}
/* ========================================
   7. Main Content Sections
   ======================================== */

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px; 
    border-radius: 2px;
}

.section-title i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.section-title-alt {
    text-align: center;
    color: white;
    margin-bottom: 1rem;
}

.section-description {
    font-size: 1.125rem;
    color: var( #b0bec5);
    max-width: 800px;
    margin: 0 auto 3rem;
    text-align: center;
}

.intro-section {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
}

.content-main {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.intro-highlight {
    background: var(--light);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: var(--border-radius);
    position: relative;
}

.intro-highlight i {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    color: var(--primary);
    font-size: 1.5rem;
    opacity: 0.3;
}

.intro-highlight p {
    margin: 0;
    padding-left: 2rem;
    font-style: italic;
    color: var(--text-primary);
}

/* ========================================
   8. Info Cards and Sidebars
   ======================================== */

.info-card {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-card h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.info-card h3 i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.info-list {
    list-style: none;
}

.info-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.info-list li:last-child {
    border-bottom: none;
}

/* ========================================
   9. Timeline - Compact Version
   ======================================== */

.timeline {
    position: relative;
    padding: 1rem 0;
    max-width: 800px;
    margin: 0 auto;
}

/* Timeline Line - Thinner */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--gray-light);
    transform: translateX(-50%);
}

/* Timeline Items - Minimal spacing */
.timeline-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    position: relative;
    min-height: 32px;
}

/* Timeline Dots - Smaller */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

/* Active/Current item dot */
.timeline-item:last-child::before {
    background: var(--primary);
}

/* Date Section - Compact */
.timeline-date {
    flex: 1;
    text-align: right;
    padding-right: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.8125rem;
}

/* Content Section - Compact */
.timeline-content {
    flex: 1;
    padding-left: 1.5rem;
}

.timeline-content h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark);
    line-height: 1.3;
}

/* Hover effects - Subtle */
.timeline-item:hover::before {
    transform: translateX(-50%) scale(1.3);
    background: var(--primary);
}

.timeline-item:hover .timeline-date {
    color: var(--primary-dark);
}

.timeline-item:hover .timeline-content h4 {
    color: var(--primary);
}

/* Transition for smooth hover */
.timeline-item::before,
.timeline-item .timeline-date,
.timeline-item .timeline-content h4 {
    transition: all 0.2s ease;
}

.critical-finding-box {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-left: 4px solid #ff6f00;
    padding: 1.5rem;
    margin: 2rem 0;
}

.data-warning {
    background: #f3e5f5;
    border: 1px dashed #9c27b0;
    padding: 1rem;
    border-radius: 8px;
}

.alert-box {
    background: #ffebee;
    border-left: 3px solid #c62828;
    padding: 1rem;
    margin: 1rem 0;
}

.mechanism-alert {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.findings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.finding-card {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.finding-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ff6f00;
}

.finding-label {
    font-weight: 600;
    margin: 0.5rem 0;
}

.finding-detail {
    font-size: 0.9rem;
    color: #666;
}

.period-card {
    padding: 1.5rem;
    margin: 1rem 0;
    border-left: 4px solid #ddd;
    background: #f9f9f9;
}

.period-card.highlight {
    border-left-color: #ff6f00;
    background: #fff8e1;
}

.religious-dominance {
    margin: 3rem 0;
    padding: 2rem;
    background: #f5f5f5;
    border-radius: 8px;
}

.warning-box {
    background: #ffebee;
    border-left: 4px solid #c62828;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.issues-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

/* Comparison table styling */
.comparison-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.comparison-table thead {
    background: #f5f5f5;
}

/* Electoral timeline */
.timeline-electoral {
    position: relative;
    padding: 2rem 0;
}

.electoral-event {
    display: flex;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.electoral-event.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.electoral-event .year {
    font-size: 2rem;
    font-weight: bold;
    margin-right: 2rem;
    color: #1a237e;
}

.electoral-event.highlight .year {
    color: white;
}

.electoral-event .stat {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(26, 35, 126, 0.1);
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.testimonial-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.quote-icon {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.testimonial-card cite {
    display: block;
    margin-top: 1rem;
    font-style: normal;
    font-weight: 600;
    color: #666;
}

/* Findings grid */
.findings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.finding-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.finding-card h4 {
    color: #1a237e;
    margin-bottom: 0.5rem;
}

/* Metrics cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.metric-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1a237e;
    margin: 1rem 0;
}

.metric-desc {
    color: #666;
    margin-bottom: 1rem;
}

.metric-breakdown {
    text-align: left;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

/* Efficiency table */
.efficiency-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.efficiency-table th,
.efficiency-table td {
    padding: 1rem;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.efficiency-table thead {
    background: #1a237e;
    color: white;
}

.efficiency-high {
    color: #4caf50;
    font-weight: bold;
}

.efficiency-medium {
    color: #ff9800;
    font-weight: bold;
}

.efficiency-low {
    color: #f44336;
    font-weight: bold;
}

/* Reform pillars */
.reform-pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.pillar {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pillar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.pillar-header i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.pillar-content {
    padding: 1.5rem;
}

/* Priority distribution */
.priority-distribution {
    margin: 1rem 0;
}

.priority-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.priority-value {
    font-weight: bold;
    color: #1a237e;
}

/* Roadmap */
.roadmap-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 2rem 0;
}

.roadmap-phase {
    flex: 1;
    padding: 1rem;
    background: white;
    margin: 0 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.phase-header {
    font-weight: bold;
    color: #1a237e;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

/* Call to action reform */
.call-to-action-reform {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 3rem;
}

.call-to-action-reform h3 {
    color: white;
    margin-bottom: 1rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.recommendations-box {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.recommendations-box ol {
    margin-left: 1.5rem;
}

.recommendations-box li {
    margin-bottom: 1rem;
}

/* Comparison table styling */
.comparison-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.comparison-table thead {
    background: #f5f5f5;
}

/* Electoral timeline */
.timeline-electoral {
    position: relative;
    padding: 2rem 0;
}

.electoral-event {
    display: flex;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.electoral-event.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.electoral-event .year {
    font-size: 2rem;
    font-weight: bold;
    margin-right: 2rem;
    color: #1a237e;
}

.electoral-event.highlight .year {
    color: white;
}

.electoral-event .stat {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(26, 35, 126, 0.1);
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.testimonial-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.quote-icon {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.testimonial-card cite {
    display: block;
    margin-top: 1rem;
    font-style: normal;
    font-weight: 600;
    color: #666;
}

/* Findings grid */
.findings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.finding-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.finding-card h4 {
    color: #1a237e;
    margin-bottom: 0.5rem;
}

/* Metrics cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.metric-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1a237e;
    margin: 1rem 0;
}

.metric-desc {
    color: #666;
    margin-bottom: 1rem;
}

.metric-breakdown {
    text-align: left;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

/* Efficiency table */
.efficiency-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.efficiency-table th,
.efficiency-table td {
    padding: 1rem;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.efficiency-table thead {
    background: #1a237e;
    color: white;
}

.efficiency-high {
    color: #4caf50;
    font-weight: bold;
}

.efficiency-medium {
    color: #ff9800;
    font-weight: bold;
}

.efficiency-low {
    color: #f44336;
    font-weight: bold;
}

/* Reform pillars */
.reform-pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.pillar {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pillar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.pillar-header i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.pillar-content {
    padding: 1.5rem;
}

/* Priority distribution */
.priority-distribution {
    margin: 1rem 0;
}

.priority-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.priority-value {
    font-weight: bold;
    color: #1a237e;
}

/* Roadmap */
.roadmap-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 2rem 0;
}

.roadmap-phase {
    flex: 1;
    padding: 1rem;
    background: white;
    margin: 0 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.phase-header {
    font-weight: bold;
    color: #1a237e;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

/* Call to action reform */
.call-to-action-reform {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 3rem;
}

.call-to-action-reform h3 {
    color: white;
    margin-bottom: 1rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.recommendations-box {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.recommendations-box ol {
    margin-left: 1.5rem;
}

.recommendations-box li {
    margin-bottom: 1rem;
}

/* Mobile Responsive - Even more compact */
@media (max-width: 768px) {
    .timeline {
        padding: 0.75rem 0;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        flex-direction: row;
        align-items: flex-start;
        padding-left: 40px;
        margin-bottom: 0.375rem;
        min-height: 28px;
    }
    
    .timeline-item::before {
        left: 20px;
        width: 8px;
        height: 8px;
    }
    
    .timeline-date {
        text-align: left;
        padding-right: 0;
        margin-right: 0.75rem;
        min-width: 70px;
        font-size: 0.75rem;
    }
    
    .timeline-content {
        padding-left: 0;
        flex: 1;
    }
    
    .timeline-content h4 {
        font-size: 0.8125rem;
    }
}

/* Alternative: Inline Compact Style */
.timeline-inline {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding: 1rem 0;
    gap: 1rem;
}

.timeline-inline .timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 120px;
    position: relative;
    margin: 0;
}

.timeline-inline .timeline-item::after {
    content: '';
    position: absolute;
    right: -1rem;
    top: 20px;
    width: 1rem;
    height: 2px;
    background: var(--gray-light);
}

.timeline-inline .timeline-item:last-child::after {
    display: none;
}

.timeline-inline .timeline-date {
    padding: 0;
    margin-bottom: 0.5rem;
}

.timeline-inline .timeline-content {
    padding: 0;
}

/* Ultra Compact Version */
.timeline-compact {
    border-left: 2px solid var(--gray-light);
    padding-left: 1.5rem;
    margin-left: 1rem;
}

.timeline-compact .timeline-item {
    position: relative;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
}

.timeline-compact .timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: 50%;
}

.timeline-compact .timeline-date {
    display: inline;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.975rem;
    margin-right: 0.5rem;
}

.timeline-compact .timeline-content {
    display: inline;
}

.timeline-compact .timeline-content h4 {
    display: inline;
    font-size: 0.975rem;
    font-weight: normal;
}

/* ========================================
   10. Visualizations
   ======================================== */

.viz-container {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.viz-container:hover {
    box-shadow: var(--shadow-lg);
}

.viz-container:last-child {
    margin-bottom: 0;
}

.viz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-lighter);
}

.viz-title {
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary);
}

.viz-actions {
    display: flex;
    gap: 0.5rem;
}

.viz-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.0625rem;
    line-height: 1.7;
}

/* Remove grid layout for visualizations */
.viz-grid {
    display: block;
}

.viz-container.full-width {
    width: 100%;
}

.flourish-embed {
    min-height: 500px;
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Special height for map visualization */
.flourish-map {
    min-height: 600px;
}

/* Special height for bar chart race */
.flourish-bar-chart-race {
    min-height: 650px;
}

/* Special height for sankey charts */
.flourish-sankey {
    min-height: 700px;
}

/* Special height for hierarchy charts */
.flourish-hierarchy {
    min-height: 800px;
}

/* Special height for scatter plot */
.flourish-scatter {
    min-height: 600px;
}

/* Loading state for visualizations */
.flourish-embed:empty::before {
    content: "Se încarcă vizualizarea...";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: inherit;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--light);
}

/* ========================================
   11. Dashboard Section
   ======================================== */

.dashboard-section {
    background: var(--gray-lighter);
    padding: 0;
}

.dashboard-intro {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.dashboard-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ========================================
   12. Filters Section
   ======================================== */

.filters-section {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-lighter);
}

.filters-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
}

.filters-header h3 i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.filter-group label i {
    color: var(--primary);
    margin-right: 0.5rem;
    width: 20px;
}

.filter-group select {
    padding: 0.5rem; height:170px;
    border: 2px solid var(--gray-lighter);
    border-radius: var(--border-radius);
    background: white;
    font-size: 0.875rem; 
    transition: var(--transition-fast);
    cursor: pointer;
}

.filter-group select:hover {
    border-color: var(--gray-light);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

/* ========================================
   13. Stats Cards
   ======================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 1.5rem;
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   14. Insights Section
   ======================================== */

.insights-section {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
}

.insights-section h2 {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
}

.insights-section h2 i {
    color: var(--warning);
    margin-right: 0.5rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.insight-card {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.insight-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.insight-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.insight-detail {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.trend-indicator {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.trend-indicator.trend-up {
    color: var(--success);
}

.trend-indicator.trend-down {
    color: var(--danger);
}

.efficiency-bar {
    margin-top: 1rem;
    height: 6px;
    background: var(--gray-lighter);
    border-radius: 3px;
    overflow: hidden;
}

.efficiency-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger) 0%, var(--warning) 50%, var(--success) 100%);
    transition: width 1s ease;
}

/* ========================================
   15. Charts
   ======================================== */

.charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.chart-wrapper {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.chart-wrapper.full-width {
    grid-column: 1 / -1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.125rem;
    margin: 0;
    color: var(--text-primary);
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

.chart-container {
    position: relative;
    height: 300px;
}

.chart-container-tall {
    height: 400px;
}

.loading {
    text-align: center;
    padding: 3rem; position: absolute; z-index: 8888; left: 50%; top: 50%;
    color: var(--text-secondary);
}

#loading {
    text-align: center;
    padding: 3rem; position: absolute; z-index: 8888;left: 50%; top: 50%;
    color: var(--text-secondary);
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-lighter);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background: var(--danger);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 2rem 0;
}

.error i {
    margin-right: 0.5rem;
}

.chart-hidden {
    display: none;
}

/* ========================================
   16. Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--gray);
    color: white;
}

.btn-reset {
    background: var(--light);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border: 2px solid var(--gray-lighter);
}

.btn-reset:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ========================================
   17. Conclusions Section
   ======================================== */

.conclusions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.conclusion-card {
    background: var(--light);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.conclusion-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.conclusion-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.conclusion-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.conclusion-card p {
    color: var(--text-secondary);
}

.cta-section {
    background: var(--light);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    text-align: center;
    margin-top: 3rem;
}

.cta-section h3 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ========================================
   18. Footer
   ======================================== */
 
.footer {
    position: relative;
    background: linear-gradient(to bottom, #f8f9fa 0%, #75a8bc 100%);
    margin-top: 4rem;
    overflow: hidden;
    min-height: 200px;
}

/* Simple grass silhouette */
.grass-silhouette {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 80px;
    background: #2d5016;
    clip-path: polygon(
        0% 100%,
        0% 85%,
        2% 80%, 4% 82%, 6% 78%, 8% 83%, 10% 79%,
        12% 81%, 14% 77%, 16% 82%, 18% 78%, 20% 80%,
        22% 76%, 24% 81%, 26% 77%, 28% 79%, 30% 75%,
        32% 80%, 34% 76%, 36% 78%, 38% 74%, 40% 79%,
        42% 75%, 44% 77%, 46% 73%, 48% 78%, 50% 74%,
        52% 76%, 54% 72%, 56% 77%, 58% 73%, 60% 75%,
        62% 71%, 64% 76%, 66% 72%, 68% 74%, 70% 70%,
        72% 75%, 74% 71%, 76% 73%, 78% 69%, 80% 74%,
        82% 70%, 84% 72%, 86% 68%, 88% 73%, 90% 69%,
        92% 71%, 94% 67%, 96% 72%, 98% 68%, 100% 70%,
        100% 100%
    );
}

/* Subtle grass texture overlay */
.grass-texture {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 80px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(74, 124, 40, 0.1) 2px,
        rgba(74, 124, 40, 0.1) 3px
    );
    opacity: 0.5;
}

/* Simple animated grass blades - just a few for subtle movement */
.grass-accent {
    position: absolute;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to top, #2d5016, #4a7c28);
    transform-origin: bottom;
    animation: gentle-sway 6s ease-in-out infinite;
    opacity: 0.6;
}

.grass-accent:nth-child(1) { left: 15%; height: 45px; animation-delay: 0s; }
.grass-accent:nth-child(2) { left: 35%; height: 40px; animation-delay: 1s; }
.grass-accent:nth-child(3) { left: 55%; height: 48px; animation-delay: 2s; }
.grass-accent:nth-child(4) { left: 75%; height: 42px; animation-delay: 3s; }
.grass-accent:nth-child(5) { left: 85%; height: 46px; animation-delay: 4s; }

@keyframes gentle-sway {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(1deg); }
}

/* Hidden element - small leaf */
.hidden-leaf {
    position: absolute;
    bottom: 65px;
    left: 35%;
    width: 12px;
    height: 12px;
    background: #6fa832;
    border-radius: 0 100% 0 100%;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: help;
}

/* Show on hover in grass area */
.footer:hover .hidden-leaf {
    opacity: 0.7;
}

.hidden-leaf:hover {
    opacity: 1 !important;
    transform: rotate(45deg) scale(1.2);
}

/* Mini tooltip */
.hidden-leaf::after {
    content: '🌱';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%) rotate(-45deg);
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hidden-leaf:hover::after {
    opacity: 1;
}

/* Footer content */
.footer-content {
    position: relative;
    z-index: 10;
    padding: 2.5rem 2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-main {
    text-align: center;
    color: white;
    margin-bottom: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.95;
}

.footer-logo i {
    font-size: 1.5rem;
    opacity: 0.9;
}

.footer-text {
    font-size: 0.9rem;
    opacity: 0.85;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .footer {
        min-height: 180px;
    }
    
    .grass-silhouette,
    .grass-texture {
        height: 60px;
    }
    
    .grass-accent {
        display: none; /* Remove animation on mobile for performance */
    }
    
    .footer-content {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .footer-logo {
        font-size: 1.1rem;
    }
    
    .footer-text {
        font-size: 0.85rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .grass-accent {
        animation: none;
    }
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.social-links i {
    font-size: 1.25rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
}

.footer-bottom p {
    margin: 0;
}

/* ========================================
   19. Back to Top Button
   ======================================== */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ========================================
   20. Loading Overlay
   ======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.loading-content p {
    margin-top: 1rem;
    color: var(--text-secondary);
}




/* ========================================
   21. Animations
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease;
}

/* ========================================
   22. Responsive Design
   ======================================== */

@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    .dashboard-container {
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .viz-grid {
        grid-template-columns: 1fr;
    }
    
    .charts {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; text-align: center;}
    
    /* Header */
    .header {
        padding: 2rem 1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.25rem;
    }
    
    .header-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Navigation */
    .nav-toggle {
        display: block;
    }
    
    .nav-list {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-list.active {
        max-height: 500px;
    }
    
    .nav-link {
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--gray-lighter);
    }
    
    /* Sections */
    .section {
        padding: 3rem 0;
    }
    
    .intro-section {
        padding: 2rem 1.5rem;
    }
    
    /* Timeline */
    .timeline::before {
        left: 20px; 
    }
    
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 40px;
    }
    
    .timeline-item::before {
        left: 20px;
    }
    
    .timeline-date {
        text-align: left;
        padding-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .timeline-content {
        padding-left: 0;
    }
    
    /* Filters */
    .filters {
        grid-template-columns: 1fr;
    }
    
    /* Stats */
    .stats {
        grid-template-columns: 1fr;
    }
    
    /* Insights */
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    /* Conclusions */
    .conclusions-grid {
        grid-template-columns: 1fr;
    }
    
    /* CTA Buttons */
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Footer */
    .footer-links {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    /* Dashboard */
    .dashboard-container {
        padding: 1rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
    
    /* Back to Top */
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
    }
}

/* ========================================
   23. Print Styles
   ======================================== */

@media print {
    .nav,
    .back-to-top,
    .btn,
    .filter-section,
    .chart-actions {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    .chart-container {
        height: auto !important;
    }
}

/* ========================================
   24. Utilities
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }