/* CSS Variables for Branding */
:root {
    --color-cream: #FDFCF0;
    --color-sand: #D7C4A5;
    --color-earth-brown: #8B5E3C;
    --color-dark-brown: #3E2723;
    --color-olive-green: #6a7c36; /* Based on the wireframe right button */
    
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-smooth: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Reset & Basic Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: var(--font-body);
    background-color: var(--color-dark-brown);
    color: var(--color-cream);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    min-width: 200px;
    flex: 1;
    max-width: 260px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    transition: var(--transition-smooth);
    cursor: pointer;
    text-align: center;
    border: none;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Button Variants from Wireframe */
#btn-poveste {
    background: linear-gradient(135deg, #FDFCF0, #E6D0A9);
    color: var(--color-earth-brown);
}

#btn-meniu {
    background: linear-gradient(to bottom, rgba(160, 82, 45, 0.6), rgba(80, 40, 20, 0.8));
    color: var(--color-cream);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#btn-specialitati {
    background: linear-gradient(135deg, #7c8e41, var(--color-olive-green));
    color: var(--color-cream);
}

.btn-primary {
    background-color: var(--color-earth-brown);
    color: var(--color-cream);
}

.btn-primary:hover {
    background-color: #70472c;
}

.btn-large {
    padding: 16px 48px;
    font-size: 1.2rem;
    flex: none;
    max-width: none;
}

/* Scroll Animations */
.scroll-anim {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.scroll-anim.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Section Layouts */
.section {
    position: relative;
    width: 94vw;
    max-width: 1400px;
    height: 100vh; /* Full viewport height for each section */
    min-height: 600px;
    margin: 0 auto 80px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05); /* Soft premium border */
}

.section:last-of-type {
    margin-bottom: 40px; /* Balance spacing at the very bottom of the page */
}

.section-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
    max-width: 1000px;
}

.section-title {
    font-size: 4rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

/* --- HERO SECTION --- */
#hero {
    flex-direction: column;
    margin-top: 40px; /* Spacing at the top of the site */
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('elvi_website_media/Landing page_image.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient mimicking the wireframe: clear in center, misty/brownish at bottom and top */
    background: radial-gradient(circle at center, rgba(0,0,0,0.1) 0%, rgba(139, 94, 60, 0.3) 70%, rgba(62, 39, 35, 0.7) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    justify-content: space-between;
    padding: 40px 20px;
}

#hero-logo {
    width: 250px;
    height: auto;
    margin-top: 2vh;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.hero-title {
    font-size: 5rem;
    font-style: italic;
    margin-top: auto; /* Push title to middle */
    text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.6);
    letter-spacing: 2px;
}

.hero-copy {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: auto; /* Keep distance from bottom */
    margin-top: 10px;
    text-shadow: 1px 2px 5px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

.hero-buttons {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2vh;
    gap: 20px;
}

/* Animations Classes */
.hidden-top { opacity: 0; transform: translateY(-50px); }
.hidden-bottom { opacity: 0; transform: translateY(50px); }
.hidden-left { opacity: 0; transform: translateX(-50px); }
.hidden-right { opacity: 0; transform: translateX(50px); }

.animate-in {
    opacity: 1 !important;
    transform: translate(0, 0) !important;
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- VIDEO SECTIONS --- */
.video-section {
    background-color: var(--color-dark-brown);
}

.video-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 aspect ratio */
    z-index: 1;
    pointer-events: none; /* Prevent interacting with youtube player */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(139, 94, 60, 0.4); /* Earthy brown blend */
    z-index: 2;
}

/* --- SLIDER SECTION --- */
.slider-section {
    background-color: var(--color-dark-brown);
}

.slider-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 100%; /* Start off-screen right */
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: left 1s ease-in-out;
}

.slide.active {
    left: 0;
}

.slide.previous {
    left: -100%; /* Move off-screen left */
}

.slider-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(139, 94, 60, 0.3), rgba(62, 39, 35, 0.6));
    z-index: 2;
}

/* --- TEXT ALIGNMENT --- */
.text-bottom {
    align-self: flex-end;
    margin-bottom: 5vh;
}

.story-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Pushes content towards top, but we center the text in the remaining space */
    width: 100%;
    height: 100%;
    max-width: 1000px;
    padding: 7vh 2rem 3vh 2rem; /* Title is close to the top edge (7vh padding) */
    z-index: 10;
}

.story-title-main {
    font-size: 6.5rem; /* Much larger character size */
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #FDFCF0, #D7C4A5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 4px 15px rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;
    text-transform: capitalize;
    position: relative;
    padding-bottom: 20px; /* Space for the underline */
}

/* Beautiful fading beige underline line */
.story-title-main::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 220px; /* Elegant focused underline width */
    height: 3px;  /* Thickness of the underline line */
    background: linear-gradient(90deg, transparent, #D7C4A5 20%, #FDFCF0 50%, #D7C4A5 80%, transparent); /* Elegant fading beige gradient line */
    border-radius: 2px;
}

.story-text {
    font-size: 1.8rem;
    line-height: 2.0;
    text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.9);
    font-weight: 400;
    position: relative;
    display: inline;
    font-family: var(--font-heading);
    font-style: italic;
    text-align: center;
    margin-top: auto; /* Vertically centers the text block in the remaining space below the high title */
    margin-bottom: auto;
    max-width: 880px;
}

.story-text.typing::after {
    content: '|';
    margin-left: 4px;
    font-weight: 300;
    color: var(--color-sand);
    animation: cursor-blink 0.75s step-end infinite;
}

@keyframes cursor-blink {
    from, to { color: transparent }
    50% { color: var(--color-sand); }
}

/* --- STORY SECTION --- */
.story-section {
    background: linear-gradient(135deg, var(--color-earth-brown) 0%, var(--color-dark-brown) 100%);
}

.story-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('elvi_website_media/Last_session_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    opacity: 1;
    transition: opacity 1.8s cubic-bezier(0.25, 1, 0.5, 1);
}

#povestea-noastra.in-view .story-bg {
    opacity: 0.6; /* Fades out to 60% to blend with the brownish background gradient */
}

.story-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(62, 39, 35, 0.1) 0%, rgba(62, 39, 35, 0.6) 100%);
    z-index: 2;
    pointer-events: none;
}

/* --- TRAILER SECTION --- */
.trailer-section {
    background: linear-gradient(135deg, var(--color-dark-brown) 0%, #1e110e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.trailer-bg-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('elvi_website_media/Last_session_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    opacity: 0.15;
    filter: blur(10px);
    transition: opacity 1.5s ease-in-out;
}

.trailer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(62, 39, 35, 0.2) 0%, rgba(30, 17, 14, 0.8) 100%);
    z-index: 2;
    pointer-events: none;
}

.trailer-content {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.trailer-title {
    font-size: 4rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--color-cream), var(--color-sand));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.4);
    position: relative;
    display: inline-block;
}

.cinematic-player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    background-color: #000;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.cinematic-player-container:hover {
    transform: scale(1.01);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), 0 0 15px rgba(215, 196, 165, 0.15);
}

/* Iframe and poster placeholder */
.youtube-iframe-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.youtube-iframe-placeholder iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none; /* Let clicks pass to the parent container for custom controls */
}

.player-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('elvi_website_media/Last_session_bg.jpg');
    background-size: cover;
    background-position: center;
    z-index: 3;
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.player-poster.hidden {
    opacity: 0;
    pointer-events: none;
}

.player-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.player-loader.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(215, 196, 165, 0.1);
    border-top-color: var(--color-sand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Custom controls styling */
.custom-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 25px 20px 25px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: all;
}

.cinematic-player-container:hover .custom-player-controls {
    opacity: 1;
    transform: translateY(0);
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--color-cream);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-btn:hover {
    background-color: var(--color-sand);
    color: var(--color-dark-brown);
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(215, 196, 165, 0.4);
}

.control-btn svg {
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

.control-btn:active svg {
    transform: scale(0.9);
}

.hidden {
    display: none !important;
}

/* Premium overlay big play button */
.premium-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.premium-play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.premium-play-button {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, #FDFCF0 0%, #D7C4A5 100%);
    color: var(--color-dark-brown);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(215, 196, 165, 0.4), 0 0 0 1px rgba(255,255,255,0.4);
    z-index: 2;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.premium-play-button svg {
    width: 36px;
    height: 36px;
    margin-left: 5px; /* Visual centering of play triangle */
    transition: transform 0.3s ease;
}

.premium-play-overlay:hover .premium-play-button {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(215, 196, 165, 0.6), 0 0 0 3px rgba(253, 252, 240, 0.6);
}

.premium-play-overlay:hover .premium-play-button svg {
    transform: scale(1.15);
}

.pulse-ring {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid var(--color-sand);
    animation: pulse 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.overlay-text {
    margin-top: 20px;
    font-size: 1.25rem;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    color: var(--color-cream);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    font-weight: 600;
    transition: transform 0.4s ease;
}

.premium-play-overlay:hover .overlay-text {
    transform: translateY(2px);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .section {
        width: 96vw;
        margin-bottom: 40px;
        border-radius: 16px;
        min-height: 500px;
    }
    
    #hero {
        margin-top: 20px;
    }

    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-copy {
        font-size: 1.2rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        justify-content: center;
    }

    .btn {
        width: 80%;
        max-width: 300px;
    }

    .section-title {
        font-size: 3rem;
    }

    .story-content {
        padding: 5vh 1.5rem 2vh 1.5rem;
    }

    .story-title-main {
        font-size: 3.5rem; /* Larger on mobile too, but proportioned */
        margin-bottom: 1rem;
        text-align: center;
        padding-bottom: 10px;
    }

    .story-title-main::after {
        width: 140px;
        height: 2px;
    }

    .story-text {
        font-size: 1.25rem;
        line-height: 1.6;
        margin-top: auto;
        margin-bottom: auto;
    }
    
    #hero-logo {
        width: 180px;
    }

    /* Trailer Responsive */
    .trailer-title {
        font-size: 3rem;
        margin-bottom: 1.5rem;
    }
    
    .cinematic-player-container {
        border-radius: 12px;
    }
    
    .premium-play-button {
        width: 70px;
        height: 70px;
    }
    
    .premium-play-button svg {
        width: 28px;
        height: 28px;
        margin-left: 3px;
    }
    
    .pulse-ring {
        width: 70px;
        height: 70px;
    }
    
    .overlay-text {
        font-size: 1.05rem;
        margin-top: 15px;
        padding: 0 10px;
    }
    
    .control-btn {
        width: 38px;
        height: 38px;
    }
    
    .control-btn svg {
        width: 18px;
        height: 18px;
    }
}
