/* ==========================================================================
   LUXURY VIDEO INVITATION GENERATOR STYLING
   Multi-Religion Cultural Themes, Auto-Adjusting Typography & Mobile-First UI
   ========================================================================== */

:root {
    --gold-primary: #d4af37;
    --gold-light: #f7dfa5;
    --gold-dark: #aa820a;
    --burgundy: #851b2a;
    --burgundy-dark: #4a0e17;
    --card-bg: #ffffff;
    --studio-dark: #121318;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

.video-studio-container {
    background: #fdfaf8;
    min-height: calc(100vh - 120px);
    overflow-x: hidden;
    width: 100%;
}

.studio-header {
    background: linear-gradient(135deg, #2a0b12 0%, #150508 100%);
    color: #fdfaf8;
    padding: 2.5rem 0 2rem;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
}

.studio-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.studio-header .badge-pill {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #f7dfa5;
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding: 0.4rem 1rem;
    border-radius: 50px;
}

/* ==========================================================================
   1. MULTI-RELIGION CULTURE SELECTOR (HINDU, MUSLIM, CHRISTIAN, SIKH, MODERN)
/* ==========================================================================
   1. MULTI-RELIGION & RITUAL-BASED TEMPLATE SELECTOR
   ========================================================================== */
.template-filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 1rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.template-filter-scroll::-webkit-scrollbar {
    height: 4px;
}

.template-filter-scroll::-webkit-scrollbar-thumb {
    background: #e0d0b0;
    border-radius: 4px;
}

.template-filter-chip {
    white-space: nowrap;
    border: 1.5px solid #e2d7c8;
    background: #ffffff;
    color: #49383b;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.template-filter-chip:hover {
    border-color: var(--gold-primary);
    background: #fffcf5;
}

.template-filter-chip.active {
    background: var(--burgundy);
    color: #ffffff;
    border-color: var(--burgundy);
    box-shadow: 0 4px 12px rgba(133, 27, 42, 0.25);
}

.template-filter-chip.active .chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.chip-count {
    font-size: 0.7rem;
    background: #f0e8de;
    color: #6c5a5d;
    padding: 1px 7px;
    border-radius: 12px;
}

.ritual-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 1.5rem;
    max-height: 420px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
}

.ritual-templates-grid::-webkit-scrollbar {
    width: 6px;
}

.ritual-templates-grid::-webkit-scrollbar-thumb {
    background: #d8c7a6;
    border-radius: 4px;
}

.ritual-card {
    background: #ffffff;
    border: 2px solid #e9e2d5;
    border-radius: 16px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
    display: flex;
    flex-direction: column;
}

.ritual-card:hover {
    border-color: rgba(212, 175, 55, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
}

.ritual-card.active {
    border-color: var(--gold-primary);
    background: linear-gradient(180deg, #fffdf8 0%, #fff8eb 100%);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.28);
    transform: translateY(-2px);
}

.ritual-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.ritual-card-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.ritual-card-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ritual-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #2b1a1d;
    margin-bottom: 2px;
    line-height: 1.25;
}

.ritual-card-culture {
    font-size: 0.72rem;
    color: #937d80;
    margin-bottom: 8px;
    font-weight: 500;
}

.ritual-tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.ritual-tag-pill {
    font-size: 0.65rem;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.28);
    color: #634d0b;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 600;
}

.ritual-card.active .ritual-tag-pill {
    background: rgba(133, 27, 42, 0.08);
    border-color: rgba(133, 27, 42, 0.25);
    color: var(--burgundy);
}

.ritual-card-motifs {
    font-size: 0.68rem;
    color: #7d6b6e;
    line-height: 1.3;
    margin-top: auto;
    border-top: 1px dashed rgba(212, 175, 55, 0.25);
    padding-top: 6px;
}

.ritual-card .active-checkmark {
    display: none;
    position: absolute;
    bottom: 8px;
    right: 8px;
    color: var(--gold-dark);
    font-size: 0.9rem;
}

.ritual-card.active .active-checkmark {
    display: block;
}

/* Event Itinerary Dynamic Cards in Editor */
.itinerary-event-card {
    background: #ffffff;
    border: 1px solid #ebd9b8;
    border-left: 4px solid var(--gold-primary);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.itinerary-event-card:hover {
    border-color: var(--gold-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   2. MOBILE VIEW SWITCHER (EDIT DETAILS vs LIVE VIDEO PREVIEW)
   ========================================================================== */
.mobile-view-toggle-bar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    padding: 8px 12px;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 8px;
}

.mobile-toggle-btn {
    flex: 1;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #555;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.6rem 0.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mobile-toggle-btn.active {
    background: var(--burgundy);
    color: #ffffff;
    border-color: var(--burgundy);
    box-shadow: 0 4px 12px rgba(133, 27, 42, 0.25);
}

/* Floating Bottom Jump Pill on Mobile */
.mobile-floating-preview-pill {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9990;
    background: linear-gradient(135deg, #851b2a 0%, #aa2035 100%);
    border: 2px solid var(--gold-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 18px;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mobile-floating-preview-pill:hover, .mobile-floating-preview-pill:active {
    transform: scale(1.05);
    color: #ffffff;
}

/* Form Panel Card */
.editor-card {
    background: #ffffff;
    border-radius: 1.25rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.editor-card .card-header {
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.75rem 1rem;
}

.editor-tabs .nav-link {
    color: #6c757d;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.65rem 0.85rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.editor-tabs .nav-link:hover {
    color: var(--burgundy);
}

.editor-tabs .nav-link.active {
    color: var(--burgundy);
    background: transparent;
    border-bottom-color: var(--burgundy);
}

.preset-chip {
    cursor: pointer;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: #fffdf8;
    color: #5a3d16;
    padding: 0.45rem 0.85rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.preset-chip:hover, .preset-chip.active {
    background: var(--burgundy);
    color: #ffffff;
    border-color: var(--burgundy);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(133, 27, 42, 0.25);
}

/* Ratio Selector */
.ratio-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ratio-btn-group .btn-ratio {
    border: 1px solid #dee2e6;
    background: #fff;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #495057;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.ratio-btn-group .btn-ratio:hover {
    border-color: var(--gold-primary);
}

.ratio-btn-group .btn-ratio.active {
    background: var(--burgundy);
    color: #fff;
    border-color: var(--burgundy);
    box-shadow: 0 4px 12px rgba(133, 27, 42, 0.2);
}

/* Theme Cards */
.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    gap: 8px;
}

.theme-card-option {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #ffffff;
}

.theme-card-option .theme-swatch {
    height: 42px;
    border-radius: 8px;
    margin-bottom: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.theme-card-option.active {
    border-color: var(--burgundy);
    background: #fff8f8;
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(133, 27, 42, 0.15);
}

/* ==========================================================================
   3. RESPONSIVE PHONE MOCKUP FRAME & CANVAS VIEWPORT
   ========================================================================== */
.video-preview-sticky {
    position: sticky;
    top: 24px;
}

.phone-mockup-frame {
    background: #18191f;
    border-radius: 34px;
    padding: 12px 12px 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(212, 175, 55, 0.25);
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
    transition: max-width 0.3s ease;
}

.phone-mockup-frame.ratio-16-9 {
    max-width: 580px;
    border-radius: 24px;
    padding: 10px;
}

.phone-mockup-frame.ratio-1-1 {
    max-width: 440px;
    border-radius: 28px;
    padding: 12px;
}

.phone-top-notch {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

.notch-pill {
    width: 60px;
    height: 12px;
    background: #000000;
    border-radius: 20px;
}

.canvas-viewport {
    position: relative;
    width: 100%;
    background: #0d0e12;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    aspect-ratio: 9 / 16;
    transition: aspect-ratio 0.3s ease;
}

.phone-mockup-frame.ratio-16-9 .canvas-viewport {
    aspect-ratio: 16 / 9;
    border-radius: 16px;
}

.phone-mockup-frame.ratio-1-1 .canvas-viewport {
    aspect-ratio: 1 / 1;
    border-radius: 18px;
}

#videoCanvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Watermark & Live Tag */
.live-recording-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.68rem;
    padding: 3px 8px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 5;
    pointer-events: none;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #198754;
    box-shadow: 0 0 8px #198754;
}

.live-recording-indicator.recording .live-dot {
    background: #dc3545;
    box-shadow: 0 0 10px #dc3545;
    animation: blinkRecord 0.8s infinite alternate;
}

@keyframes blinkRecord {
    from { opacity: 1; }
    to { opacity: 0.3; }
}

.scene-indicator-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    color: #f7dfa5;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 30px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    z-index: 5;
    pointer-events: none;
}

/* Player Controls Bar */
.player-controls-container {
    background: #1e2029;
    border-radius: 16px;
    padding: 8px 12px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.scrubber-track {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

.scrubber-track::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gold-primary);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
    cursor: pointer;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: #f0f0f5;
    font-size: 0.95rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--gold-light);
}

.ctrl-btn.play-btn {
    background: var(--burgundy);
    color: #ffffff;
    width: 38px;
    height: 38px;
    box-shadow: 0 4px 12px rgba(133, 27, 42, 0.4);
}

.ctrl-btn.play-btn:hover {
    background: #a32234;
    transform: scale(1.05);
}

.time-stamp-display {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.7);
    font-family: monospace;
    font-weight: 600;
}

/* Scene Quick Jump Pills */
.scene-pills {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.scene-pill-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.scene-pill-btn:hover, .scene-pill-btn.active {
    background: rgba(212, 175, 55, 0.25);
    border-color: var(--gold-primary);
    color: #f7dfa5;
    font-weight: 600;
}

/* Export Action Buttons */
.export-card {
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 1.25rem;
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-top: 1rem;
}

.btn-generate-video {
    background: linear-gradient(135deg, #851b2a 0%, #aa2035 100%);
    border: 1px solid #d4af37;
    color: #ffffff;
    font-weight: 700;
    padding: 0.85rem 1.25rem;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(133, 27, 42, 0.35);
    transition: all 0.3s;
    width: 100%;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-generate-video:hover {
    background: linear-gradient(135deg, #a32234 0%, #c4293f 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(133, 27, 42, 0.45);
    color: #ffffff;
}

/* Modals */
.studio-modal .modal-content {
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.studio-modal .modal-header {
    background: linear-gradient(135deg, #2a0b12 0%, #150508 100%);
    color: #ffffff;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.render-progress-ring {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.render-progress-text {
    position: absolute;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--burgundy);
    font-family: 'Montserrat', sans-serif;
}

/* Itinerary item card */
.itinerary-row {
    background: #faf7f5;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    position: relative;
    transition: all 0.2s;
}

.itinerary-row:hover {
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.photo-preview-pill {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold-primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ==========================================================================
   4. MOBILE RESPONSIVE ADAPTATIONS (< 992px & < 576px)
   ========================================================================== */
@media (max-width: 991.98px) {
    .video-studio-container {
        padding-top: 1rem !important;
    }

    .video-preview-sticky {
        position: relative;
        top: 0;
        margin-bottom: 1.5rem;
    }

    .phone-mockup-frame {
        max-width: 330px;
        padding: 10px 10px 14px;
        border-radius: 28px;
    }

    /* Tab switcher hides inactive view on mobile when toggle clicked */
    .mobile-view-form.hidden-on-mobile,
    .mobile-view-preview.hidden-on-mobile {
        display: none !important;
    }

    .editor-tabs .nav-link {
        font-size: 0.78rem;
        padding: 0.5rem 0.6rem;
    }
}

@media (max-width: 575.98px) {
    .studio-header {
        padding: 1.75rem 0 1.25rem;
    }

    .phone-mockup-frame {
        max-width: min(290px, 92vw);
        border-radius: 24px;
        padding: 8px 8px 12px;
    }

    .itinerary-event-card {
        padding: 8px 10px;
    }

    .itinerary-event-card .form-control {
        font-size: 0.8rem;
    }

    .religion-selector-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .religion-card {
        padding: 8px 6px;
    }

    .religion-card .rel-icon {
        font-size: 1.5rem;
    }

    .religion-card .rel-title {
        font-size: 0.78rem;
    }

    .religion-card .rel-desc {
        display: none;
    }

    .theme-selector-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .theme-card-option {
        padding: 6px;
    }

    .theme-card-option .theme-swatch {
        height: 34px;
    }

    .time-stamp-display {
        font-size: 0.68rem;
    }

    .scene-pill-btn {
        font-size: 0.62rem;
        padding: 2px 6px;
    }
}
