/* =====================================================
   EVENT TIMELINE PAGE - ENHANCED STYLES
   Version: 3.0
   Description: Modern styling for Event Timeline Dashboard inspired by GBV Analytics
   ===================================================== */

/* ===================================================== 
   1. HERO SECTION (Enhanced with GBV Analytics Style)
   ===================================================== */
.timeline-hero {
    background: linear-gradient(135deg, #9333ea 0%, #c084fc 25%, #e879f9 50%, #f0abfc 100%);
    padding: 5rem 0 6rem;
    margin: -1.5rem -15px 3rem;
    position: relative;
    overflow: hidden;
}

.timeline-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 120%;
    height: 200%;
    background: radial-gradient(circle at 80% 50%, rgb(236 72 153 / 20%) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgb(196 181 253 / 20%) 0%, transparent 50%);
    animation: float-slow 30s ease-in-out infinite;
}

.timeline-hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 120px;
    background: #f8fafc;
    clip-path: polygon(0 40%, 100% 0, 100% 100%, 0% 100%);
}

.timeline-hero-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.timeline-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgb(255 255 255 / 20%);
    backdrop-filter: blur(10px);
    border: 1px solid rgb(255 255 255 / 30%);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: white;
    font-weight: 600;
    animation: pulse-glow 2s ease-in-out infinite;
}

.timeline-hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.timeline-hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgb(0 0 0 / 10%);
    animation: slideInUp 0.8s ease-out;
}

.timeline-hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
    animation: slideInUp 0.8s ease-out 0.2s backwards;
}

/* ===================================================== 
   2. KEY METRICS CARDS (Enhanced with GBV Style)
   ===================================================== */
.timeline-metrics-container {
    margin-top: 2rem;
    position: relative;
    z-index: 5;
    padding: 0 1rem;
    margin-bottom: 3rem;
}

.timeline-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline-metric-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 15px 40px rgb(0 0 0 / 10%);
    border: 1px solid rgb(0 0 0 / 5%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.timeline-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, currentcolor, transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.timeline-metric-card:hover::before {
    transform: translateX(100%);
}

.timeline-metric-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgb(0 0 0 / 15%);
}

.timeline-metric-card.primary {
    --metric-color: #9333ea;
    color: var(--metric-color);
}

.timeline-metric-card.success {
    --metric-color: #10b981;
    color: var(--metric-color);
}

.timeline-metric-card.warning {
    --metric-color: #f59e0b;
    color: var(--metric-color);
}

.timeline-metric-card.info {
    --metric-color: #3b82f6;
    color: var(--metric-color);
}

.timeline-metric-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--metric-color), color-mix(in srgb, var(--metric-color), white 30%));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 10px 25px color-mix(in srgb, var(--metric-color), transparent 60%);
    position: relative;
    overflow: hidden;
}

.timeline-metric-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgb(255 255 255 / 40%) 50%, transparent 70%);
    animation: shine 3s infinite;
}

.timeline-metric-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.timeline-metric-value {
    font-size: 2.75rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.5rem;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--metric-color), color-mix(in srgb, var(--metric-color), black 20%));
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s ease;
}

.timeline-metric-card:hover .timeline-metric-value {
    transform: scale(1.05);
}

.timeline-metric-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* ===================================================== 
   3. CONTROL PANEL (Enhanced with GBV Style)
   ===================================================== */
.timeline-control-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.timeline-control-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto;
    gap: 1rem;
    align-items: end;
}

.timeline-control-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    display: block;
    margin-bottom: 0.5rem;
}

.timeline-control-input {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
}

.timeline-control-input:focus {
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgb(147 51 234 / 10%);
    outline: none;
}

.timeline-control-btn {
    background: linear-gradient(135deg, #9333ea, #c084fc);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.timeline-control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 20%), transparent);
    transition: left 0.5s;
}

.timeline-control-btn:hover::before {
    left: 100%;
}

.timeline-control-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgb(147 51 234 / 30%);
    color: white;
}

/* ===================================================== 
   4. MAIN CHART CARD (Enhanced with GBV Style)
   ===================================================== */
.timeline-main-section {
    margin-bottom: 3rem;
}

.timeline-chart-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
    overflow: hidden;
    border: 1px solid rgb(0 0 0 / 5%);
    transition: all 0.3s ease;
}

.timeline-chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgb(0 0 0 / 12%);
}

.timeline-chart-container {
    height: 500px;
    padding: 2rem;
    position: relative;
    background: rgb(248 250 252 / 50%);
    border-radius: 12px;
    margin: 1rem;
}

.timeline-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    background: linear-gradient(to bottom, rgb(249 250 251 / 80%), transparent);
    border-top: 1px solid rgb(0 0 0 / 5%);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #64748b;
    transition: all 0.3s ease;
    cursor: pointer;
}

.legend-item:hover {
    transform: translateY(-2px);
    color: #1e293b;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgb(0 0 0 / 10%);
    transition: all 0.3s ease;
}

.legend-item:hover .legend-color {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
}

.legend-color.political { background: linear-gradient(135deg, #dc2626, #ef4444); }
.legend-color.cultural { background: linear-gradient(135deg, #e879f9, #f0abfc); }
.legend-color.economic { background: linear-gradient(135deg, #059669, #10b981); }
.legend-color.security { background: linear-gradient(135deg, #ea580c, #f97316); }
.legend-color.incidents { background: linear-gradient(135deg, #64748b, #94a3b8); }

/* ===================================================== 
   5. EVENT CARDS (Enhanced with GBV Style)
   ===================================================== */
.timeline-events-section {
    margin-bottom: 3rem;
}

.timeline-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.timeline-section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #9333ea, #c084fc);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline-section-header p {
    color: #64748b;
    font-size: 1.125rem;
    line-height: 1.7;
}

.timeline-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
}

.timeline-event-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgb(0 0 0 / 5%);
    position: relative;
}

.timeline-event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgb(147 51 234 / 5%), transparent);
    transition: left 0.5s;
}

.timeline-event-card:hover::before {
    left: 100%;
}

.timeline-event-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 50px rgb(0 0 0 / 15%);
}

.event-card-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.event-card-header.political {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.event-card-header.cultural {
    background: linear-gradient(135deg, #e879f9, #f0abfc);
}

.event-card-header.economic {
    background: linear-gradient(135deg, #059669, #10b981);
}

.event-card-header.security {
    background: linear-gradient(135deg, #ea580c, #f97316);
}

.event-card-header.health {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
}

.event-card-header.legal {
    background: linear-gradient(135deg, #7c2d12, #92400e);
}

.event-type-badge {
    background: rgb(255 255 255 / 20%);
    backdrop-filter: blur(10px);
    border: 1px solid rgb(255 255 255 / 30%);
    padding: 0.375rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
}

.event-significance {
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-significance.high-significance {
    background: rgb(255 255 255 / 90%);
    color: #dc2626;
}

.event-significance.medium-significance {
    background: rgb(255 255 255 / 90%);
    color: #f59e0b;
}

.event-significance.low-significance {
    background: rgb(255 255 255 / 90%);
    color: #10b981;
}

.event-card-body {
    padding: 2rem;
    background: linear-gradient(135deg, #1e293b, #334155); /* Dark gradient background */
    color: white; /* White text for contrast */
}

.event-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white; /* White title on dark background */
    margin-bottom: 1rem;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgb(0 0 0 / 20%); /* Subtle shadow for readability */
}

.event-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0; /* Light gray for contrast on dark background */
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.event-date i {
    color: #c084fc; /* Light purple icon */
}

.event-description {
    color: #cbd5e1; /* Light gray text on dark background */
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.event-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.metric {
    text-align: center;
    padding: 1rem;
    background: rgb(255 255 255 / 10%); /* Semi-transparent white on dark background */
    border-radius: 12px;
    border: 1px solid rgb(255 255 255 / 20%);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
    background: rgb(255 255 255 / 15%);
}

.metric-label {
    display: block;
    font-size: 0.75rem;
    color: #e2e8f0; /* Light gray text */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
}

.metric-value.strong-correlation {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-value.moderate-correlation {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-value.weak-correlation {
    background: linear-gradient(135deg, #10b981, #34d399);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.event-card-footer {
    padding: 1.5rem;
    background: linear-gradient(to bottom, rgb(255 255 255 / 5%), transparent);
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid rgb(255 255 255 / 10%);
}

/* ===================================================== 
   6. ENHANCED CARDS (GBV Style)
   ===================================================== */
.card-enhanced {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
    overflow: hidden;
    border: 1px solid rgb(0 0 0 / 5%);
    transition: all 0.3s ease;
    height: 100%;
}

.card-enhanced:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgb(0 0 0 / 12%);
}

.card-header-enhanced {
    background: linear-gradient(to bottom, rgb(249 250 251 / 80%), transparent);
    padding: 1.75rem;
    border-bottom: 1px solid rgb(0 0 0 / 5%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-actions button {
    position: relative;
    overflow: hidden;
}

.card-actions button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 20%), transparent);
    transition: left 0.5s;
}

.card-actions button:hover::before {
    left: 100%;
}

.card-header-enhanced.primary { background: linear-gradient(135deg, #9333ea, #c084fc); }
.card-header-enhanced.info { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.card-header-enhanced.warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.card-header-enhanced.success { background: linear-gradient(135deg, #10b981, #34d399); }
.card-header-enhanced.danger { background: linear-gradient(135deg, #dc2626, #ef4444); }
.card-header-enhanced.secondary { background: linear-gradient(135deg, #64748b, #94a3b8); }

.card-header-enhanced.primary h3,
.card-header-enhanced.info h3,
.card-header-enhanced.warning h3,
.card-header-enhanced.success h3,
.card-header-enhanced.danger h3,
.card-header-enhanced.secondary h3,
.card-header-enhanced.primary h4,
.card-header-enhanced.info h4,
.card-header-enhanced.warning h4,
.card-header-enhanced.success h4,
.card-header-enhanced.danger h4,
.card-header-enhanced.secondary h4 {
    color: white;
    text-shadow: 0 2px 4px rgb(0 0 0 / 10%);
}

.card-title-enhanced {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
}

.card-body-enhanced {
    padding: 2rem;
    background: rgb(248 250 252 / 50%);
}

/* ===================================================== 
   7. ANALYSIS SECTIONS (Enhanced)
   ===================================================== */
.timeline-analysis-section,
.timeline-ai-section,
.timeline-predictive-section {
    margin-bottom: 3rem;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Key Insights Enhanced */
#key-insights-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.insight-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    border: 1px solid rgb(0 0 0 / 5%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.insight-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgb(var(--insight-color-rgb), 0.1), transparent);
    transition: left 0.5s;
}

.insight-item:hover::before {
    left: 100%;
}

.insight-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 24px rgb(0 0 0 / 10%);
}

.insight-item.high {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #fca5a5;

    --insight-color-rgb: 220, 38, 38;
}

.insight-item.medium {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fcd34d;

    --insight-color-rgb: 245, 158, 11;
}

.insight-item.low {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #6ee7b7;

    --insight-color-rgb: 16, 185, 129;
}

.insight-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
}

.insight-item.high .insight-icon {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

.insight-item.medium .insight-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

.insight-item.low .insight-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

/* ===================================================== 
   8. BUTTONS (Enhanced with GBV Style)
   ===================================================== */
.btn {
    border: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-outline-primary {
    background: transparent;
    color: #9333ea;
    border: 2px solid #9333ea;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #9333ea, #c084fc);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(147 51 234 / 30%);
}

.btn-outline-secondary {
    background: transparent;
    color: #64748b;
    border: 2px solid #e5e7eb;
}

.btn-outline-secondary:hover {
    background: #64748b;
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(100 116 139 / 30%);
}

/* ===================================================== 
   9. ANIMATIONS
   ===================================================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgb(255 255 255 / 30%); }
    50% { box-shadow: 0 0 30px rgb(255 255 255 / 50%); }
}

.timeline-metric-card {
    animation: slideInUp 0.6s ease-out backwards;
}

.timeline-metric-card:nth-child(1) { animation-delay: 0.1s; }
.timeline-metric-card:nth-child(2) { animation-delay: 0.2s; }
.timeline-metric-card:nth-child(3) { animation-delay: 0.3s; }
.timeline-metric-card:nth-child(4) { animation-delay: 0.4s; }

.timeline-event-card {
    animation: fadeIn 0.8s ease-out backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================================== 
   10. LOADING STATES
   ===================================================== */
.spinner-border {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--metric-color, #9333ea);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================================== 
   11. DARK MODE SUPPORT
   ===================================================== */
















/* ===================================================== 
   12. RESPONSIVE DESIGN
   ===================================================== */
@media (width <= 1200px) {
    .timeline-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline-events-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}

@media (width <= 768px) {
    .timeline-hero {
        padding: 3rem 0 4rem;
    }
    
    .timeline-hero-title {
        font-size: 2.5rem;
    }
    
    .timeline-hero-subtitle {
        font-size: 1.125rem;
    }
    
    .timeline-metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .timeline-metric-card {
        padding: 1.5rem;
    }
    
    .timeline-metric-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .timeline-metric-value {
        font-size: 2.25rem;
    }
    
    .timeline-control-row {
        grid-template-columns: 1fr;
    }
    
    .timeline-events-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-legend {
        gap: 1rem;
        padding: 1rem;
    }
    
    .event-metrics {
        grid-template-columns: 1fr;
    }
    
    .card-header-enhanced {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (width <= 480px) {
    .timeline-hero-title {
        font-size: 2rem;
    }
    
    .timeline-metric-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .timeline-metric-value {
        font-size: 1.75rem;
    }
    
    .timeline-metric-title {
        font-size: 0.75rem;
    }
    
    .timeline-section-header h2 {
        font-size: 1.75rem;
    }
    
    .event-title {
        font-size: 1.125rem;
    }
    
    .metric-value {
        font-size: 1.25rem;
    }
}

/* ===================================================== 
   13. PRINT STYLES
   ===================================================== */
@media print {
    .timeline-hero,
    .timeline-control-panel,
    .card-actions,
    .event-card-footer {
        display: none;
    }
    
    .timeline-metric-card,
    .card-enhanced,
    .timeline-event-card {
        box-shadow: none;
        border: 1px solid #cccccc;
        break-inside: avoid;
    }
}

/* ===================================================== 
   14. AI ANALYSIS ENHANCEMENTS
   ===================================================== */
.ai-analysis-result {
    background: linear-gradient(135deg, #f8fafc 0%, #e9d5ff 100%);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgb(147 51 234 / 10%);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgb(102 126 234 / 10%);
}

.analysis-header h4 {
    color: #1e293b;
    font-weight: 700;
    margin: 0;
    font-size: 1.5rem;
}

.analysis-date {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    background: rgb(147 51 234 / 10%);
    padding: 0.375rem 1rem;
    border-radius: 50px;
}

.ai-generated-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgb(0 0 0 / 5%);
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgb(0 0 0 / 5%);
}

.ai-generated-content p {
    line-height: 1.8;
    color: #334155;
    margin-bottom: 1.25rem;
}

.ai-generated-content strong {
    color: #1e293b;
    font-weight: 700;
}

/* Event Detail Modal Enhancements */
.event-detail-view {
    max-height: 80vh;
    overflow-y: auto;
    padding-right: 1rem;
}

.event-basic-info h3 {
    font-size: 1.75rem;
    background: linear-gradient(135deg, #9333ea, #c084fc);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.correlation-analysis {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.correlation-analysis h4 {
    color: #0c4a6e;
    margin-bottom: 1.5rem;
}

.correlation-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgb(0 0 0 / 5%);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgb(0 0 0 / 10%);
}

.metric-card .metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Comprehensive Report Styling */
.comprehensive-ai-report {
    padding: 2rem;
}

.comprehensive-ai-report h4 {
    font-size: 1.75rem;
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.report-summary {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid rgb(59 130 246 / 10%);
}

.report-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgb(0 0 0 / 5%);
}

.report-section h5 {
    color: #334155;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.report-section ul {
    list-style: none;
    padding: 0;
}

.report-section li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgb(0 0 0 / 5%);
    position: relative;
    padding-left: 2rem;
}

.report-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #9333ea;
    font-weight: bold;
}

.report-section li:last-child {
    border-bottom: none;
}