/* ============================================================================
   SCOOTERCAM TIMELAPSE VIDEO DISPLAY
   CSS for rolling and sunset timelapse players with poster overlays
   ============================================================================ */

/* ----------------------------------------------------------------------------
   VIDEO CONTAINER - Base styling for all timelapse videos
   ---------------------------------------------------------------------------- */

.timelapse-container {
    position: relative;
    width: 100%;
    max-width: 1440px;
    margin: 2rem auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.timelapse-video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

/* Video poster overlay - sits on top of video until play */
.video-poster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
    z-index: 2;
}

.video-poster-overlay picture,
.video-poster-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide poster when video is playing */
.timelapse-container.playing .video-poster-overlay {
    opacity: 0;
}

/* Timelapse metadata */
.timelapse-meta {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    z-index: 3;
}

/* Placeholder when no video available */
.timelapse-placeholder {
    width: 100%;
    max-width: 1440px;
    margin: 2rem auto;
    padding: 3rem 2rem;
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 8px;
    text-align: center;
}

.timelapse-placeholder p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* ----------------------------------------------------------------------------
   ROLLING TIMELAPSE - Specific styling for 4-hour rolling videos
   ---------------------------------------------------------------------------- */

.rolling-timelapse {
    /* Uses base .timelapse-container styles */
}

/* ----------------------------------------------------------------------------
   SUNSET TIMELAPSE - Specific styling for sunset videos
   ---------------------------------------------------------------------------- */

.sunset-timelapse {
    /* Uses base .timelapse-container styles */
}

.sunset-timelapse .sunset-date {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 500;
    z-index: 3;
    margin: 0;
}

/* Archive link button */
.sunset-archive-link {
    text-align: center;
    padding: 1rem 0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.3));
}

.archive-button {
    display: inline-block;
    padding: 12px 24px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.archive-button:hover {
    background: #0056b3;
    text-decoration: none;
}

/* ----------------------------------------------------------------------------
   SUNSET ARCHIVE GRID - Grid of sunset thumbnails
   ---------------------------------------------------------------------------- */

.sunset-archive {
    width: 100%;
    max-width: 1440px;
    margin: 3rem auto;
    padding: 2rem 1rem;
}

.sunset-archive h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #333;
}

.sunset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.sunset-archive-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #000;
}

.sunset-archive-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.sunset-link {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.sunset-thumb {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.sunset-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 1rem;
    color: #fff;
}

.sunset-day {
    display: block;
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 4px;
}

.sunset-date {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ----------------------------------------------------------------------------
   RESPONSIVE DESIGN - Mobile and tablet adjustments
   ---------------------------------------------------------------------------- */

/* Tablets and below */
@media (max-width: 768px) {
    .timelapse-container {
        margin: 1.5rem auto;
        border-radius: 6px;
    }
    
    .sunset-timelapse .sunset-date {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 1rem;
    }
    
    .timelapse-meta {
        bottom: 8px;
        right: 8px;
        font-size: 0.75rem;
        padding: 3px 6px;
    }
    
    .sunset-archive {
        padding: 1.5rem 0.5rem;
    }
    
    .sunset-archive h2 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .sunset-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .archive-button {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .timelapse-container {
        margin: 1rem auto;
        border-radius: 4px;
    }
    
    .sunset-timelapse .sunset-date {
        font-size: 0.9rem;
        padding: 5px 10px;
    }
    
    .timelapse-meta {
        bottom: 6px;
        right: 6px;
        font-size: 0.7rem;
    }
    
    .sunset-archive {
        padding: 1rem 0;
    }
    
    .sunset-archive h2 {
        font-size: 1.5rem;
    }
    
    .sunset-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sunset-info {
        padding: 0.75rem;
    }
    
    .sunset-day {
        font-size: 0.85rem;
    }
    
    .sunset-date {
        font-size: 1rem;
    }
}

/* ----------------------------------------------------------------------------
   ACCESSIBILITY - Screen reader and keyboard navigation
   ---------------------------------------------------------------------------- */

/* Focus states for keyboard navigation */
.archive-button:focus,
.sunset-link:focus {
    outline: 3px solid #007bff;
    outline-offset: 3px;
}

/* Ensure video controls are keyboard accessible */
.timelapse-video:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ----------------------------------------------------------------------------
   PRINT STYLES - Hide videos when printing
   ---------------------------------------------------------------------------- */

@media print {
    .timelapse-container,
    .sunset-archive {
        display: none;
    }
}

/* ----------------------------------------------------------------------------
   LOADING STATES - Show while videos are loading
   ---------------------------------------------------------------------------- */

.timelapse-video[poster] {
    background: #000;
}

/* Optional: Add a loading spinner */
.timelapse-container.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 4;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ----------------------------------------------------------------------------
   DARK MODE SUPPORT - Optional dark mode adjustments
   ---------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
    .timelapse-placeholder {
        background: #2a2a2a;
        border-color: #555;
    }
    
    .timelapse-placeholder p {
        color: #aaa;
    }
    
    .sunset-archive h2 {
        color: #e0e0e0;
    }
}