/* Base & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: #ffdde1;
    overflow: hidden; /* App like */
}

/* Page transitions */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
    background: linear-gradient(135deg, #ffdde1 0%, #ee9ca7 100%);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.page.active {
    opacity: 1;
    pointer-events: auto;
}

/* PAGE 1 CONTENT */
#emoji-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.emoji {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s;
    animation: floatUp linear infinite forwards;
    bottom: -80px;
    opacity: 0.8;
}

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    5% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(-120vh) rotate(360deg); opacity: 0; }
}

.burst-particle {
    position: fixed;
    font-size: 16px;
    pointer-events: none;
    animation: burst 1s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    z-index: 2;
}

@keyframes burst {
    0% { transform: scale(0.5) translate(0, 0); opacity: 1; }
    100% { transform: scale(1.5) translate(var(--tx), var(--ty)); opacity: 0; }
}

.content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    padding: 20px;
}

.message-box {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 8px 32px rgba(238, 156, 167, 0.3);
    color: #5c183a;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    font-size: 15px;
}

.message-box p {
    margin-bottom: 12px;
}

.message-box .love {
    font-weight: 800;
    color: #d81b60;
    font-size: 18px;
    margin-bottom: 0;
    margin-top: 15px;
}

.form-section {
    width: 100%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input[type="text"] {
    width: 100%;
    padding: 15px 20px;
    border-radius: 30px;
    border: 2px solid rgba(255,255,255,0.8);
    background: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    outline: none;
    text-align: center;
    color: #d81b60;
    font-weight: bold;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

input[type="text"]::placeholder {
    color: #c48b9f;
    font-weight: 500;
}

input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: #d81b60;
    box-shadow: 0 0 15px rgba(216, 27, 96, 0.3);
}

button {
    width: 100%;
    padding: 15px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(to right, #ff4b2b, #ff416c);
    color: white;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(255, 65, 108, 0.3);
}

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

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 85%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content p {
    color: #444;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    white-space: pre-wrap;
    font-weight: 500;
}

#modalOkBtn {
    width: auto;
    padding: 12px 35px;
    border-radius: 25px;
}

/* PAGE 2 CONTENT */
.celebration-content {
    position: relative;
    z-index: 2;
    padding: 40px 20px 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: max-content;
}

.happy-birthday {
    font-size: 38px;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 10px #ff416c, 0 0 20px #ff416c;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 1s ease-out;
    font-weight: 800;
    letter-spacing: 2px;
}

.page.active .happy-birthday {
    opacity: 1;
    transform: translateY(0);
}

.name-animate {
    font-size: 20vw; /* Scales with screen width, roughly 80px */
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(255,255,255,0.8);
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    letter-spacing: 1px;
}

.name-animate span {
    display: inline-block;
    opacity: 0;
}

.p-zoom {
    opacity: 1;
    line-height: 1;
    transform-origin: center;
    animation: pZoom 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes pZoom {
    0% { transform: scale(3); opacity: 0; color: #ffebb5; text-shadow: 0 0 50px #fff; }
    40% { transform: scale(1); opacity: 1; color: #fff; text-shadow: 0 0 20px rgba(255,255,255,0.9); }
    100% { transform: scale(1); opacity: 1; color: #fff; text-shadow: 0 0 15px rgba(255,255,255,0.8); }
}

.letter-appear {
    animation: letterFade 0.6s ease-out forwards;
}

@keyframes letterFade {
    0% { opacity: 0; transform: translateX(30px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* Audio Player (WhatsApp Style) */
.audio-player {
    background: #e1ffc7; /* WhatsApp Voice Note color */
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 40px;
}

.play-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #075e54;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    margin-right: 15px;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.progress-bar {
    flex-grow: 1;
    height: 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    margin-right: 15px;
}

.progress {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: #25d366;
    border-radius: 2px;
    width: 0%;
}

.thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: #075e54;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.time-display {
    font-size: 13px;
    color: #4a4a4a;
    font-weight: 600;
    min-width: 35px;
}

/* Letter Section */
.letter-box {
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 25px;
    width: 100%;
    max-width: 400px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(238, 156, 167, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.letter-box p {
    color: #4a154b;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 18px;
    font-weight: 500;
}

.letter-box p:last-child {
    margin-bottom: 0;
}

.final-wish {
    font-size: 24px;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
    margin-bottom: 12px;
    line-height: 1.4;
    font-weight: 700;
}

.final-love {
    font-size: 28px;
    color: #d81b60;
    text-align: center;
    text-shadow: 0 2px 10px rgba(255,255,255,0.9);
    margin-bottom: 50px;
    font-weight: 800;
}

#closeBtn {
    background: linear-gradient(to right, #e91e63, #c2185b);
    max-width: 250px;
    font-size: 18px;
    box-shadow: 0 5px 20px rgba(233, 30, 99, 0.5);
    padding: 18px;
}

/* Page 2 Effects */
.bg-elements {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

.sparkle {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 15px #fff; }
}

/* COUNTDOWN PAGE */
#countdownPage {
    background: linear-gradient(135deg, #1a0011 0%, #3d0028 30%, #6b0044 60%, #d81b60 100%);
}

#countdown-hearts-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.countdown-heart {
    position: absolute;
    bottom: -50px;
    animation: floatUpSlow linear infinite;
    opacity: 0.3;
    font-size: 20px;
}

@keyframes floatUpSlow {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.15; }
    100% { transform: translateY(-110vh) rotate(30deg); opacity: 0; }
}

.countdown-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    padding: 30px 20px;
    text-align: center;
}

.countdown-emoji {
    font-size: 50px;
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.countdown-title {
    font-size: 22px;
    color: #fff;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 15px rgba(255, 105, 180, 0.6);
    letter-spacing: 0.5px;
}

.countdown-subtitle {
    font-size: 13px;
    color: rgba(255, 200, 220, 0.9);
    line-height: 1.5;
    margin-bottom: 20px;
    font-weight: 500;
}

.countdown-days-row {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.days-block {
    min-width: 110px;
    padding: 14px 25px;
}

.days-value {
    font-size: 48px;
}

.countdown-time-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.timer-block {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 12px 10px;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 20px rgba(216, 27, 96, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

.timer-value {
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.8);
}

.timer-label {
    font-size: 11px;
    color: rgba(255, 200, 220, 0.8);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 6px;
    font-weight: 600;
}

.timer-separator {
    font-size: 30px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 800;
    padding-bottom: 15px;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.countdown-footer {
    font-size: 14px;
    color: rgba(255, 200, 220, 0.85);
    margin-bottom: 15px;
    font-weight: 500;
}

.countdown-quote {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    font-weight: 500;
    max-width: 300px;
}

.countdown-form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    margin-bottom: 15px;
}

.countdown-form input[type="text"] {
    flex: 1;
    padding: 14px 18px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 15px;
    outline: none;
    text-align: center;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s ease;
}

.countdown-form input[type="text"]::placeholder {
    color: rgba(255, 200, 220, 0.5);
    font-weight: 400;
}

.countdown-form input[type="text"]:focus {
    border-color: rgba(255, 105, 180, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.3);
}

#countdownGoBtn {
    width: 60px;
    padding: 14px 0;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, #e91e63, #d81b60);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

#countdownGoBtn:active {
    transform: scale(0.92);
}

.countdown-attempt {
    display: none;
}
