/* Base styles & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0b0914;
    --bg-dark-accent: #19142d;
    --pink-primary: #ff2a74;
    --pink-light: #ff758c;
    --pink-pastel: #ffe3ec;
    --gold: #ffe259;
    --gold-dark: #ffa751;
    --text-light: #f8f9fa;
    --text-muted: #b5b5c3;
    --font-heading: 'Playfair Display', serif;
    --font-cursive: 'Dancing Script', cursive;
    --font-main: 'Montserrat', sans-serif;
    --neon-shadow: 0 0 10px rgba(255, 42, 116, 0.5), 0 0 20px rgba(255, 42, 116, 0.3);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Background & Canvas Elements */
#bokeh-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#explosion-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

/* Container */
.container {
    position: relative;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 5;
    min-height: 100vh;
}

/* Audio Control */
.audio-control {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 42, 116, 0.2);
    border: 2px solid var(--pink-primary);
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--neon-shadow);
}

.audio-control:hover {
    transform: scale(1.1);
    background: var(--pink-primary);
    box-shadow: 0 0 20px var(--pink-primary);
}

.audio-control i {
    font-size: 1.2rem;
}

.audio-control.playing i {
    animation: rotateMusic 4s linear infinite;
}

@keyframes rotateMusic {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Decorations */
.decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.balloon {
    position: absolute;
    font-size: 2.5rem;
    animation: floatBalloon 15s ease-in-out infinite;
    opacity: 0.7;
}

.balloon-1 { top: 15%; left: 8%; animation-delay: 0s; }
.balloon-2 { top: 25%; right: 8%; animation-delay: 3s; }
.balloon-3 { top: 60%; left: 5%; animation-delay: 6s; }

.star {
    position: absolute;
    color: var(--gold);
    font-size: 1.2rem;
    animation: twinkle 3s ease-in-out infinite;
    opacity: 0.6;
}

.star-1 { top: 10%; right: 20%; animation-delay: 0.5s; }
.star-2 { top: 45%; left: 15%; animation-delay: 1.5s; }
.star-3 { top: 70%; right: 12%; animation-delay: 2.5s; }

@keyframes floatBalloon {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(10deg); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); filter: drop-shadow(0 0 2px var(--gold)); }
    50% { opacity: 0.9; transform: scale(1.2); filter: drop-shadow(0 0 8px var(--gold)); }
}

/* Header Message */
.header {
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.birthday-title {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(to right, #fff, var(--pink-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.5));
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.6;
    margin: 0 auto;
    font-weight: 300;
}

/* 3D Gift Box */
.gift-box-wrapper {
    position: relative;
    width: 200px;
    height: 250px;
    margin: 30px auto;
    cursor: pointer;
    z-index: 5;
    transition: transform 0.3s ease;
}

.gift-box-wrapper:hover {
    transform: scale(1.05);
}

.gift-glow {
    position: absolute;
    width: 140px;
    height: 30px;
    background: var(--pink-primary);
    border-radius: 50%;
    bottom: -15px;
    left: 30px;
    filter: blur(15px);
    opacity: 0.6;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 0.8; transform: scale(1.15); }
}

.gift-box {
    position: relative;
    width: 200px;
    height: 200px;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

/* Gift Box Animations on hover/click */
.gift-box-wrapper:hover .gift-box {
    animation: wiggle 0.5s linear infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg) translateY(-2px); }
    75% { transform: rotate(3deg) translateY(2px); }
}

.gift-lid {
    position: absolute;
    width: 210px;
    height: 45px;
    background: linear-gradient(135deg, var(--pink-primary), #d91b5c);
    top: -20px;
    left: -5px;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10;
    transition: all 0.8s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.lid-ribbon-horizontal {
    position: absolute;
    width: 100%;
    height: 12px;
    background: var(--gold);
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lid-ribbon-vertical {
    position: absolute;
    height: 100%;
    width: 24px;
    background: var(--gold);
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.gift-bow {
    position: absolute;
    width: 50px;
    height: 50px;
    left: 50%;
    top: -30px;
    transform: translateX(-50%);
    z-index: 11;
}

.gift-bow::before, .gift-bow::after {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border: 8px solid var(--gold);
    border-radius: 50% 50% 0 50%;
    top: 0;
}

.gift-bow::before {
    left: -12px;
    transform: rotate(45deg);
}

.gift-bow::after {
    right: -12px;
    transform: rotate(135deg) scaleY(-1);
}

.gift-body {
    position: absolute;
    width: 200px;
    height: 180px;
    background: linear-gradient(135deg, #e61d65, #b8104a);
    bottom: 0;
    left: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    z-index: 9;
    overflow: hidden;
}

.body-ribbon-horizontal {
    position: absolute;
    width: 100%;
    height: 24px;
    background: var(--gold);
    top: 40%;
    transform: translateY(-50%);
}

.body-ribbon-vertical {
    position: absolute;
    height: 100%;
    width: 24px;
    background: var(--gold);
    left: 50%;
    transform: translateX(-50%);
}

/* Click Prompt styling */
.click-prompt {
    margin-top: 25px;
    font-size: 1.1rem;
    color: var(--pink-light);
    font-weight: 600;
    letter-spacing: 2px;
    animation: flashPrompt 1.5s infinite ease-in-out;
}

@keyframes flashPrompt {
    0%, 100% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Gift Box Opened States */
.gift-box-wrapper.opened .gift-lid {
    transform: translateY(-150px) translateX(100px) rotate(45deg);
    opacity: 0;
}

.gift-box-wrapper.opened .gift-body {
    transform: scaleY(0);
    transform-origin: bottom;
    opacity: 0;
    transition: all 0.5s ease-out 0.2s;
}

.gift-box-wrapper.opened .click-prompt {
    display: none;
}

/* Car Pop-up Area */
.car-popup {
    position: absolute;
    width: 100%;
    max-width: 600px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.2) rotate(-10deg);
    z-index: 8;
    transition: all 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.car-popup.show {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    pointer-events: auto;
}

.car-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.car-glow {
    position: absolute;
    width: 500px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 42, 116, 0.4) 0%, rgba(255, 42, 116, 0) 70%);
    top: 50px;
    filter: blur(20px);
    z-index: -1;
    animation: spinGlow 6s linear infinite;
}

@keyframes spinGlow {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); }
}

.luxury-car-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.6));
    animation: hoverCar 3s ease-in-out infinite;
}

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

.car-text {
    margin-top: 15px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 226, 89, 0.6);
    letter-spacing: 1px;
    animation: pulseText 1.5s infinite alternate;
}

@keyframes pulseText {
    from { transform: scale(0.98); opacity: 0.9; }
    to { transform: scale(1.02); opacity: 1; }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 9, 20, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Pink Voucher Card Styling */
.voucher-card {
    background: linear-gradient(135deg, #fff0f5 0%, #ffe3ec 100%);
    border: 3px solid #ff758c;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    color: #4a1525;
    padding: 35px 25px;
    position: relative;
    box-shadow: 0 20px 50px rgba(255, 42, 116, 0.3), inset 0 0 15px rgba(255,255,255,0.6);
    transform: scale(0.7) rotate(5deg);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.open .voucher-card {
    transform: scale(1) rotate(0deg);
}

.voucher-ribbon {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 30px;
    background: var(--pink-primary);
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.voucher-ribbon::after {
    content: '★ GIFT ★';
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    display: block;
    text-align: center;
    line-height: 30px;
}

.modal-stars {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 15px;
    letter-spacing: 5px;
    opacity: 0.85;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #ff758c;
    transition: color 0.2s;
    line-height: 1;
}

.close-btn:hover {
    color: var(--pink-primary);
}

.voucher-header {
    text-align: center;
    margin-bottom: 20px;
}

.voucher-header h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--pink-primary);
    margin-bottom: 5px;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.voucher-subtitle {
    font-size: 0.9rem;
    color: #8c3b53;
    font-style: italic;
}

.voucher-body {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 20px 15px;
    border: 1px dashed #ffb3c1;
    box-shadow: inset 0 2px 8px rgba(255, 117, 140, 0.05);
}

.benefits-list {
    list-style: none;
    text-align: left;
    margin-bottom: 20px;
}

.benefits-list li {
    font-size: 0.95rem;
    margin-bottom: 12px;
    line-height: 1.5;
    position: relative;
    padding-left: 10px;
    font-weight: 500;
}

.voucher-divider {
    position: relative;
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.divider-line {
    flex-grow: 1;
    border-bottom: 2px dashed #ffb3c1;
}

/* Punch card cuts on the sides */
.divider-circle {
    width: 24px;
    height: 24px;
    background: var(--bg-dark);
    border-radius: 50%;
    position: absolute;
    z-index: 10;
}

.divider-circle.left {
    left: -27px;
    border-right: 3px solid #ff758c;
}

.divider-circle.right {
    right: -27px;
    border-left: 3px solid #ff758c;
}

.voucher-footer {
    text-align: center;
}

.personal-msg {
    font-family: var(--font-cursive);
    font-size: 1.5rem;
    line-height: 1.4;
    color: #4a1525;
    margin-bottom: 20px;
    font-weight: 700;
}

.voucher-code-wrapper {
    font-size: 0.8rem;
    color: #8c3b53;
    letter-spacing: 1px;
}

.voucher-code {
    display: inline-block;
    background: #ff758c;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 5px;
    letter-spacing: 2px;
}

.voucher-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
}

.action-btn {
    background: linear-gradient(135deg, var(--pink-primary) 0%, #e6195e 100%);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 42, 116, 0.4);
    transition: all 0.3s;
    outline: none;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 42, 116, 0.6);
}

.action-btn:active {
    transform: translateY(0);
}

/* Responsiveness */
@media (max-width: 600px) {
    .birthday-title {
        font-size: 2.2rem;
    }
    .subtitle {
        font-size: 0.95rem;
    }
    .gift-box-wrapper {
        width: 170px;
        height: 220px;
    }
    .gift-box {
        width: 170px;
        height: 170px;
    }
    .gift-lid {
        width: 180px;
        left: -5px;
    }
    .gift-body {
        width: 170px;
        height: 155px;
    }
    .car-popup {
        height: 250px;
    }
    .car-text {
        font-size: 1.1rem;
    }
    .voucher-card {
        padding: 25px 15px;
    }
    .personal-msg {
        font-size: 1.3rem;
    }
}
