:root {
    --primary: #ffffff;
    --primary-light: #f0f0f0;
    --accent: #e0e0e0;
    --bg-light: #faf8f5;
    --text-dark: #ffffff;
    --text-light: #f5f5f5;
    --border: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-image: url('/media/background.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100dvh;
    /* Dynamic viewport height */
    color: var(--text-dark);
    overflow: hidden;
    line-height: 1.6;
}



/* Welcome Message Animation */
.welcome-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(250, 248, 245, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    animation: fadeOutMessage 2.5s ease-in-out forwards;
}

.welcome-text {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    color: #5D4495;
    letter-spacing: 0.5px;
    animation: slideBottomToTop 2.5s ease-in-out forwards;
    text-align: center;
    max-width: 800px;
    line-height: 1.3;
}

@keyframes slideBottomToTop {
    0% {
        transform: translateY(100vh);
        opacity: 0;
    }

    25% {
        transform: translateY(2vh);
        opacity: 1;
    }

    75% {
        transform: translateY(-2vh);
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh);
        opacity: 0;
    }
}

@keyframes fadeOutMessage {

    0%,
    95% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* Main Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 16px;
    height: 100dvh;
    /* Dynamic viewport height - accounts for mobile browser bars */
    display: flex;
    align-items: center;
}

/* Tablet adjustments */
@media (min-width: 769px) {
    .container {
        padding: 40px 24px;
    }
}

/* Desktop adjustments */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        padding: 60px 48px;
    }
}

/* Content wrapper with blur */
.content-wrapper {
    background: rgba(250, 248, 245, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 18px 16px;
    opacity: 0;
    animation: fadeIn 0.8s ease-in 2.5s forwards;
    width: 100%;
    height: 100%;
    /* Fill container height */
    display: flex;
    flex-direction: column;
}

/* Tablet: medium padding */
@media (min-width: 769px) {
    .content-wrapper {
        padding: 24px 20px;
        border-radius: 24px;
    }
}

/* Desktop: larger padding for content wrapper */
@media (min-width: 1024px) {
    .content-wrapper {
        padding: 32px 32px;
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Header Section */
.header {
    text-align: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

/* Desktop: more spacing */
@media (min-width: 1024px) {
    .header {
        margin-bottom: 18px;
    }
}

.latest-label {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-light);
    text-transform: uppercase;
}

/* Desktop: larger label */
@media (min-width: 1024px) {
    .latest-label {
        font-size: 1rem;
        letter-spacing: 2px;
    }
}

/* Video Grid - Using Flexbox with margin fallback */
.video-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
    /* Negative margin to offset card margins */
    overflow-y: auto;
    flex: 1;
    align-content: flex-start;
    justify-content: center;
    /* Center horizontally */
}

/* Custom scrollbar */
.video-grid::-webkit-scrollbar {
    width: 6px;
}

.video-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.video-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.video-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Video Card */
.video-card {
    position: relative;
    height: calc(100% / 3 - 10px);
    /* 1/3 of container height minus margin */
    margin: 5px;
    /* 5px on all sides = 10px gap between cards */
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent; /* No blue overlay */
    -webkit-touch-callout: none; /* No callout on long press */
    user-select: none; /* Prevent text selection */
}

/* Desktop: larger border radius */
@media (min-width: 1024px) {
    .video-card {
        border-radius: 16px;
    }
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(45, 80, 22, 0.12);
}

.video-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover img {
    transform: scale(1.03);
}

.video-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-card:hover::after {
    opacity: 1;
}

.video-card::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-46%, -50%);
    font-size: 1.2rem;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.video-card:hover::before {
    opacity: 1;
}

/* Load More Button */
.load-more-section {
    text-align: center;
    margin: 12px 0 8px 0;
    flex-shrink: 0;
}

/* Desktop: slightly more spacing */
@media (min-width: 1024px) {
    .load-more-section {
        margin: 18px 0 12px 0;
    }
}

.load-more-btn {
    padding: 12px 28px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s ease;
}

/* Desktop: larger button */
@media (min-width: 1024px) {
    .load-more-btn {
        padding: 14px 36px;
        font-size: 0.9375rem;
    }
}

.load-more-btn:hover {
    background: white;
    color: #2c2c2c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Footer */
.footer {
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.65rem;
    line-height: 1.4;
    flex-shrink: 0;
}

.footer p {
    margin: 0;
}

/* Desktop: slightly larger footer text */
@media (min-width: 1024px) {
    .footer {
        font-size: 0.75rem;
        padding-top: 12px;
        line-height: 1.6;
    }

    .footer p {
        margin: 1px 0;
    }
}

/* Date Time Picker Modal */
.datetime-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 44, 44, 0.5);
    backdrop-filter: blur(8px);
    z-index: 900;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.datetime-modal.active {
    display: flex;
}

.datetime-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.datetime-content h2 {
    color: #2c2c2c;
    margin-bottom: 28px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.datetime-inputs {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.datetime-inputs label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #2c2c2c;
    margin-bottom: 6px;
    display: block;
}

.datetime-inputs input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e8e4df;
    background: #faf8f5;
    color: #2c2c2c;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.datetime-inputs select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e8e4df;
    background: #faf8f5;
    color: #2c2c2c;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.datetime-inputs input:focus,
.datetime-inputs select:focus {
    outline: none;
    border-color: #2c2c2c;
    background: white;
}

.datetime-buttons {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.datetime-buttons button {
    flex: 1;
    padding: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    border: 1.5px solid;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-confirm {
    background: #2c2c2c;
    border-color: #2c2c2c;
    color: white;
}

.btn-confirm:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 44, 44, 0.3);
}

.btn-cancel {
    background: transparent;
    border-color: #e8e4df;
    color: #2c2c2c;
}

.btn-cancel:hover {
    border-color: #2c2c2c;
    background: #faf8f5;
}

/* Video Overlay Modal */
.video-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 44, 44, 0.95);
    backdrop-filter: blur(12px);
    z-index: 950;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.video-overlay.active {
    display: flex;
}

.video-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.video-player {
    width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.video-controls {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.back-btn {
    background: #d4d4d4;
    border: none;
    color: #4a4a4a;
    padding: 14px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: #c0c0c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.download-btn {
    background: #a8d5a3;
    border: none;
    color: #2d5016;
    padding: 14px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: #95c98f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 213, 163, 0.4);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: white;
    font-size: 0.9375rem;
    font-weight: 600;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: white;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    opacity: 0.5;
    margin-bottom: 16px;
    stroke: white;
}