/* Story Carousel Styles */
.story-carousel {
    position: relative;
    max-width: 1400px;
    margin: 4rem auto;
    padding: 0 60px; /* Space for arrows */
}

/* Carousel Track Container */
.carousel-track-container {
    overflow: hidden;
    margin: 0 auto;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 20px;
    padding: 20px 0;
}

/* Carousel Cards */
.carousel-card {
    flex: 0 0 350px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    backdrop-filter: blur(10px);
    transform: scale(0.85) translateY(20px);
    opacity: 0.6;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

/* Active (center) card */
.carousel-card.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Phase indicator */
.card-phase {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    font-weight: 600;
    opacity: 0.7;
}

/* Phase colors */
.phase-1 .card-phase {
    color: #3543F0;
}

.phase-2 .card-phase {
    color: #ef4444;
}

.warning-card .card-phase {
    color: #fbbf24;
}

.final-card .card-phase {
    color: #dc2626;
}

/* Event number */
.carousel-card .event-number {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: #3543F0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    box-shadow: 0 4px 12px rgba(53, 67, 240, 0.4);
}

/* Event visual */
.carousel-card .event-visual {
    width: 100%;
    height: 200px;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.carousel-card .event-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Adjust positioning for cards 1-3 to show heads */
.carousel-card[data-index="0"] .event-visual img,
.carousel-card[data-index="1"] .event-visual img,
.carousel-card[data-index="2"] .event-visual img {
    object-position: center 20%;
}

/* Card 4 (warning) - show full image */
.warning-card .event-visual {
    height: 250px;
}

.warning-card .event-visual img {
    object-fit: contain;
    background: rgba(0, 0, 0, 0.1);
}

/* Event content */
.carousel-card .event-content {
    text-align: center;
}

.carousel-card .event-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
    line-height: 1.6;
    margin: 0;
}

/* Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    color: #ffffff;
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.prev-arrow {
    left: 0;
}

.next-arrow {
    right: 0;
}

/* Progress Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.5);
}

.indicator.active {
    width: 24px;
    border-radius: 4px;
    background: #3543F0;
}

/* Phase-based indicator colors */
.indicator:nth-child(1).active,
.indicator:nth-child(2).active,
.indicator:nth-child(3).active {
    background: #3543F0;
}

.indicator:nth-child(4).active {
    background: #fbbf24;
}

.indicator:nth-child(5).active,
.indicator:nth-child(6).active,
.indicator:nth-child(7).active,
.indicator:nth-child(8).active {
    background: #ef4444;
}

/* Special card styles */
.warning-card {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

.warning-card.active {
    box-shadow: 0 20px 40px rgba(251, 191, 36, 0.2);
}

.final-card {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.final-card.active {
    box-shadow: 0 20px 40px rgba(239, 68, 68, 0.2);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .story-section {
        padding: 40px 10px;
    }
    
    .story-carousel {
        padding: 0;
        max-width: 100%;
        overflow: visible;
        position: relative;
        margin: 2rem auto;
    }
    
    .carousel-track-container {
        overflow: hidden;
        padding: 0 50px;
        width: calc(100% - 100px);
        margin: 0 auto;
        position: relative;
    }
    
    .carousel-track {
        display: flex;
        gap: 30px;
        padding: 40px 0;
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        width: fit-content;
    }
    
    .carousel-card {
        flex: 0 0 280px;
        width: 280px;
        max-width: 280px;
        min-width: 280px;
        margin: 0;
        transform: scale(0.85) translateY(30px);
        opacity: 0.5;
        border-radius: 16px;
        padding: 20px;
        box-sizing: border-box;
    }
    
    .carousel-card.active {
        transform: scale(1) translateY(0);
        opacity: 1;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }
    
    .carousel-nav {
        width: 46px;
        height: 46px;
        font-size: 20px;
        z-index: 20;
        background: rgba(255, 255, 255, 0.15) !important;
        border: 1px solid rgba(255, 255, 255, 0.25) !important;
    }
    
    .next-arrow {
        right: 5px;
    }
    
    .prev-arrow {
        left: 5px;
    }
    
    .carousel-nav .nav-text {
        display: none !important;
    }
    
    .carousel-card .event-visual {
        height: 150px;
        margin-bottom: 15px;
    }
    
    .carousel-card .event-content p {
        font-size: 1rem;
        line-height: 1.4;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .story-carousel {
        padding: 0 15px;
    }
    
    .carousel-card {
        flex: 0 0 calc(100vw - 60px);
        max-width: 280px;
        min-width: 240px;
        width: calc(100vw - 60px);
    }
    
    .carousel-track-container {
        padding: 0;
    }
    
    .carousel-nav {
        width: 40px;
        height: 40px;
    }
}

/* Very small devices */
@media (max-width: 360px) {
    .carousel-card {
        flex: 0 0 98vw; /* Use almost full viewport width */
        min-width: 240px;
        padding: 1rem;
    }
}