/* ============================================
   Birthday Animation Styles
   ============================================ */

/* Overlay container */
.birthday-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 1s ease;
}

.birthday-overlay.active {
    opacity: 1;
}

.birthday-overlay.fade-out {
    opacity: 0;
    transition: opacity 1s ease;
}

/* Birthday message */
.birthday-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10000;
    animation: messageZoom 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.birthday-overlay.active .birthday-message {
    animation: messageZoom 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55), 
               messageFadeUp 0.5s ease 5.5s forwards;
}

/* Personal message */
.personal-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.8s ease;
    max-width: 90%;
    padding: 0 20px;
}

.personal-message.show {
    opacity: 1;
}

.message-text {
    font-size: 28px;
    line-height: 1.6;
    color: #fff;
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.4),
        2px 2px 6px rgba(0, 0, 0, 0.5);
    font-weight: 500;
    background: rgba(0, 0, 0, 0.3);
    padding: 30px 40px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.birthday-title {
    font-size: 48px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 215, 0, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    animation: glow 1.5s ease-in-out infinite alternate;
}

.birthday-name {
    font-size: 72px;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b9d, #c44569, #f8b500, #5f27cd);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
    animation: gradientShift 3s ease infinite;
    filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.5));
}

.birthday-date {
    font-size: 24px;
    color: #fff;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.5),
        2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
    margin-top: 15px;
    opacity: 0.95;
}

/* Balloons */
.balloon {
    position: absolute;
    bottom: -150px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: floatUp 6s ease-in forwards;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    opacity: 0.9;
}

.balloon::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid inherit;
}

.balloon::after {
    content: '✨';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    animation: sparkle 1s ease-in-out infinite alternate;
}

.balloon-string {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
    animation: floatUp 6s ease-in forwards;
}

/* Confetti */
.confetti {
    position: absolute;
    top: -20px;
    animation: confettiFall 4s linear forwards;
    opacity: 0.9;
    border-radius: 2px;
}

/* Animations */
@keyframes floatUp {
    0% {
        bottom: -150px;
        opacity: 0;
        transform: translateX(0) rotate(0deg);
    }
    10% {
        opacity: 0.9;
    }
    100% {
        bottom: 110%;
        opacity: 0;
        transform: translateX(calc(var(--float-x, 0) * 30px)) rotate(var(--rotate, 10deg));
    }
}

@keyframes confettiFall {
    0% {
        top: -20px;
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
    100% {
        top: 110%;
        opacity: 0;
        transform: translateX(calc(var(--drift, 0) * 100px)) rotate(720deg);
    }
}

@keyframes messageZoom {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes messageFadeUp {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -80%) scale(0.9);
        opacity: 0;
    }
}

@keyframes glow {
    0% {
        text-shadow: 
            0 0 10px rgba(255, 215, 0, 0.8),
            0 0 20px rgba(255, 215, 0, 0.6),
            0 0 30px rgba(255, 215, 0, 0.4),
            2px 2px 4px rgba(0, 0, 0, 0.3);
    }
    100% {
        text-shadow: 
            0 0 20px rgba(255, 215, 0, 1),
            0 0 30px rgba(255, 215, 0, 0.8),
            0 0 40px rgba(255, 215, 0, 0.6),
            2px 2px 4px rgba(0, 0, 0, 0.3);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes sparkle {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Add random variations */
.balloon:nth-child(2n) {
    --float-x: -1;
    --rotate: -15deg;
}

.balloon:nth-child(3n) {
    --float-x: 1;
    --rotate: 20deg;
}

.confetti:nth-child(2n) {
    --drift: -1;
}

.confetti:nth-child(3n) {
    --drift: 1;
}

.confetti:nth-child(4n) {
    --drift: 0.5;
}

.confetti:nth-child(5n) {
    --drift: -0.5;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .birthday-title {
        font-size: 32px;
    }
    
    .birthday-name {
        font-size: 48px;
    }
    
    .birthday-date {
        font-size: 18px;
    }
    
    .message-text {
        font-size: 20px;
        padding: 20px 25px;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .birthday-title {
        font-size: 24px;
    }
    
    .birthday-name {
        font-size: 36px;
    }
    
    .birthday-date {
        font-size: 14px;
    }
    
    .message-text {
        font-size: 16px;
        padding: 15px 20px;
    }
}
