/* Saint Timeline - Phase 3 Component Integration */

/* ===== CRITICAL VISIBILITY FIXES ===== */
/* These rules ensure timeline loads even when JavaScript fails */

/* Force timeline section visibility with anti-hiding rules */
#timeline[style*="display: none"],
#timeline[style*="visibility: hidden"],
#timeline[style*="opacity: 0"],
body.saint-template #timeline,
body.saint-page #timeline {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force timeline events container visibility */
.timeline-events[style*="display: none"],
.timeline-events[style*="visibility: hidden"],
.timeline-events[style*="opacity: 0"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force individual timeline events visibility */
.timeline-event[style*="display: none"],
.timeline-event[style*="visibility: hidden"],
.timeline-event[style*="opacity: 0"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Emergency ready class-based fixes */
.timeline-emergency-ready #timeline,
.timeline-emergency-ready .timeline-events,
.timeline-emergency-ready .timeline-event,
.timeline-emergency-ready .timeline-content {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.timeline-emergency-ready .timeline-events {
    display: flex !important;
}

.timeline-emergency-ready .timeline-event {
    display: flex !important;
}

/* ===== END CRITICAL VISIBILITY FIXES ===== */

/* ===== TIMELINE SECTION ===== */
#timeline {
    /* CRITICAL FIX: Guaranteed visibility with fallback values */
    background-color: var(--bg-main);
    position: relative;
    z-index: 3; /* Above hero z-index: 1 */
    padding: 3rem 0 2rem; /* REDUCED: From 6rem 0 5rem */
    margin: 0;
    width: 100%;
    min-height: 200px; /* Minimum height for visibility */
    overflow: visible;
    border: none;
    color: var(--text-dark);
    text-align: center;
    clear: both;
    display: block !important; /* Force visibility */
    visibility: visible !important;
}

/* Background Effects - Subtle pattern for light background */
#timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 25% 25%, var(--accent-secondary) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 50%, rgba(42, 63, 63, 0.05) 0%, transparent 100%),
        radial-gradient(1px 1px at 75% 75%, var(--accent-secondary) 0%, transparent 100%);
    background-size: 200px 200px;
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

/* Section content wrapper */
.section-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Enhanced Section Header - STANDARDIZED with saint-core.css pattern */
#timeline .section-header {
    text-align: center;
    margin-bottom: var(--spacing-md); /* REDUCED: From var(--spacing-lg) */
    padding: 1rem 1rem 1.5rem; /* REDUCED: From 2rem 1rem 3rem */
    position: relative;
    z-index: 10;
}

#timeline .section-header h2 {
    font-family: var(--font-primary);
    font-size: var(--font-size-xxl);
    margin-bottom: var(--spacing-xs);
    color: var(--text-dark);
    line-height: 1.2;
    position: relative;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

#timeline .section-header h2::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -10px;
    width: 60px;
    height: 3px;
    background-color: var(--tertiary-color);
    transform: translateX(-50%);
    border-radius: 2px;
}

#timeline .section-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1.4rem, 1.5vw, 1.2rem);
    color: var(--text-dark);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Timeline Instructions - standardized with other components */
#timeline .timeline-instructions {
    margin-top: 1rem;
    text-align: center;
}

#timeline .instruction-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--accent-secondary);
    color: var(--text-light);
    padding: 0.7rem 1.2rem;
    border-radius: 50px;
    border: none;
    font-family: var(--font-body);
    font-size: var(--er-fs-floor);
    font-weight: 600;
    cursor: default;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    pointer-events: none;
}

#timeline .instruction-text i {
    color: var(--accent-tertiary);
    font-size: 1.1em;
    transition: color var(--transition-fast);
}

/* Timeline Container - Vertical Layout */
#timeline .timeline-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem; /* REDUCED: From 2rem 1rem */
    z-index: 10;
}

/* Vertical Timeline Events - CRITICAL: Force visibility */
#timeline .timeline-events {
    position: relative;
    display: flex !important;
    flex-direction: column;
    gap: 2rem; /* REDUCED: From 3rem */
    padding: 1rem 0; /* REDUCED: From 2rem 0 */
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Central Timeline Line */
#timeline .timeline-events::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        var(--tertiary-color) 10%,
        var(--secondary-color) 50%,
        var(--tertiary-color) 90%,
        transparent 100%);
    transform: translateX(-2px);
    z-index: 1;
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(201, 160, 83, 0.3);
}

/* Individual Timeline Events - CRITICAL: Force visibility */
#timeline .timeline-event {
    position: relative;
    display: flex !important;
    align-items: center;
    opacity: 1 !important;
    transform: translateY(0) !important;
    animation: eventReveal 0.8s ease-out both;
    animation-delay: calc(var(--event-index, 0) * 0.2s);
    visibility: visible !important;
    margin-bottom: 1rem; /* REDUCED: From 2rem */
}

#timeline .timeline-event:nth-child(1) { --event-index: 0; }
#timeline .timeline-event:nth-child(2) { --event-index: 1; }
#timeline .timeline-event:nth-child(3) { --event-index: 2; }
#timeline .timeline-event:nth-child(4) { --event-index: 3; }
#timeline .timeline-event:nth-child(5) { --event-index: 4; }
#timeline .timeline-event:nth-child(6) { --event-index: 5; }
#timeline .timeline-event:nth-child(7) { --event-index: 6; }
#timeline .timeline-event:nth-child(8) { --event-index: 7; }

/* Alternating Layout - Left and Right */
#timeline .timeline-event:nth-child(odd) {
    flex-direction: row;
    justify-content: flex-start;
}

#timeline .timeline-event:nth-child(even) {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

/* Timeline alignment - proper spacing from center line */
#timeline .timeline-event:nth-child(odd) .timeline-content {
    margin-right: calc(50% + 4rem);
    margin-left: 0;
}

#timeline .timeline-event:nth-child(even) .timeline-content {
    margin-left: calc(50% + 4rem);
    margin-right: 0;
}

/* Event Content - standardized with saint-core.css */
#timeline .timeline-content {
    width: calc(50% - 6rem);
    background-color: var(--primary-color);
    backdrop-filter: blur(5px);
    border-radius: var(--radius-lg);
    padding: 1rem; /* REDUCED: From 1.5rem */
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--tertiary-color);
    position: relative;
    transition: all var(--transition-fast);
    text-align: left;
    z-index: 10;
    /* CRITICAL: Force visibility */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#timeline .timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Content Arrow */
#timeline .timeline-event:nth-child(odd) .timeline-content::before {
    content: '';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    border: 15px solid transparent;
    border-left-color: var(--primary-color);
}

#timeline .timeline-event:nth-child(even) .timeline-content::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    border: 15px solid transparent;
    border-right-color: var(--primary-color);
}

/* Content Header Gradient */
#timeline .timeline-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--tertiary-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Event Icon Container */
#timeline .timeline-event-icon {
    width: 4rem;
    height: 4rem;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 15;
    flex-shrink: 0;
    margin: 0 2rem;
}

/* Icon Background Circle */
#timeline .timeline-event-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--tertiary-color), var(--secondary-color));
    border-radius: var(--radius-round);
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: all var(--transition-fast);
    box-shadow: 0 0 20px rgba(201, 160, 83, 0.3);
}

/* Animated Ring Around Icon */
#timeline .timeline-event-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    border: 2px solid var(--tertiary-color);
    border-radius: var(--radius-round);
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0;
    animation: pulseRing 3s ease-in-out infinite;
    animation-delay: calc(var(--event-index, 0) * 0.5s);
}

/* Icon SVG/Font Icon */
#timeline .timeline-event-icon i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: var(--primary-dark);
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-fast);
}

/* Hover Effects */
#timeline .timeline-event:hover .timeline-event-icon::before {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 30px rgba(201, 160, 83, 0.6);
}

#timeline .timeline-event:hover .timeline-event-icon i {
    transform: translate(-50%, -50%) scale(1.1);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

/* Event Date */
#timeline .timeline-date {
    font-family: var(--font-primary);
    font-size: var(--er-fs-floor);
    color: var(--accent-tertiary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Event Title */
#timeline .timeline-content h3 {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    line-height: var(--line-height-tight);
    font-weight: 600;
}

/* Event Description */
#timeline .timeline-content p {
    color: var(--text-light);
    line-height: var(--line-height-normal);
    margin-bottom: 1rem;
    font-size: var(--er-fs-deck);
    opacity: 0.9;
}

/* Event Location */
#timeline .timeline-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-size: var(--er-fs-floor);
    opacity: 0.9;
}

#timeline .timeline-info-item i {
    color: var(--accent-tertiary);
    font-size: var(--er-fs-floor);
}

/* Journey Buttons - STANDARDIZED with saint-core.css button system */
#timeline .timeline-add-btn {
    background-color: var(--tertiary-color);
    color: var(--primary-dark);
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--er-fs-floor);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#timeline .timeline-add-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(201, 160, 83, 0.3);
}



#timeline .timeline-add-btn i {
    font-size: var(--er-fs-floor);
}

/* Action Footer - standardized styling */
#timeline .timeline-footer {
    text-align: center;
    padding: 2rem 1rem; /* REDUCED: From 3rem 2rem */
    background: var(--accent-secondary);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--accent-tertiary);
}

/* STANDARDIZED footer buttons using saint-core.css button system */
#timeline .timeline-footer .btn-primary {
    background-color: var(--tertiary-color);
    color: var(--primary-dark);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--er-fs-floor);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem;
}

#timeline .timeline-footer .btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(201, 160, 83, 0.3);
}

#timeline .timeline-footer .btn-secondary {
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--er-fs-floor);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem;
}

#timeline .timeline-footer .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* ===== ANIMATIONS ===== */

@keyframes eventRevealDelayed {
    0% { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

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

/* Enhanced Animation for Detailed Events */
@keyframes eventReveal {
    0% { 
        opacity: 0; 
        transform: translateY(50px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes pulseRing {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.8); 
    }
    50% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(1.2); 
    }
}

/* Enhanced States */
#timeline .timeline-event-icon.icon-hover::before {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 40px rgba(201, 160, 83, 0.6);
}

#timeline .timeline-event-icon.icon-hover i {
    transform: translate(-50%, -50%) scale(1.2);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

/* Success States - consistent with other components */
#timeline .timeline-add-btn.btn-added {
    background: linear-gradient(45deg, #10b981, #059669) !important;
    transform: scale(1.05);
}

/* Epic notification styling - standardized */
.epic-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-secondary);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--accent-tertiary);
    z-index: var(--z-highest);
    transform: translateX(400px);
    opacity: 0;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 350px;
}

.epic-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.epic-notification i {
    color: var(--accent-tertiary);
    font-size: var(--er-fs-floor);
}

.epic-notification span {
    color: var(--text-light);
    font-weight: 500;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    #timeline .timeline-container {
        padding: 0.5rem; /* REDUCED: From 1rem */
    }
    
    #timeline .timeline-events {
        gap: 1.5rem; /* REDUCED: From 2rem */
    }
    
    #timeline .timeline-event {
        flex-direction: column !important;
        text-align: center;
    }
    
    #timeline .timeline-event:nth-child(even) {
        flex-direction: column !important;
    }
    
    #timeline .timeline-content {
        width: 100%;
        margin: 1rem 0 0 0;
        text-align: center;
    }
    
    #timeline .timeline-content::before {
        display: none;
    }
    
    #timeline .timeline-events::before {
        left: 2rem;
    }
    
    #timeline .timeline-event-icon {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    #timeline .section-header {
        padding: 1.5rem 1rem 2rem;
    }
    
    #timeline .timeline-content {
        padding: 1rem;
    }
    
    #timeline .timeline-footer {
        padding: 2rem 1rem;
    }
    
    #timeline .timeline-footer .btn-primary,
    #timeline .timeline-footer .btn-secondary {
        width: 100%;
        max-width: 280px;
        margin: 0.5rem auto;
        display: block;
    }
}

/* ===== EXPANDABLE TIMELINE STYLES ===== */

/* Core Timeline - Always Visible */
.timeline-events-core {
    position: relative;
    display: flex !important;
    flex-direction: column;
    gap: 2rem; /* REDUCED: From 3rem */
    padding: 1rem 0; /* REDUCED: From 2rem 0 */
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Visual distinction for core events */
.timeline-event-core {
    position: relative;
}

.timeline-event-core .timeline-content {
    border-left: 4px solid var(--tertiary-color);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(201, 160, 83, 0.1);
}

/* Detailed Timeline - Expandable */
.timeline-events-detailed {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2rem; /* REDUCED: From 3rem */
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0;
}

.timeline-events-detailed.expanded {
    max-height: none;
    opacity: 1;
    transform: translateY(0);
    padding: 1rem 0; /* REDUCED: From 2rem 0 */
    margin-top: 0.5rem; /* REDUCED: From 1rem */
}

/* Visual distinction for detailed events */
.timeline-event-detailed {
    opacity: 0.95;
}

.timeline-event-detailed .timeline-content {
    border-left: 3px solid var(--secondary-color);
    background: rgba(42, 63, 63, 0.92);
    backdrop-filter: blur(8px);
}

.timeline-events-detailed.expanded .timeline-event-detailed {
    animation: eventRevealDelayed 0.6s ease-out both;
    animation-delay: calc(var(--event-index, 0) * 0.1s);
}

/* Expansion Controls */
.timeline-expansion-controls {
    text-align: center;
    margin: 1.5rem 0 1rem; /* REDUCED: From 3rem 0 2rem */
    position: relative;
    z-index: 10;
}

.timeline-expand-btn {
    background: linear-gradient(135deg, var(--tertiary-color), var(--secondary-color));
    color: var(--primary-dark);
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--er-fs-floor);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(201, 160, 83, 0.2);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-width: 280px;
    border: 2px solid transparent;
}

.timeline-expand-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--tertiary-color));
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(201, 160, 83, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.timeline-expand-btn:focus {
    outline: 3px solid var(--accent-tertiary);
    outline-offset: 2px;
}

/* Button Text States */
.timeline-expand-btn .collapse-text {
    display: none;
}

.timeline-expand-btn[aria-expanded="true"] .expand-text {
    display: none;
}

.timeline-expand-btn[aria-expanded="true"] .collapse-text {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

/* Button Icon Animation */
.timeline-expand-btn i {
    transition: transform var(--transition-normal);
    font-size: 0.9em;
}

.timeline-expand-btn[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Loading State for Expansion */
.timeline-expand-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.timeline-expand-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced Animation for Detailed Events */
@keyframes eventRevealDelayed {
    0% { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Visual Separator Between Core and Detailed */
.timeline-events-detailed::before {
    content: '';
    position: absolute;
    top: -1rem;
    left: 50%;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--tertiary-color), transparent);
    transform: translateX(-50%);
    z-index: 1;
}

/* Performance Optimization - GPU Acceleration */
.timeline-events-detailed,
.timeline-expand-btn {
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===== RESPONSIVE EXPANDABLE TIMELINE ===== */

@media (max-width: 768px) {
    .timeline-expansion-controls {
        margin: 1rem 0 0.5rem; /* REDUCED: From 2rem 0 1rem */
        padding: 0 1rem;
    }
    
    .timeline-expand-btn {
        width: 100%;
        max-width: 320px;
        padding: 1rem 1.5rem;
        font-size: var(--er-fs-floor);
        min-width: auto;
    }
    
    .timeline-events-core,
    .timeline-events-detailed {
        gap: 1.5rem; /* REDUCED: From 2rem */
        padding: 0.5rem 0; /* REDUCED: From 1rem 0 */
    }
    
    .timeline-events-detailed.expanded {
        padding: 1rem 0; /* REDUCED: From 1.5rem 0 */
    }
}

@media (max-width: 480px) {
    .timeline-expand-btn {
        padding: 0.875rem 1.25rem;
        font-size: var(--er-fs-floor);
        letter-spacing: 0.5px;
    }
    
    .timeline-expand-btn .expand-text,
    .timeline-expand-btn .collapse-text {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .timeline-expand-btn {
        border: 3px solid var(--text-dark);
        background: var(--bg-main);
        color: var(--text-dark);
    }
    
    .timeline-events-detailed::before {
        background: var(--text-dark);
        height: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .timeline-events-detailed,
    .timeline-expand-btn,
    .timeline-expand-btn i {
        transition: none;
        animation: none;
    }
    
    .timeline-events-detailed.expanded .timeline-event-detailed {
        animation: none;
    }
    
    .timeline-expand-btn:hover {
        transform: none;
    }
}

/* Print Styles - Show All Timeline Events */
@media print {
    .timeline-events-detailed {
        display: flex !important;
        max-height: none !important;
        opacity: 1 !important;
        transform: none !important;
        padding: 2rem 0 !important;
    }
    
    .timeline-expansion-controls {
        display: none !important;
    }
}
