:root {
    --primary-color: #ff4d8d;
    --accent-color: #ff7e5f;
    --text-color: #444;
    --light-bg: rgba(255, 255, 255, 0.9);
    --shadow: 0 10px 32px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(-45deg, #ff7e5f, #ff4d8d, #2ab7ca, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-color);
    overflow-x: hidden;
    position: relative;
    animation: fadeIn 1.2s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Floating balloons */
.floating-hearts {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: auto;

}

.balloon {
    position: absolute;
    width: 40px;
    height: 50px;
    border-radius: 50%;
    animation: float 10s infinite ease-in-out;
    opacity: 0;
    cursor: pointer;
    transform-origin: bottom center;
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.1);

}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 2px;
    height: 15px;
    background: rgba(0,0,0,0.2);
    transform: translateX(-50%);
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 0.9;
    }
    50% {
        transform: translateY(50vh) translateX(20px) scale(1);
    }
    80% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-10vh) translateX(-20px) scale(1.1);
        opacity: 0;
    }
}

@keyframes pop {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

.balloon-pop {
    animation: pop 0.4s ease-out forwards;
}

/* Password container and card */
#password-container, .greeting-card {
    background-color: var(--light-bg);
    padding: 2.5rem 3rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    max-width: 500px;
    width: 90%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeIn 0.8s ease-out;
    position: relative;
    z-index: 10;
    margin: 2rem;
}

h1 {
    font-family: 'Pacifico', cursive;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

@keyframes fa-fade {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.instruction {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 300;
    text-align: center;
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="date"] {
    width: 100%;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.8rem;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    color: var(--text-color);
    cursor: pointer;
}

input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(231, 60, 126, 0.3);
}

button {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.error {
    color: #ff3860;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    height: 1.2rem;
}


.highlight {
    background-color: var(--accent-color);
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: 0.3rem;
    font-weight: bold;
    font-family: 'Poppins', serif;
    font-size: 1.1rem;
    animation: infinite-pulse 1.5s ease-in-out;

    @keyframes infinite-pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }
    
}

/* Birthday content */
#birthday-content {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.greeting-card {
    max-width: 800px;
    margin-bottom: 2rem;
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
    opacity: 0;
    animation-delay: 0.3s;
}

.card-header {
    margin-bottom: 1.5rem;
    position: relative;
}

.photo-frame {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 0 30px rgba(255, 77, 141, 0.4);
    overflow: hidden;
    margin: -90px auto 1.5rem;
    position: relative;
    background: linear-gradient(45deg, #f3f3f3, #e0e0e0);
}

.photo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.signature {
    margin-top: 0rem;
    font-style: italic;
}

.signature .name {
    font-family: 'Pacifico', cursive;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: -0.5rem;
}

.birthday-message {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    margin: 1.5rem 0;
    text-align: left;
    font-weight: 300;
}

.birthday-message p {
    margin-bottom: 1.2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.birthday-message p:last-child {
    font-family: 'Pacifico', cursive;
    font-size: 1.3rem;
    color: var(--primary-color);
    text-align: center;
}

/* Animations */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .instruction {
        font-size: 1rem;
    }

    input[type="date"], button {
        padding: 0.9rem 1rem;
        font-size: 1rem;
    }

    button {
        padding: 0.9rem 1.5rem;
    }

    .photo-frame {
        width: 120px;
        height: 120px;
        margin-top: -70px;
    }
}

@media (max-width: 480px) {
    #password-container, .greeting-card {
        padding: 1.8rem 1rem;
        margin: 0.4rem;
        width: calc(100% - 0.8rem);
    }

    h1 {
        font-size: 1.8rem;
    }

    .instruction {
        font-size: 0.95rem;
    }

    input[type="date"], button {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    button {
        padding: 0.8rem 1.2rem;
    }

    .photo-frame {
        width: 100px;
        height: 100px;
        margin-top: -50px;
    }
}