:root {
    --deep-green: #0f4c3a;
    --forest-green: #1a5c4a;
    --christmas-red: #c41e3a;
    --gold: #ffd700;
    --light-gold: #ffe44d;
    --cream: #fffef2;
    --snow-white: #ffffff;
}

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

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, #0a3d2e 0%, #1a5c4a 50%, #0f4c3a 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(196, 30, 58, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Christmas Lights */
.lights-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 100;
    pointer-events: none;
}

.lights-container::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #2d5f4f;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.light {
    position: absolute;
    top: 22px;
    width: 12px;
    height: 16px;
    border-radius: 0 0 50% 50%;
    animation: twinkle 1.5s infinite;
    box-shadow: 0 0 20px currentColor;
}

.light:nth-child(1) { background: var(--christmas-red); }
.light:nth-child(2) { background: var(--gold); }
.light:nth-child(3) { background: #4169e1; }
.light:nth-child(4) { background: var(--christmas-red); }
.light:nth-child(5) { background: #32cd32; }
.light:nth-child(6) { background: var(--gold); }
.light:nth-child(7) { background: #ff69b4; }
.light:nth-child(8) { background: var(--christmas-red); }
.light:nth-child(9) { background: #4169e1; }
.light:nth-child(10) { background: var(--gold); }

@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.9); }
}

/* Snowflakes */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.snowflake {
    position: absolute;
    top: -20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5em;
    user-select: none;
    animation: snowfall linear infinite;
}

.snowflake:nth-child(1) { left: 10%; animation-duration: 10s; animation-delay: 0s; font-size: 1.2em; }
.snowflake:nth-child(2) { left: 20%; animation-duration: 12s; animation-delay: 2s; font-size: 1.8em; }
.snowflake:nth-child(3) { left: 30%; animation-duration: 8s; animation-delay: 4s; font-size: 1.4em; }
.snowflake:nth-child(4) { left: 40%; animation-duration: 14s; animation-delay: 1s; font-size: 1.6em; }
.snowflake:nth-child(5) { left: 50%; animation-duration: 11s; animation-delay: 3s; font-size: 1.3em; }
.snowflake:nth-child(6) { left: 60%; animation-duration: 9s; animation-delay: 5s; font-size: 1.7em; }
.snowflake:nth-child(7) { left: 70%; animation-duration: 13s; animation-delay: 2s; font-size: 1.5em; }
.snowflake:nth-child(8) { left: 80%; animation-duration: 10s; animation-delay: 4s; font-size: 1.4em; }
.snowflake:nth-child(9) { left: 90%; animation-duration: 12s; animation-delay: 1s; font-size: 1.6em; }
.snowflake:nth-child(10) { left: 15%; animation-duration: 11s; animation-delay: 3s; font-size: 1.8em; }
.snowflake:nth-child(11) { left: 85%; animation-duration: 9s; animation-delay: 0s; font-size: 1.3em; }
.snowflake:nth-child(12) { left: 45%; animation-duration: 13s; animation-delay: 5s; font-size: 1.5em; }

@keyframes snowfall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0.3;
    }
}

/* Container */
.container {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

/* Title */
h1 {
    text-align: center;
    margin-bottom: 2rem;
    animation: titleEntrance 1s ease-out;
}

.title-line {
    display: block;
    font-family: 'Chewy', cursive;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--cream);
    text-shadow:
        3px 3px 0 var(--christmas-red),
        6px 6px 0 rgba(196, 30, 58, 0.4),
        0 0 40px rgba(255, 215, 0, 0.3);
    letter-spacing: 2px;
    line-height: 1.2;
}

.subtitle {
    display: block;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 600;
    color: var(--light-gold);
    margin-top: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 4px;
}

@keyframes titleEntrance {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Search Container */
.search-container {
    max-width: 500px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
    animation: searchEntrance 1s ease-out 0.3s backwards;
}

@keyframes searchEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-box {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid var(--gold);
    border-radius: 50px;
    outline: none;
    color: var(--deep-green);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.2),
        0 0 0 0 rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
}

.search-box::placeholder {
    color: rgba(15, 76, 58, 0.5);
}

.search-box:focus {
    border-color: var(--light-gold);
    box-shadow:
        0 6px 30px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(255, 215, 0, 0.2),
        0 0 20px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

/* Gift Exchange List */
.exchange-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Gift Card Styling */
.pair {
    background: linear-gradient(90deg, var(--christmas-red) 0%, #a01728 100%);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    animation: cardEntrance 0.4s ease-out backwards;
}

.pair:nth-child(1) { animation-delay: 0.05s; }
.pair:nth-child(2) { animation-delay: 0.1s; }
.pair:nth-child(3) { animation-delay: 0.15s; }
.pair:nth-child(4) { animation-delay: 0.2s; }
.pair:nth-child(5) { animation-delay: 0.25s; }
.pair:nth-child(6) { animation-delay: 0.3s; }
.pair:nth-child(7) { animation-delay: 0.35s; }
.pair:nth-child(8) { animation-delay: 0.4s; }
.pair:nth-child(9) { animation-delay: 0.45s; }
.pair:nth-child(10) { animation-delay: 0.5s; }
.pair:nth-child(11) { animation-delay: 0.55s; }
.pair:nth-child(12) { animation-delay: 0.6s; }
.pair:nth-child(13) { animation-delay: 0.65s; }
.pair:nth-child(14) { animation-delay: 0.7s; }
.pair:nth-child(15) { animation-delay: 0.75s; }
.pair:nth-child(16) { animation-delay: 0.8s; }
.pair:nth-child(17) { animation-delay: 0.85s; }
.pair:nth-child(18) { animation-delay: 0.9s; }
.pair:nth-child(19) { animation-delay: 0.95s; }
.pair:nth-child(20) { animation-delay: 1s; }
.pair:nth-child(21) { animation-delay: 1.05s; }

/* Alternate colors for variety */
.pair:nth-child(3n+2) {
    background: linear-gradient(90deg, var(--forest-green) 0%, #0f3d2d 100%);
}

.pair:nth-child(3n+3) {
    background: linear-gradient(90deg, #b8860b 0%, #8b6508 100%);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pair:hover {
    transform: translateX(8px);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.35),
        0 0 20px rgba(255, 215, 0, 0.25);
}

.pair.hidden {
    display: none;
}

/* Text inside cards */
.giver,
.receiver {
    display: inline;
    color: var(--cream);
    font-size: 1.15rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    margin: 0;
}

.giver {
    font-weight: 700;
}

.receiver {
    font-weight: 700;
    color: var(--light-gold);
}

.arrow {
    display: inline;
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 5rem 1rem 8rem;
    }

    .title-line {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }

    .pair {
        padding: 0.875rem 1.25rem;
    }

    .giver,
    .receiver,
    .arrow {
        font-size: 1rem;
    }

    /* Sticky search bar at bottom */
    .search-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 1rem;
        background: linear-gradient(to top,
            var(--deep-green) 0%,
            var(--deep-green) 80%,
            transparent 100%);
        z-index: 200;
        max-width: none;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    }

    .search-box {
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }
}
