@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,500;1,500&display=swap');

:root {
    --bg-gradient: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --accent: #c084fc;
    --accent-hover: #a855f7;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-blur: blur(16px);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(-45deg, #0f172a, #130f40, #312e81, #020617);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 
  The core container acts like a high-end mobile app screen.
  This contains the UI elements so they don't stretch awkwardly on desktop.
*/
.experience-container {
    position: relative;
    height: 95vh; /* slightly less than 100vh so it floats like a phone screen */
    aspect-ratio: 9 / 16; /* This mathematically locks it to the video's exact portrait ratio! */
    max-width: 100vw;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 36px;
    border: 1px solid rgba(255, 255, 255, 0.08); /* subtle high-end glass border */
    box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 40px rgba(139, 92, 246, 0.2);
    overflow: hidden;
    transform: translateZ(0); /* forces hardware acceleration for smooth rounded corners on video */
}

/* 
  Video layers for smooth crossfading
*/
#video-player, .video-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
    background-color: #050505;
    transition: opacity 0.6s ease;
    z-index: 1;
}

/* Beautiful Loading Spinner */
.loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loader-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* -------------------------
   Top Controls (Language)
-------------------------- */
.top-controls {
    position: absolute;
    top: 30px;
    right: 25px;
    z-index: 100;
    display: flex;
    gap: 4px;
    background: rgba(15, 23, 42, 0.65); /* Rich dark navy glass ensures text is readable over bright skies */
    padding: 5px;
    border-radius: 40px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.2); /* Clearer border */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.lang-btn {
    background: transparent;
    border: none;
    color: #cbd5e1; /* Brighter inactive text */
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-btn.active {
    background: #ffffff; /* Pure white focus block */
    color: #020617; /* Deep black text for sharp contrast */
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* -------------------------
   Overlays & Screen States
-------------------------- */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* The Start Screen */
.overlay.start-screen {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(2, 6, 23, 0.95) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 40px;
    text-align: center;
}

.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transform: translateY(20px);
    transition: transform 0.6s ease;
}

.overlay.visible .welcome-content {
    transform: translateY(0);
}

.dora-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 500;
    color: white;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.dora-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.5;
    margin-bottom: 30px;
    max-width: 80%;
}

.start-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 40px;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(192, 132, 252, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Outfit', sans-serif;
    position: relative;
    overflow: hidden;
}

.start-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
    border-radius: 40px;
    opacity: 0;
    transition: opacity 0.3s;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(192, 132, 252, 0.5);
    background: var(--accent-hover);
}
.start-btn:hover::after {
    opacity: 1;
}

/* Choices Overlay */
.overlay.options-screen {
    justify-content: flex-end; /* Push options to bottom */
    padding-bottom: 50px;
    padding-left: 24px;
    padding-right: 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 40%, rgba(0,0,0,0) 100%);
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

/* The Professional Buttons */
.option-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 18px 24px;
    border-radius: 20px;
    font-size: 1.05rem;
    font-weight: 400;
    cursor: pointer;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.3px;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.5s forwards;
}

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px) scale(1.01);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* End Screen CTAs */
.option-btn.primary-cta {
    background: rgba(192, 132, 252, 0.9);
    border-color: #c084fc;
    font-weight: 500;
}
.option-btn.primary-cta:hover {
    background: #a855f7;
    border-color: #a855f7;
}

.hidden {
    display: none !important;
}

/* =========================================
   Mobile Responsiveness
   Forces true edge-to-edge full screen on phones
========================================= */
@media (max-width: 768px), (max-aspect-ratio: 9/16) {
    .experience-container {
        height: 100vh;
        height: 100dvh; /* Adapts to iOS/Android dynamic browser bars! */
        aspect-ratio: auto;
        width: 100%;
        max-width: 100vw;
        border-radius: 0; /* Removing the curved desktop frame */
        border: none;
        box-shadow: none;
    }

    .dora-title {
        font-size: 2rem; /* Slightly scale down for smaller screens */
    }

    .dora-subtitle {
        font-size: 0.95rem;
        max-width: 95%;
        margin-bottom: 20px;
    }

    .start-btn {
        padding: 14px 30px;
        font-size: 1rem;
    }

    .top-controls {
        top: 15px;
        right: 15px;
    }

    .overlay.options-screen {
        padding-bottom: 30px; /* Bring options slightly up for easy thumb access */
        padding-left: 15px;
        padding-right: 15px;
    }

    .option-btn {
        padding: 16px 20px;
        font-size: 1rem;
    }
}
