/* General Setup & Mobile-First Approach */
:root {
    --primary-color: #e91e63; /* Pink */
    --secondary-color: #fce4ec; /* Light Pink */
    --text-color: #444;
    --bg-color: #fff;
    --accent-font: 'Tajawal', sans-serif;
}

body {
    font-family: var(--accent-font);
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent scrolling between scenes */
}

#journey-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--secondary-color);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.scene.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

.nav-btn {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-family: var(--accent-font);
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 20px;
    white-space: normal;
    line-height: 1.4;
}

.nav-btn:hover {
    background-color: #c2185b;
    transform: scale(1.05);
}

.hidden {
    display: none !important;
}


/* --- Scene 1: The Gift Box --- */
#scene-1 .gift-box {
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.3));
}

#scene-1 .gift-box:hover {
    transform: translateY(-5px) scale(1.02);
    filter: drop-shadow(0 25px 50px rgba(0,0,0,0.4));
}

#scene-1 .gift-card {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #fff, #f0f0f0);
    padding: 8px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    white-space: nowrap;
    font-weight: 600;
    color: #333;
    border: 2px solid #ffd700;
    animation: cardFloat 3s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateX(-50%) translateY(0px); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

#scene-1 .gift-body {
    width: 180px;
    height: 120px;
    background: linear-gradient(145deg, var(--primary-color), #ad1457);
    position: relative;
    border-radius: 8px;
    box-shadow:
        inset 0 4px 8px rgba(255,255,255,0.3),
        inset 0 -4px 8px rgba(0,0,0,0.3),
        0 10px 30px rgba(0,0,0,0.3);
    transform-style: preserve-3d;
}

#scene-1 .gift-lid {
    width: 200px;
    height: 40px;
    background: linear-gradient(145deg, #c2185b, #8e0038);
    position: absolute;
    top: -40px;
    left: -10px;
    border-radius: 8px 8px 4px 4px;
    transition: all 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow:
        inset 0 4px 8px rgba(255,255,255,0.2),
        inset 0 -4px 8px rgba(0,0,0,0.4),
        0 8px 25px rgba(0,0,0,0.4);
    transform-origin: bottom;
}

#scene-1 .gift-ribbon {
    position: relative;
    z-index: 5;
}

#scene-1 .gift-ribbon::before,
#scene-1 .gift-ribbon::after {
    content: '';
    position: absolute;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border-radius: 2px;
}

#scene-1 .gift-ribbon::before { /* Vertical */
    width: 20px;
    height: 120px;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
}

#scene-1 .gift-ribbon::after { /* Horizontal */
    width: 180px;
    height: 20px;
    top: 50px;
    left: 0;
}

/* Sparkling effect */
#scene-1 .gift-box::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle at 20% 30%, transparent 2px, rgba(255,215,0,0.3) 2px, rgba(255,215,0,0.3) 4px, transparent 4px),
                radial-gradient(circle at 80% 20%, transparent 2px, rgba(255,192,203,0.3) 2px, rgba(255,192,203,0.3) 4px, transparent 4px),
                radial-gradient(circle at 40% 80%, transparent 2px, rgba(255,255,255,0.4) 2px, rgba(255,255,255,0.4) 4px, transparent 4px);
    border-radius: 15px;
    animation: sparkle 2s ease-in-out infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#scene-1 .gift-box:hover::before {
    opacity: 1;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(180deg); opacity: 1; }
}

/* Advanced Animation for unwrapping */
#scene-1.unwrapped .gift-lid {
    transform: translateY(-100px) translateX(20px) rotateX(-25deg) rotateZ(25deg);
    opacity: 0.8;
}

#scene-1.unwrapped .gift-ribbon::before {
    transform: translateX(-50%) scaleY(0.3) rotateZ(45deg);
    opacity: 0.3;
}

#scene-1.unwrapped .gift-ribbon::after {
    transform: scaleX(0.3) rotateZ(-45deg);
    opacity: 0.3;
}

#scene-1.unwrapped .gift-body {
    animation: giftOpen 1s ease-out;
}

@keyframes giftOpen {
    0% { transform: scale(1); }
    30% { transform: scale(1.1) rotateY(5deg); }
    60% { transform: scale(0.95) rotateY(-3deg); }
    100% { transform: scale(1) rotateY(0deg); }
}

/* Magical particles effect */
#scene-1.unwrapped::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    animation: magicalParticles 2s ease-out;
    pointer-events: none;
}

@keyframes magicalParticles {
    0% {
        transform: translate(-50%, -50%) scale(0);
        box-shadow:
            0 0 0 0 #ffd700,
            20px -20px 0 0 #ff69b4,
            -20px -20px 0 0 #00bcd4,
            20px 20px 0 0 #4caf50,
            -20px 20px 0 0 #ff5722;
    }
    50% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 -40px 0 0 #ffd700,
            40px -40px 0 0 #ff69b4,
            -40px -40px 0 0 #00bcd4,
            40px 40px 0 0 #4caf50,
            -40px 40px 0 0 #ff5722;
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
        box-shadow:
            0 -80px 0 0 transparent,
            80px -80px 0 0 transparent,
            -80px -80px 0 0 transparent,
            80px 80px 0 0 transparent,
            -80px 80px 0 0 transparent;
    }
}

#scene-1 .click-to-discover {
    margin-top: 60px;
    opacity: 0;
    transition: opacity 0.8s 1.5s; /* Delay appearance */
    animation: pulseButton 2s ease-in-out infinite;
}

@keyframes pulseButton {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#scene-1.unwrapped .click-to-discover {
    opacity: 1;
}


/* --- Scene 2: The Constant --- */
#scene-2 {
    background-color: #333;
}

.background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.3;
}


#scene-2 .text-overlay {
    position: relative;
    z-index: 10;
    color: var(--bg-color);
    background-color: rgba(0,0,0,0.5);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    max-width: 90%;
}

#scene-2 .text-overlay p {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    line-height: 1.7;
}


/* --- Scene 4: The Story & The Mirror --- */
#scene-4.book-page {
    flex-direction: row;
    justify-content: flex-start; /* Align to top */
    align-items: center;
    gap: 20px;
    background-color: #fdfaf6; /* Creamy background */
    padding-top: 50px; /* Add padding at the top */
    padding-bottom: 120px; /* Make space for buttons */
    overflow-y: auto; /* Allow vertical scroll */
}

#scene-4 .book-left, #scene-4 .book-right {
    width: 45%;
    max-width: 400px;
}

#scene-4 .book-left {
    text-align: right;
    padding: 30px;
    font-size: 1.1em;
    line-height: 1.9;
    color: #5d4037; /* Brownish text */
}

#scene-4 .book-right .book-image {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    display: block;
}

#scene-4 .button-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 90%;
}

#scene-4 .nav-btn.secondary {
    background-color: #78909c;
}

#scene-4 .nav-btn.secondary:hover {
    background-color: #546e7a;
}

/* Responsive adjustments for book page on smaller screens */
@media (max-width: 768px) {
    #scene-4.book-page {
        flex-direction: column;
        justify-content: center;
    }

    #scene-4 .book-left, #scene-4 .book-right {
        width: 90%;
        max-width: 400px;
    }

    #scene-4 .book-left {
        text-align: center;
        padding: 10px;
        font-size: 1em;
    }
}


/* --- Scene 5: The Treasure & The Gift --- */
#scene-5 {
    background-color: #263238; /* Dark Blue Grey */
    color: var(--bg-color);
}

#scene-5 .final-text {
    font-size: 1.5em;
    opacity: 0;
    animation: fade-in-text 2s forwards;
}

#scene-5 .aramaic {
    font-size: 1.8em;
    margin-top: 30px;
    color: #ffd700; /* Gold color */
    font-family: 'Noto Sans Syriac Estrangela', sans-serif; /* A font that might support Aramaic */
}

@keyframes fade-in-text {
    to { opacity: 1; }
}

#scene-5 .voucher-reveal {
    margin-top: 40px;
    opacity: 0;
    transform: translateY(20px);
    animation: fade-in-up 1s forwards 2s; /* Delayed animation */
}

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#scene-5 .voucher {
    background: linear-gradient(135deg, #4a4e69, #22223b);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 30px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#scene-5 .voucher h3 {
    margin-top: 0;
    color: #fff;
}

#scene-5 .voucher p {
    color: #f2e9e4;
    font-size: 0.9em;
}

#scene-5 .secret-key {
    background-color: #22223b;
    border: 1px dashed #ffd700;
    color: #fff;
    padding: 15px;
    margin-top: 20px;
    font-size: 1.1em;
    letter-spacing: 2px;
    font-family: 'Courier New', Courier, monospace;
    border-radius: 5px;
}
