/* ============================================
   TIMELINE SECTION STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Timeline Section */
.timeline-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Section Header */
.timeline-header {
    text-align: center;
    margin-bottom: 80px;
    padding: 0 20px;
}

.timeline-title {
    font-size: 48px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.timeline-subtitle {
    font-size: 18px;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   CAROUSEL CONTAINER
   ============================================ */

.timeline-carousel {
    position: relative;
    overflow: hidden;
    padding: 40px 0;
}

.timeline-slider {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* Individual Slide */
.timeline-slide {
    min-width: 100%;
    padding: 0 20px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    box-sizing: border-box;
}

.timeline-slide.active {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   TIMELINE CARD LAYOUT
   ============================================ */

.timeline-card {
    display: flex;
    align-items: center;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 40px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    overflow: hidden; /* Contain year badge */
}

/* Year Badge - Alternating Placement */
.year-badge {
    position: absolute;
    top: -30px;
    font-size: 120px;
    font-weight: 900;
    opacity: 0.15;
    z-index: 1;
    transition: all 0.4s ease;
    font-family: 'Playfair Display', serif;
    pointer-events: none; /* Don't interfere with clicks */
}

/* Alternating badge colors */
.year-badge.red {
    color: #e53935;
    left: 40px;
}

.year-badge.orange {
    color: #ff9800;
    right: 40px;
}

/* Active slide badge highlight effect */
.timeline-slide.active .year-badge {
    opacity: 0.25;
    transform: scale(1.05);
}

/* ============================================
   CONTENT SECTION
   ============================================ */

.timeline-content {
    flex: 1;
    z-index: 2;
    position: relative;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Left-aligned content */
.timeline-content.left {
    order: 1;
    padding-right: 40px;
}

/* Right-aligned content */
.timeline-content.right {
    order: 2;
    padding-left: 40px;
}

.event-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.event-description {
    font-size: 16px;
    color: #555;
    line-height: 1.8;
    text-align: justify;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   IMAGE SECTION
   ============================================ */

.timeline-image {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    transition: transform 0.4s ease;
    max-width: 100%;
}

/* Subtle parallax effect on hover */
.timeline-slide.active .timeline-image:hover {
    transform: scale(1.03) translateY(-5px);
}

.timeline-image img {
    width: 100%;
    max-width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

/* Parallax effect between text and image */
.timeline-slide.active .timeline-image img {
    transform: translateX(0);
}

/* Left content: image on right */
.timeline-content.left ~ .timeline-image {
    order: 2;
}

/* Right content: image on left */
.timeline-content.right ~ .timeline-image {
    order: 1;
}

/* ============================================
   NAVIGATION CONTROLS
   ============================================ */

.timeline-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e53935;
    color: #e53935;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    font-size: 18px;
}

.timeline-nav:hover {
    background: #e53935;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

/* Visible focus state for accessibility */
.timeline-nav:focus {
    outline: 3px solid #ff9800;
    outline-offset: 3px;
}

.timeline-nav.prev {
    left: 20px;
}

.timeline-nav.next {
    right: 20px;
}

/* ============================================
   PAGINATION DOTS
   ============================================ */

.timeline-pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 50px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    padding: 0 20px;
}

.pagination-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d0d0d0;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.pagination-dot:hover {
    background: #999;
    transform: scale(1.2);
}

.pagination-dot.active {
    background: #e53935;
    width: 40px;
    border-radius: 20px;
    border-color: #e53935;
}

/* Focus state for keyboard navigation */
.pagination-dot:focus {
    outline: 2px solid #ff9800;
    outline-offset: 3px;
}

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

@media (max-width: 1024px) {
    .timeline-section {
        padding: 80px 0;
    }

    .timeline-card {
        flex-direction: column;
        gap: 30px;
        padding: 30px 25px;
    }

    .timeline-content.left,
    .timeline-content.right {
        order: 1 !important;
        padding: 0 !important;
    }

    .timeline-image {
        order: 2 !important;
        width: 100%;
    }

    .year-badge {
        font-size: 80px;
        top: -15px;
    }

    .year-badge.red,
    .year-badge.orange {
        left: 20px;
        right: auto;
    }

    .event-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .timeline-section {
        padding: 60px 0;
    }

    .timeline-header {
        margin-bottom: 50px;
        padding: 0 15px;
    }

    .timeline-title {
        font-size: 32px;
        margin-bottom: 15px;
    }

    .timeline-subtitle {
        font-size: 15px;
        line-height: 1.7;
    }

    .timeline-slide {
        padding: 0 10px;
    }

    .timeline-card {
        padding: 25px 20px;
        gap: 25px;
        border-radius: 15px;
    }

    .event-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .event-description {
        font-size: 14px;
        line-height: 1.7;
        text-align: left; /* Better for mobile */
    }

    .timeline-image img {
        height: 280px;
    }

    .timeline-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .timeline-nav.prev {
        left: 10px;
    }

    .timeline-nav.next {
        right: 10px;
    }

    .year-badge {
        font-size: 50px;
        top: -10px;
        left: 15px !important;
    }

    .timeline-pagination {
        margin-top: 40px;
        gap: 10px;
    }

    .pagination-dot.active {
        width: 30px;
    }

    /* Disable hover effects on mobile */
    .timeline-slide.active .timeline-image:hover {
        transform: none;
    }
}

@media (max-width: 576px) {
    .timeline-section {
        padding: 50px 0;
    }

    .timeline-header {
        margin-bottom: 40px;
        padding: 0 10px;
    }

    .timeline-title {
        font-size: 28px;
    }

    .timeline-subtitle {
        font-size: 14px;
    }

    .timeline-slide {
        padding: 0 5px;
    }

    .timeline-card {
        padding: 20px 15px;
        gap: 20px;
        border-radius: 12px;
    }

    .event-title {
        font-size: 22px;
    }

    .event-description {
        font-size: 13px;
        line-height: 1.6;
    }

    .timeline-image img {
        height: 240px;
    }

    .timeline-nav {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .timeline-nav.prev {
        left: 5px;
    }

    .timeline-nav.next {
        right: 5px;
    }

    .year-badge {
        font-size: 40px;
        top: -8px;
        left: 10px !important;
    }

    .timeline-pagination {
        gap: 8px;
        margin-top: 30px;
    }

    .pagination-dot {
        width: 10px;
        height: 10px;
    }

    .pagination-dot.active {
        width: 24px;
    }
}

@media (max-width: 480px) {
    .timeline-section {
        padding: 40px 0;
    }

    .timeline-card {
        padding: 15px 10px;
        gap: 15px;
    }

    .event-title {
        font-size: 20px;
    }

    .event-description {
        font-size: 13px;
    }

    .timeline-image img {
        height: 200px;
    }

    .year-badge {
        font-size: 35px;
        opacity: 0.1;
    }

    .timeline-nav {
        width: 32px;
        height: 32px;
        font-size: 12px;
        border-width: 1px;
    }
}
