:root {
    --primary-color: #0b5ed7;
    --secondary-color: #fca5a5;
    --text-color: #111827;
    --text-muted: #4b5563;
    --bg-light: #f3f4f6;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Encode Sans', sans-serif;
    color: var(--text-color);
    background-color: transparent;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Wrapper */
#interactive-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-image: url('bg.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    padding-bottom: 3rem;
    overflow-x: hidden;
}

/* Header */
.main-header {
    background: transparent;
    padding: 2.5rem 1rem 1.5rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    line-height: 1.2;
}

/* Date subtitle styling */
.date-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}

.sapo {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
    text-align: justify;
    text-align-last: center;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

/* Timeline Wrapper for arrows */
.timeline-wrapper {
    position: relative;
    max-width: 95%;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

/* Nav Buttons */
.nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nav-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.nav-btn.prev {
    margin-right: 15px;
}

.nav-btn.next {
    margin-left: 15px;
}

/* Timeline Container - Horizontal Scroll */
.timeline-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0.5rem 2rem;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    align-items: stretch;
    /* Stretch items to have same height */

    /* Hide Scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

/* Hide Scrollbar Chrome/Safari/Opera */
.timeline-container::-webkit-scrollbar {
    display: none;
}

/* Card Styles - Resized ~50% */
.card {
    flex: 0 0 auto;
    width: 250px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}

.card.hidden-item {
    display: none;
}

.card-inner {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
    flex: 1;
    height: auto;
}

.card-inner:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    position: relative;
    width: 100%;
    height: 130px;
    overflow: hidden;
    flex-shrink: 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.card-inner:hover .card-image img {
    transform: scale(1.08);
}

.badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.75rem;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

h2 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: var(--text-color);
    line-height: 1.3;
}

.tagline {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

.summary {
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    color: #374151;
    line-height: 1.5;
}

/* More Detail Section */
.more-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease;
    opacity: 0;
    font-size: 0.85rem;
}

.more-content.open {
    opacity: 1;
    padding-bottom: 0.8rem;
}

/* Actions */
.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.8rem;
}

.btn-toggle {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.btn-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.btn-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.btn-link:hover {
    color: var(--primary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-muted);
    font-size: 0.85rem;
    position: relative;
    z-index: 10;
}

/* Responsive */
@media (max-width: 640px) {
    .nav-btn {
        display: none;
    }

    .timeline-wrapper {
        max-width: 100%;
        padding: 0;
    }

    .timeline-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .card {
        width: 260px;
    }

    .header-content {
        padding: 1.2rem;
    }

    h1 {
        font-size: 1.5rem;
    }
}