:root {
    --primary-warmth: #8B6B47;
    --secondary-warmth: #A0845C;
    --soft-gold: #D4AF37;
    --gentle-cream: #FEF9F3;
    --warm-white: #FDFBF7;
    --soft-gray: #6B7280;
    --light-gray: #F3F4F6;
    --success-green: #10B981;
    --error-red: #EF4444;
    --shadow-soft: 0 4px 20px rgba(139, 107, 71, 0.15);
    --shadow-gentle: 0 2px 10px rgba(139, 107, 71, 0.1);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ensure all videos respect container boundaries */
video {
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--gentle-cream) 0%, var(--warm-white) 100%);
    color: #374151;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--warm-white);
    border-bottom: 1px solid #E5E7EB;
    padding: 1rem 0;
    box-shadow: var(--shadow-gentle);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-warmth);
    text-decoration: none;
}

.logo-image {
    height: 40px;
    width: 40px;
    object-fit: contain;
}

.logo-text {
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--soft-gray);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-warmth);
}

.user-section {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.desktop-only {
    display: inline-block;
}

.credits-display {
    background: var(--light-gray);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    color: var(--primary-warmth);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary-warmth);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-warmth);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-warmth);
    border: 2px solid var(--primary-warmth);
}

.btn-secondary:hover {
    background: var(--primary-warmth);
    color: white;
}

/* Hero Section */
.hero {
    padding: 4rem 0 0 0;
    text-align: center;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--primary-warmth);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--soft-gray);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Upload Section */
.upload-section {
    background: var(--warm-white);
    border-radius: var(--border-radius);
    padding: 3rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-soft);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.upload-area {
    border: 3px dashed #D1D5DB;
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--gentle-cream);
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 2rem;
}

.upload-area:hover {
    border-color: var(--primary-warmth);
    background: var(--warm-white);
}

.upload-area.drag-over {
    border-color: var(--primary-warmth);
    background: var(--warm-white);
}

.upload-icon {
    font-size: 3rem;
    color: var(--soft-gray);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.1rem;
    color: var(--soft-gray);
    margin-bottom: 0.5rem;
}

.upload-subtext {
    font-size: 0.9rem;
    color: #9CA3AF;
}

.file-input {
    display: none;
}

.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--border-radius-sm);
    margin: 1rem auto;
    box-shadow: var(--shadow-gentle);
    display: block;
}

.prompt-section {
    margin: 2rem 0;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--primary-warmth);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #E5E7EB;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-warmth);
    box-shadow: 0 0 0 3px rgba(139, 107, 71, 0.1);
}

.form-help {
    font-size: 0.85rem;
    color: #9CA3AF;
    margin-top: 0.5rem;
}

/* Progress Section */
.progress-section {
    background: var(--warm-white);
    border-radius: var(--border-radius);
    padding: 3rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-soft);
    display: none;
}

.progress-header {
    text-align: center;
    margin-bottom: 2rem;
}

.progress-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--primary-warmth);
    margin-bottom: 0.5rem;
}

.progress-subtitle {
    color: var(--soft-gray);
}

.progress-ring-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.progress-ring {
    width: 120px;
    height: 120px;
    position: relative;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: #E5E7EB;
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--primary-warmth);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-warmth);
}

.progress-message {
    text-align: center;
    font-size: 1.1rem;
    color: var(--soft-gray);
    margin: 1rem 0;
    min-height: 1.5rem;
}

.progress-stages {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.stage {
    flex: 1;
    text-align: center;
    min-width: 120px;
}

.stage-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    transition: var(--transition);
    font-size: 1.2rem;
}

.stage.active .stage-icon {
    background: var(--primary-warmth);
    color: white;
    transform: scale(1.1);
}

.stage.completed .stage-icon {
    background: var(--success-green);
    color: white;
}

.stage-label {
    font-size: 0.85rem;
    color: var(--soft-gray);
}

.stage.active .stage-label {
    color: var(--primary-warmth);
    font-weight: 500;
}

/* Examples Gallery */
.examples-section {
    padding: 0 0 2rem 0;
    background: var(--gentle-cream);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--primary-warmth);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--soft-gray);
    max-width: 600px;
    margin: 0 auto;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    align-items: stretch;
}

.example-card {
    background: var(--warm-white);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(139, 107, 71, 0.2);
}

.example-before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.example-media-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.example-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    background: var(--warm-white);
    flex-shrink: 0;
}

.example-video {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    background: var(--warm-white);
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.lazy-video {
    background-size: cover;
    background-position: center;
}

.lazy-video:not([data-loaded]) {
    opacity: 0.95;
}

.example-label {
    text-align: center;
    font-size: 0.9rem;
    color: var(--soft-gray);
    font-weight: 500;
}

.example-description {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(139, 107, 71, 0.1);
    margin-top: auto;
}

.example-description p {
    font-size: 0.95rem;
    color: var(--soft-gray);
    font-style: italic;
    line-height: 1.5;
    margin: 0;
}

/* Clickable Examples */
.example-before-after > div {
    position: relative;
}

.clickable {
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.clickable:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-soft);
}

.clickable::after {
    content: '🔍';
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0;
    transition: var(--transition);
}

.clickable:hover::after {
    opacity: 1;
}

.clickable[data-modal-trigger="video"]::after {
    content: '▶️';
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10000;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-media {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-media video {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* Results Section */
.results-section {
    text-align: center;
    display: none;
    margin-top: 2rem;
}

.results-header {
    margin-bottom: 2rem;
}

.results-title {
    font-size: 2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.result-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-item:hover:not(.placeholder) {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.result-item video {
    width: 100%;
    height: auto;
    display: block;
}

.result-item p {
    padding: 1rem;
    margin: 0;
    font-weight: 500;
    color: #4b5563;
}

.result-item.placeholder {
    background-color: #f9fafb;
    border: 2px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.result-item.placeholder .video-placeholder {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

.result-item.placeholder .spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 1rem;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.result-item.placeholder p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
    padding: 0;
}

/* Footer */
.footer {
    background: var(--primary-warmth);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 1rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-link:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 1024px) and (min-width: 769px) {
    .logo-image {
        height: 36px;
        width: 36px;
    }
    
    .logo {
        font-size: 1.6rem;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.75rem 0;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        font-size: 1.5rem;
        gap: 0;
    }
    
    .logo-image {
        height: 36px;
        width: 36px;
    }
    
    .logo-text {
        display: none;
    }

    .nav-menu {
        display: none;
    }

    .desktop-only {
        display: none;
    }

    .user-section {
        flex-direction: row;
        gap: 0.75rem;
        align-items: center;
    }

    .hero {
        padding: 2rem 0 0 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .upload-section {
        padding: 2rem;
        margin: 1rem;
    }

    .progress-section {
        padding: 2rem;
        margin: 1rem;
    }

    .progress-stages {
        flex-direction: column;
        align-items: center;
    }

    .stage {
        margin-bottom: 1rem;
    }

    .examples-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: .5rem;
    }

    .example-card {
        padding: .75rem;
    }

    .example-before-after {
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .example-image,
    .example-video {
        height: 180px;
    }

    .example-description {
        padding-top: 0.75rem;
    }

    .results-section {
        margin: 1rem;
        padding: 0 1rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 1rem;
    }

    .result-item {
        margin: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .result-item video {
        max-width: 100%;
        height: auto;
    }

    .result-item .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    /* Lightbox mobile adjustments */
    .lightbox-content {
        padding: 1rem;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox-media {
        max-width: 95%;
        max-height: 95%;
    }

    /* Gallery modal mobile adjustments */
    .modal-content {
        margin: 2% auto;
        padding: 1.5rem;
        width: 95%;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        max-height: 70vh;
    }

    .job-videos {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .job-videos video {
        max-width: 100%;
        height: auto;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .results-section {
        margin: 0.5rem;
        padding: 0 0.5rem;
    }

    .upload-section {
        margin: 0.5rem;
        padding: 1.5rem;
    }

    .progress-section {
        margin: 0.5rem;
        padding: 1.5rem;
    }

    .modal-content {
        width: 98%;
        padding: 1rem;
    }

    .results-grid {
        gap: 1rem;
    }

    .result-item .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--warm-white);
    border: 1px solid #E5E7EB;
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-soft);
    z-index: 1001;
    transform: translateX(400px);
    transition: var(--transition);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success-green);
}

.toast.error {
    border-left: 4px solid var(--error-red);
}

/* Authentication Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #aaa;
    font-size: 1.5rem;
    font-weight: bold;
    border: none;
    background: none;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: #333;
}

#modalTitle {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

#modalSubtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.error-message {
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
}

.auth-toggle {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.auth-toggle a {
    color: #4f46e5;
    font-weight: 500;
    text-decoration: none;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

/* Account Modal Specifics */
.account-details {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: #6b7280;
}

.detail-value {
    font-weight: 500;
    color: #374151;
}

.detail-value-prominent {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4f46e5;
}

.purchase-section {
    text-align: center;
    margin-bottom: 2rem;
}

.purchase-section h3 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.5rem;
}

.purchase-section p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.credit-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.credit-btn {
    width: 100%;
}

.stripe-info {
    font-size: 0.8rem;
    color: #9ca3af;
}

.account-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
}

.account-actions a {
    color: #4f46e5;
    font-weight: 500;
    text-decoration: none;
}

.account-actions a:hover {
    text-decoration: underline;
}

/* Gallery Modal */
.modal-lg {
    max-width: 800px;
}

.retention-notice {
    text-align: center;
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    background-color: #f3f4f6;
    padding: 0.75rem;
    border-radius: 8px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem;
}

.job-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.job-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.job-info {
    padding: 1rem;
    flex-grow: 1;
}

.job-info h4 {
    margin: 0 0 0.5rem;
}

.job-info p {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.job-videos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.job-videos video {
    width: 100%;
    border-radius: 4px;
}

.job-status-overlay {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progressive Video Display Styles */
#progressive-videos-container {
    margin: 2rem 0;
    padding: 2rem;
    background-color: #f9fafb;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

#progressive-videos-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #1f2937;
    font-size: 1.5rem;
}

.progress-message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #dbeafe;
    border-radius: 8px;
    color: #1e40af;
    font-weight: 500;
    text-align: center;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.video-item {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-item:hover:not(.placeholder) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.video-item video {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.video-item p {
    margin: 0.5rem 0 0;
    text-align: center;
    color: #4b5563;
    font-weight: 500;
}

.video-item.placeholder {
    background-color: #f3f4f6;
    border: 2px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.video-placeholder {
    text-align: center;
    color: #6b7280;
}

.video-placeholder .spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 1rem;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.video-placeholder p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    #progressive-videos-container {
        padding: 1rem;
        margin: 1rem;
        box-sizing: border-box;
    }

    .video-item {
        padding: 0.75rem;
    }

    .video-item video {
        max-width: 100%;
        height: auto;
    }
}