:root {
    --bg-color: #f0f0f0;
    --bg-gradient: none; /* Default to no gradient */
    --text-color: #333;
    --primary-color: #ff4081;
    --btn-bg: #fff;
    --btn-text: #333;
}

.christmas-theme {
    --bg-color: #D42426; /* Classic Christmas Red */
    /* A rich, radial gradient from festive red to deep burgundy/chocolate */
    --bg-gradient: radial-gradient(circle at center, #D42426 0%, #4A0E0E 100%);
    --text-color: #fff;
    --primary-color: #27ae60;
    --btn-bg: #fff;
    --btn-text: #c0392b;
}

.fade-out-slow {
    opacity: 0 !important;
    transition: opacity 2s ease-out;
    pointer-events: none;
}

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

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg-color);
    /* Ensure gradient is applied if variable is set, fall back to color */
    background-image: var(--bg-gradient, none);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.5s ease;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    z-index: 100;
    padding: 10px;
    box-shadow: none;
}

/* Password Screen */
#password-screen {
    text-align: center;
    z-index: 200;
    background: rgba(0,0,0,0.5); /* Semi-transparent backdrop if needed, or just layout */
    padding: 2rem;
    border-radius: 20px;
    transition: opacity 0.5s ease;
    width: 90%;
    max-width: 400px;
}

#password-screen h2 {
    margin-bottom: 1rem;
    font-size: 2rem;
    color: white;
}

#password-hint {
    margin-bottom: 1.5rem;
    font-style: italic;
    color: #eee;
}

#password-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border-radius: 50px;
    border: none;
    margin-bottom: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
}

#password-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-color);
}

#password-submit {
    margin-top: 10px;
    background-color: var(--primary-color);
    color: white;
}

#password-error {
    color: #ffcccc;
    margin-top: 1rem;
    font-weight: bold;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}


#start-screen {
    text-align: center;
    z-index: 10;
    transition: opacity 0.5s ease;
}

#start-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

button {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    border: none;
    border-radius: 50px;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

button:active {
    transform: scale(0.95);
}

.hidden {
    display: none !important;
}

#animation-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease;
}

.images-wrapper {
    position: relative;
    width: 100%;
    height: 300px; /* Adjust based on image size */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Reset negative margin, use layout flex or just standard positioning */
    /* margin-top: -50px; removed aggressive shift */
}

#img2, #img3 {
    width: 120px;
    height: auto;
    position: absolute;
    top: 30%; 
    left: 50%;
    z-index: 10;
    transition: transform 1.5s ease-in-out;
}

#img2 {
    /* Start off-screen left */
    transform: translate(-500px, -50%); 
}

#img3 {
    /* Start off-screen right */
    transform: translate(500px, -50%);
}

/* Dynamic positioning approach */
.images-wrapper.active #img2 {
    transform: translate(calc(-100% - 10px), -50%);
}

.images-wrapper.active #img3 {
    transform: translate(10px, -50%);
}

#heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%) rotate(-45deg) scale(0);
    width: 100px;
    height: 100px;
    background-color: #ff4d4d;
    z-index: 5;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Multiple drop-shadows to create a solid outline effect */
    filter: drop-shadow(4px 0 0 white) 
            drop-shadow(-4px 0 0 white) 
            drop-shadow(0 4px 0 white) 
            drop-shadow(0 -4px 0 white);
    cursor: pointer; /* Clickable */
}

#heart::before,
#heart::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 100px;
    background-color: #ff4d4d;
    border-radius: 50%;
}

#heart::before {
    top: -50px;
    left: 0;
}

#heart::after {
    top: 0;
    left: 50px;
}

#heart.show {
    transform: translate(-50%, -60%) rotate(-45deg) scale(2.5);
    animation: heartbeat 1.2s infinite;
}

/* Add a pulse effect to the heart when it's clickable */
#heart.show:hover {
    filter: drop-shadow(4px 0 0 white) 
            drop-shadow(-4px 0 0 white) 
            drop-shadow(0 4px 0 white) 
            drop-shadow(0 -4px 0 white)
            brightness(1.1);
}

@keyframes heartbeat {
    0% { transform: translate(-50%, -60%) rotate(-45deg) scale(2.5); }
    10% { transform: translate(-50%, -60%) rotate(-45deg) scale(2.8); }
    20% { transform: translate(-50%, -60%) rotate(-45deg) scale(2.5); }
    30% { transform: translate(-50%, -60%) rotate(-45deg) scale(2.8); }
    40% { transform: translate(-50%, -60%) rotate(-45deg) scale(2.5); }
    100% { transform: translate(-50%, -60%) rotate(-45deg) scale(2.5); }
}

/* Text styles */
#click-instruction {
    margin-top: 60px; /* Increased margin to push it down further */
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 1s ease;
    animation: floatText 2s infinite ease-in-out;
}

#click-instruction.visible {
    opacity: 1;
}

@keyframes floatText {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

#message-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    text-align: center;
    font-size: 1.5rem;
    line-height: 1.5;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    min-height: 60px;
    z-index: 20; /* Ensure it's above other elements */
}

#next-btn {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 30;
    font-size: 1rem;
    padding: 0.8rem 2rem;
}

#next-btn.visible {
    opacity: 1;
}

/* Slideshow Styles */
#slideshow-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 50;
    transition: opacity 1.5s ease;
    cursor: pointer;
}

#slide-date {
    position: absolute;
    top: 15%;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 60;
}

#slide-image-container {
    width: 90%;
    height: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.slide-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 5px solid white;
    opacity: 0;
    transition: opacity 0.5s ease;
    position: absolute;
}

.slide-img.active {
    opacity: 1;
}

#slide-caption {
    margin-top: 20px;
    font-size: 1.2rem;
    color: white;
    text-align: center;
    width: 90%;
    min-height: 50px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

#slide-instruction {
    position: absolute;
    bottom: 20px;
    font-size: 0.8rem;
    opacity: 0.7;
    color: white;
}

/* Final Screen */
#final-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 60;
}

#final-message {
    width: 90%;
    text-align: center;
    font-size: 2rem;
    line-height: 1.5;
    color: white;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Snowflake decoration for christmas theme */
.snowflake {
    position: fixed;
    top: -50px;
    z-index: 9999;
    user-select: none;
    cursor: default;
    animation-name: snowflakes-fall, snowflakes-shake;
    animation-duration: 10s, 3s;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: infinite, infinite;
    animation-play-state: running, running;
    color: #fff;
    font-size: 1.5rem;
}

/* Custom Image Snowflakes */
.img-snowflake {
    width: 60px; /* Increased size from 30px */
    height: 60px; /* Increased size from 30px */
    object-fit: contain;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.8));
}

@keyframes snowflakes-fall {
    0% { top: -10%; }
    100% { top: 100%; }
}

@keyframes snowflakes-shake {
    0% { transform: translateX(0px); }
    50% { transform: translateX(80px); }
    100% { transform: translateX(0px); }
}

/* =========================================
   New Christmas Decorations
   ========================================= */

/* Lights */
.christmas-lights {
    position: absolute;
    top: 10px; /* Moved down to be visible */
    left: 0;
    width: 100%;
    height: 50px;
    display: none; /* hidden by default */
    justify-content: center;
    padding: 0;
    margin: 0;
    list-style: none;
    z-index: 50;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden; /* Keep overflow hidden on the container */
}

.christmas-theme .christmas-lights {
    display: flex;
}

.christmas-lights li {
    position: relative;
    width: 20px;
    height: 20px;
    background: #f00;
    border-radius: 50%;
    margin: 0 15px;
    animation: light-glow 1s infinite alternate;
    box-shadow: 0 0 10px #f00;
    display: inline-block;
    flex-shrink: 0; /* Prevent squashing on small screens */
}

/* Colors */
.christmas-lights li:nth-child(2n) { background: #0f0; box-shadow: 0 0 10px #0f0; animation-delay: 0.4s; }
.christmas-lights li:nth-child(3n) { background: #00f; box-shadow: 0 0 10px #00f; animation-delay: 0.8s; }
.christmas-lights li:nth-child(4n) { background: #ff0; box-shadow: 0 0 10px #ff0; animation-delay: 1.2s; }

/* Wire */
.christmas-lights li::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    width: 2px;
    height: 10px;
    background: #222;
    transform: translateX(-50%);
}

.christmas-lights li::after {
    /* String connecting them */
    content: "";
    position: absolute;
    top: -20px;
    left: -20px; 
    width: 50px;
    height: 20px;
    border-bottom: 2px solid #222;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

@keyframes light-glow {
    0% { opacity: 0.5; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.1); }
}

/* Tree */
.christmas-tree-img {
    position: absolute;
    bottom: 0;
    width: 150px; /* Adjust size as needed */
    height: auto;
    display: none;
    z-index: 1;
    pointer-events: none;
}

.christmas-theme .christmas-tree-img {
    display: block;
}

/* Default to left */
.christmas-tree-img {
    left: 0;
}

/* Santa */
.santa-img {
    position: absolute;
    bottom: 0;
    width: 150px;
    height: auto;
    display: none;
    z-index: 1;
    pointer-events: none;
    right: 0;
}

.christmas-theme .santa-img {
    display: block;
}
