@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700&display=swap');

:root {
    --bg-dark: #b3a89d; /* Taupe background from sobrec.png */
    --gold: #a17a4d;    /* Bronze/Gold from the wax seal */
    --gold-bright: #d9cfc0; /* Cream highlight from the envelope */
    --text-color: #ffffff;
    --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Main Container */
#app {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Cover / Envelope Section */
#cover-container {
    position: absolute;
    z-index: 10;
    cursor: pointer;
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
}

#envelope {
    max-width: 90vw;
    max-height: 80vh;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    transition: var(--transition-slow);
}

#cover-container:hover #envelope {
    transform: scale(1.02);
    box-shadow: 0 30px 60px rgba(161, 122, 77, 0.2);
}

.instruction {
    position: absolute;
    top: 55%; /* Slightly below true center to look balanced on the envelope */
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    color: var(--gold);
    animation: pulse 2s infinite ease-in-out;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 5;
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 0.7; 
        text-shadow: 0 0 5px rgba(161, 122, 77, 0.2);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1); 
        opacity: 1; 
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    }
}

/* Video Section */
#video-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 16 / 9;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease;
    
    /* Frame Effect matching the Cream color */
    border: 12px solid var(--gold-bright);
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.3),
        inset 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    background: #000;
}

video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

/* Transitions */
.hidden {
    opacity: 0 !important;
    pointer-events: none;
    transform: translateY(30px) scale(0.95);
}

.visible {
    opacity: 1 !important;
    visibility: visible !important;
}


/* Floating Controls */
.floating-controls {
    position: fixed;
    bottom: 30px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--gold);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.control-btn:hover {
    background: var(--gold-bright);
    transform: scale(1.1) rotate(5deg);
    border-color: var(--gold);
    color: var(--bg-dark);
}

.control-btn svg {
    width: 24px;
    height: 24px;
}

/* Greeting Card Overlay */
#greeting-card {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 20;
    pointer-events: none;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
    transition: opacity 1.5s ease;
    transform: translateY(-50%);
}

#greeting-card h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 3rem;
    color: var(--gold-bright);
    margin-bottom: 0.5rem;
}

#greeting-card p {
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 300;
    letter-spacing: 0.1rem;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    #video-wrapper {
        width: 95%;
        border-width: 6px;
    }

    .floating-controls {
        position: absolute;
        bottom: 5vh; /* Fixed at bottom of viewport */
        left: 0;
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        z-index: 1000;
    }

    #greeting-card h2 {
        font-size: 1.8rem;
    }

    #greeting-card p {
        font-size: 0.85rem;
    }
}
