/* Modal / Lightbox shared styles (extracted from index.php and alle-bauwerke.php) */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 888;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.lightbox-overlay.timeline-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: inherit;
    background-size: inherit;
    background-position: inherit;
    background-repeat: inherit;
    opacity: 0.04;
    filter: blur(3px);
    z-index: -1;
}

.lightbox-overlay.timeline-background {
    background: rgba(0, 0, 0, 0.85);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    max-height: 800px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateZ(0) scale(0.8);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

/* Desktop Layout */
@media (min-width: 769px) {
    .lightbox-container {
        flex-direction: row !important;
    }
}

.lightbox-overlay.active .lightbox-container {
    transform: translateZ(0) scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10001;
    font-weight: bold;
}

.lightbox-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateZ(0) rotate(90deg);
}

.modal-info-panel {
    flex: 0 0 400px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6));
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-image-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    min-width: 0;
    min-height: 0;
}

.modal-title {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.modal-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-description {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.modal-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px;
    text-align: center;
    transition: all 0.2s ease;
}

.modal-stat:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateZ(0) translateY(-2px);
}

.modal-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #06b6d4;
    display: block;
}

.modal-stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.modal-tag {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.modal-coordinates {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 16px;
    color: #10b981;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    text-align: center;
}

.modal-image-main {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

/* Per-image loader overlay */
.image-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    z-index: 2;
}

.modal-thumbnails {
    display: flex;
    gap: 12px;
    padding: 20px;
    justify-content: flex-start;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.1);
    min-width: 0;
    flex-shrink: 0;
}

.modal-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.modal-thumbnails::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.modal-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.modal-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.modal-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.6;
    scroll-snap-align: center;
    position: relative;
}

.modal-thumbnail:hover {
    opacity: 0.8;
    transform: translateZ(0) translateY(-2px);
}

.modal-thumbnail.active {
    border-color: #06b6d4;
    opacity: 1;
}

.modal-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(59, 130, 246, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backface-visibility: hidden;
    will-change: transform;
}

.modal-nav:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 1), rgba(59, 130, 246, 1));
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateZ(0) translateY(-50%) scale(1.1);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.4);
}

.modal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.modal-nav.prev {
    left: 20px;
}

.modal-nav.next {
    right: 20px;
}

.modal-nav.prev::before {
    content: '‹';
    font-size: 28px;
    line-height: 1;
}

.modal-nav.next::before {
    content: '›';
    font-size: 28px;
    line-height: 1;
}

.modal-image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: white;
    font-size: 1.1rem;
    z-index: 10002;
}

.modal-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #06b6d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.modal-content {
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.modal-content.loaded {
    opacity: 1;
}

@media (max-width: 768px) {
    .lightbox-overlay {
        padding: 10px !important;
    }

    .lightbox-container {
        flex-direction: column !important;
        height: 95vh !important;
        max-height: none !important;
        width: 100% !important;
        border-radius: 15px !important;
        display: flex !important;
    }

    .modal-info-panel {
        flex: 0 0 35vh !important;
        max-height: 35vh !important;
        padding: 20px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        overflow-y: auto !important;
        order: 1 !important;
        width: 100% !important;
    }

    .modal-image-panel {
        flex: 1 !important;
        min-height: 55vh !important;
        order: 2 !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    .modal-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-top: 15px !important;
        margin-bottom: 15px !important;
    }

    .modal-title {
        font-size: 1.3rem !important;
        line-height: 1.3 !important;
        margin-bottom: 6px !important;
    }

    .modal-subtitle {
        font-size: 0.85rem !important;
        margin-bottom: 12px !important;
    }

    .modal-description {
        font-size: 0.85rem !important;
        padding: 12px !important;
        min-height: 8vh;
        overflow-y: auto !important;
        margin-bottom: 0px !important;
    }

    .lightbox-close {
        top: 15px !important;
        right: 15px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }

    .modal-main-image {
        height: 75% !important;
        min-height: 200px !important;
    }

    .modal-thumbnails {
        height: 25% !important;
        min-height: 70px !important;
        padding: 8px 15px !important;
        gap: 6px !important;
        overflow-x: auto !important;
        display: flex !important;
        align-items: center !important;
    }

    .modal-thumbnail {
        width: 50px !important;
        height: 38px !important;
        min-width: 50px !important;
        flex-shrink: 0 !important;
        border-radius: 6px !important;
    }

    .modal-stat {
        text-align: center !important;
    }

    .modal-stat-value {
        font-size: 0.9rem !important;
    }

    .modal-stat-label {
        font-size: 0.75rem !important;
    }

    .modal-content {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .lightbox-container {
        padding: 10px;
        border-radius: 15px;
    }

    .modal-info-panel {
        padding: 15px;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-thumbnails {
        padding: 15px 10px;
        gap: 8px;
    }

    .modal-thumbnail {
        width: 60px;
        height: 45px;
        border-radius: 6px;
    }
}

@media (max-width: 768px) {
    .modal-thumbnails {
        padding: 15px;
        gap: 10px;
    }

    .modal-thumbnail {
        width: 70px;
        height: 52px;
    }
}

/* Build Card Slider small pieces kept because they were included with modal in the PHP files */
.build-card .swiper-button-next,
.build-card .swiper-button-prev {
    width: 35px;
    height: 35px;
    margin-top: -17px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(59, 130, 246, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backface-visibility: hidden;
    will-change: transform;
}

.build-card .swiper-button-next:after,
.build-card .swiper-button-prev:after {
    font-size: 16px;
    font-weight: bold;
}

.build-card:hover .swiper-button-next,
.build-card:hover .swiper-button-prev {
    opacity: 1;
    transform: translateZ(0) translateY(-2px);
    background: linear-gradient(135deg, rgba(139, 92, 246, 1), rgba(59, 130, 246, 1));
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.4);
}

.build-card .swiper-pagination {
    bottom: 8px;
}

.build-card .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    width: 6px;
    height: 6px;
}

.build-card .swiper-pagination-bullet-active {
    background: white;
}

/* Filter Styles */
.filter-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    backdrop-filter: blur(20px);
}

/* ============================================
   TIMELINE EVENT MODAL - BEAUTIFUL REDESIGN
   ============================================ */

/* Overlay */
.timeline-event-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(0px);
}

.timeline-event-overlay.active {
    visibility: visible;
    opacity: 1;
    backdrop-filter: blur(8px);
}

/* Backdrop */
.timeline-event-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(15, 23, 42, 0.95) 0%,
            rgba(30, 41, 59, 0.9) 50%,
            rgba(15, 23, 42, 0.95) 100%);
}

.timeline-event-container {
    position: relative;
    width: 90vw;
    max-width: 1200px;
    height: 85vh;
    max-height: 800px;
    min-height: 600px;
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
    border-radius: 20px;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid #202c4b;
}

.timeline-event-overlay.active .timeline-event-container {
    transform: scale(1) translateY(0);
}

/* Close Button */
.timeline-event-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.timeline-event-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: scale(1.1);
}

.timeline-event-close svg {
    width: 18px;
    height: 18px;
}

/* Loading State */
.timeline-event-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
    border-radius: 20px;
    z-index: 5;
}

.timeline-loading-spinner {
    width: 50px;
    height: 50px;
    margin-bottom: 16px;
}

.timeline-spinner-ring {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(52, 211, 153, 0.2);
    border-top: 3px solid #34d399;
    border-radius: 50%;
    animation: timeline-spin 0.8s linear infinite;
}

@keyframes timeline-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.timeline-loading-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    font-weight: 500;
}

/* Content Layout */
.timeline-event-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header Section */
.timeline-event-header {
    flex-shrink: 0;
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(52, 211, 153, 0.15);
}

.timeline-event-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #10b981 0%, #06d6a0 100%);
    color: white;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.timeline-badge-icon {
    font-size: 14px;
}

.timeline-event-title {
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin: 0 0 12px 0;
    line-height: 1.1;
    background: linear-gradient(135deg, #34d399, #06d6a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline-event-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.timeline-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
}

.timeline-meta-icon {
    font-size: 14px;
}

.timeline-content-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    min-height: 0;
    overflow: hidden;
}

/* Gallery Section - FIXED DIMENSIONS */
.timeline-gallery-section {
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(52, 211, 153, 0.15);
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.2) 0%, rgba(15, 23, 42, 0.3) 100%);
    min-height: 0;
    overflow: hidden;
}

.timeline-gallery-main {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 0;
    overflow: hidden;
}

.timeline-empty-state {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
}

.timeline-empty-icon {
    font-size: 42px;
    line-height: 1;
}

.timeline-empty-title {
    font-weight: 800;
    font-size: 18px;
    background: linear-gradient(135deg, #34d399, #06d6a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline-empty-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.timeline-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.timeline-main-media {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-main-media video,
.timeline-image-container video,
.timeline-main-video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.timeline-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-main-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Image Navigation Overlay */
.timeline-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.1) 0%,
            transparent 25%,
            transparent 75%,
            rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
    /* Lässt Klicks durch zum Bild */
}

.timeline-image-container:hover .timeline-image-overlay {
    opacity: 1;
}

.timeline-nav-button {
    width: 44px;
    height: 44px;
    background: rgba(52, 211, 153, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    /* Buttons bleiben klickbar */
}

.timeline-nav-button:hover {
    background: rgba(52, 211, 153, 1);
    transform: scale(1.05);
}

.timeline-nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.timeline-nav-button svg {
    width: 18px;
    height: 18px;
}

/* Image Counter */
.timeline-image-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(52, 211, 153, 0.3);
    backdrop-filter: blur(10px);
}

/* Thumbnails - FIXED HEIGHT */
.timeline-thumbnails-container {
    flex-shrink: 0;
    height: 90px;
    padding: 15px 20px;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(52, 211, 153, 0.1);
}

.timeline-thumbnails-grid {
    display: flex;
    gap: 8px;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(52, 211, 153, 0.5) transparent;
    white-space: nowrap;
}

.timeline-thumbnails-grid::-webkit-scrollbar {
    height: 4px;
}

.timeline-thumbnails-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.timeline-thumbnails-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #10b981, #06d6a0);
    border-radius: 2px;
}

.timeline-thumbnail {
    flex-shrink: 0;
    width: 70px;
    height: 55px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.7;
    position: relative;
    /* Ensure overlays (e.g., play badge) are positioned correctly */
}

.timeline-thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.timeline-thumbnail.active {
    border-color: #34d399;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.3);
}

.timeline-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* Description Section */
.timeline-description-section {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: rgba(15, 23, 42, 0.2);
    overflow-y: auto;
}

.timeline-description-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(52, 211, 153, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    height: fit-content;
}

.timeline-description-title {
    font-size: 18px;
    font-weight: 700;
    color: #34d399;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-description-title::before {
    content: "📝";
    font-size: 20px;
}

.timeline-description-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 14px;
}

/* Footer Navigation */
.timeline-navigation-footer {
    flex-shrink: 0;
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid rgba(52, 211, 153, 0.15);
}

.timeline-event-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.timeline-nav-btn {
    background: linear-gradient(135deg, #147757 0%, #045943 100%);
    border: 1px solid rgb(0 71 1 / 20%);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgb(14 128 90 / 30%);
}

.timeline-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.timeline-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.timeline-nav-info {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 13px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .timeline-content-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .timeline-gallery-section {
        border-right: none;
        border-bottom: 1px solid rgba(52, 211, 153, 0.15);
    }

    .timeline-description-section {
        max-height: 150px;
    }
}

@media (max-width: 768px) {
    .timeline-event-container {
        width: 95vw;
        height: 90vh;
        min-height: 500px;
    }

    .timeline-event-header {
        padding: 20px 20px 16px;
    }

    .timeline-event-title {
        font-size: 24px;
    }

    .timeline-gallery-main {
        min-height: 0;
        padding: 16px;
    }

    .timeline-description-section {
        padding: 16px;
        max-height: 120px;
    }

    .timeline-navigation-footer {
        padding: 12px 20px;
    }

    .timeline-event-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .timeline-nav-info {
        order: -1;
    }

    .timeline-nav-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .timeline-event-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        min-height: 100vh;
    }

    .timeline-event-header {
        padding: 16px;
    }

    .timeline-event-title {
        font-size: 20px;
    }

    .timeline-gallery-main {
        min-height: 0;
        padding: 12px;
    }

    .timeline-thumbnails-container {
        height: 80px;
        padding: 12px 16px;
    }

    .timeline-thumbnail {
        width: 60px;
        height: 45px;
    }
}

/* ============================================
   FULLSCREEN IMAGE VIEWER
   ============================================ */

.image-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(15px);
    padding: 60px 20px 20px 20px;
    box-sizing: border-box;
}

.image-fullscreen-overlay.active {
    visibility: visible;
    opacity: 1;
}

.image-fullscreen-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    cursor: pointer;
}

.image-fullscreen-container {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.image-fullscreen-close {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    width: 50px;
    height: 50px;
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 15px;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
}

.image-fullscreen-close:hover {
    background: rgba(239, 68, 68, 0.4);
    border-color: #ef4444;
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.image-fullscreen-close svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

.image-fullscreen-img {
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 80px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9);
    transform: scale(0.96);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
}

.image-fullscreen-overlay.active .image-fullscreen-img {
    transform: scale(1);
}

@media (max-width: 768px) {
    .image-fullscreen-overlay {
        padding: 70px 15px 15px 15px;
    }

    .image-fullscreen-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        border-radius: 12px;
    }

    .image-fullscreen-close svg {
        width: 20px;
        height: 20px;
    }

    .image-fullscreen-img {
        max-width: calc(100vw - 30px);
        max-height: calc(100vh - 100px);
        border-radius: 8px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    }
}

.filter-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.9rem;
}

.filter-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.filter-button.active {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border-color: transparent;
    color: white;
}