/* ═══════════════════════════════════════════════════════════
   APPLE DESIGN SYSTEM 2025
   Ultra-Premium Experience
   ═══════════════════════════════════════════════════════════ */

:root {
    --ios-font: -apple-system, blinkmacsystemfont, "SF Pro Display", "SF Pro Text", sans-serif;
    --ios-bg: #000;
    --ios-text: #fff;
}

/* ═══════════════════════════════════════════════════════════
   PREMIUM NOTIFICATION (Maintains the structure you liked)
   ═══════════════════════════════════════════════════════════ */

/* ...Keeping the notification styles as you said they were perfect... */
.birthday-notification {
    position: fixed;
    z-index: 999999;
    width: 92%;
    max-width: 380px;
    background: rgb(255 255 255 / 65%);
    backdrop-filter: blur(50px) saturate(180%);
    backdrop-filter: blur(50px) saturate(180%);
    border-radius: 22px;
    padding: 20px 24px;

    /* Increased padding as requested */
    box-shadow: 0 8px 32px 0 rgb(0 0 0 / 12%);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    border: 1px solid rgb(255 255 255 / 30%);
    cursor: default;
    user-select: none;

    /* Mobile Default: Top Center */
    top: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    animation: iosSlideInMobile 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

html.dark .birthday-notification {
    background: rgb(30 30 30 / 65%);
    border: 1px solid rgb(255 255 255 / 8%);
    box-shadow: 0 10px 40px rgb(0 0 0 / 40%);
}

/* Mobile Animation */
@keyframes iosSlideInMobile {
    to {
        transform: translateX(-50%) translateY(0);
    }
}

/* Desktop Overrides: Top Right */
@media screen and (width >=769px) {
    .birthday-notification {
        top: 110px;
        right: 24px;
        left: auto;
        transform: translateX(120%);

        /* Start off-screen right */
        animation: iosSlideInDesktop 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
    }
}

@keyframes iosSlideInDesktop {
    to {
        transform: translateX(0);
    }
}

/* Header Elements */
.ios-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.ios-icon-container {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
}

.ios-calendar-icon {
    width: 100%;
    height: 100%;
    position: relative;
    background: #fff;
}

.ios-calendar-header {
    height: 6px;
    background: #ff3b30;
    width: 100%;
    position: absolute;
    top: 0;
}

.ios-calendar-date {
    font-size: 11px;
    font-weight: 700;
    color: #1d1d1f;
    position: absolute;
    top: 7px;
    left: 0;
    right: 0;
    text-align: center;
}

.ios-app-name {
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    color: #000;
    letter-spacing: 0.2px;
    flex: 1;
}

.ios-time {
    font-size: 13px;
    color: #3c3c43;
    opacity: 0.6;
}

html.dark .ios-app-name {
    color: #fff;
}

html.dark .ios-time {
    color: #ebebf5;
}

.ios-title {
    font-size: 15px;
    font-weight: 600;
    color: #000;
    margin-bottom: 2px;
}

.ios-body {
    font-size: 15px;
    color: #000;
}

html.dark .ios-title,
html.dark .ios-body {
    color: #fff;
}

/* Close Button Removed as per User Request for cleaner UI */

html.dark .birthday-notification {
    background: rgb(28 28 30 / 98%);
    border: 1px solid rgb(255 255 255 / 10%);
    box-shadow: 0 20px 60px rgb(0 0 0 / 80%);
}

/* ═══════════════════════════════════════════════════════════
   2025 CELEBRATION OVERLAY
   Canvas-based high performance rendering
   ═══════════════════════════════════════════════════════════ */

.birthday-celebration {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: default;
}

/* 1. Cinematic Background */
.birthday-bg-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(circle at 50% 120%, #1a0b2e, #000 80%);
}

.aurora-gradient {
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(circle at 20% 50%, rgb(70 0 255 / 15%), transparent 50%),
        radial-gradient(circle at 80% 30%, rgb(200 0 100 / 15%), transparent 40%);
    filter: blur(60px);
    animation: auroraMove 15s infinite alternate ease-in-out;
    opacity: 0;
    animation-fill-mode: forwards;
    animation-name: auroraIn, auroraMove;
    animation-duration: 2s, 20s;
    animation-delay: 0s, 2s;
}

@keyframes auroraIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes auroraMove {
    0% {
        transform: rotate(0deg) scale(1);
    }

    100% {
        transform: rotate(5deg) scale(1.1);
    }
}

/* 2. Physics Canvas Layer */
#celebration-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;

    /* Let clicks pass through to button */
}

/* 3. Typography - Apple TV Style (High Contrast) */
.birthday-hero {
    z-index: 20;
    position: relative;
    text-align: center;
    font-family: var(--ios-font);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;

    /* Removed mix-blend-mode to prevent washed out text */
}

/* Effect: "Typewriter" Reveal */
.hero-title {
    font-size: clamp(4rem, 15vw, 9rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 1.2s cubic-bezier(0.2, 1, 0.3, 1) forwards 0.5s;

    /* High contrast drop shadow */
    text-shadow: 0 10px 40px rgb(0 0 0 / 50%);
}

.hero-subtitle {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 500;
    color: rgb(255 255 255 / 80%);
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 1.2s cubic-bezier(0.2, 1, 0.3, 1) forwards 0.8s;
}

.hero-badge {
    margin-top: 10px;
    padding: 8px 20px;
    background: rgb(255 255 255 / 10%);
    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    color: rgb(255 255 255 / 90%);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: scale(0.9);
    animation: heroReveal 1.2s cubic-bezier(0.2, 1, 0.3, 1) forwards 1.1s;
}

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 4. Action Button - Apple Glass */
.action-area {
    margin-top: 60px;
    z-index: 30;
    opacity: 0;
    animation: fadeIn 1s ease forwards 2s;
}

.glass-btn {
    background: rgb(255 255 255 / 15%);
    border: 1px solid rgb(255 255 255 / 30%);
    padding: 16px 40px;
    border-radius: 100px;
    color: white;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;

    /* Mobile polish */
}

.glass-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 40%), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.glass-btn:hover,
.glass-btn:active {
    transform: scale(1.05);
    background: rgb(255 255 255 / 25%);
    box-shadow: 0 0 30px rgb(255 255 255 / 30%);
}

.glass-btn:hover::before {
    transform: translateX(100%);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

html.dark .birthday-notification {
    background: rgb(28 28 30 / 98%);
    border: 1px solid rgb(255 255 255 / 10%);
    box-shadow: 0 20px 60px rgb(0 0 0 / 80%);
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-120px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: translateX(-50%) translateY(0) scale(1);
    }

    50% {
        transform: translateX(-50%) translateY(0) scale(1.02);
    }
}

/* Calendar Icon */
.birthday-calendar-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.birthday-calendar-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 18px;
    background: #ff3b30;
    border-radius: 12px 12px 0 0;
}

.calendar-month {
    font-size: 10px;
    font-weight: 700;
    color: #ff3b30;
    text-transform: uppercase;
    margin-top: 20px;
    letter-spacing: 0.5px;
}

.calendar-day {
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1;
    margin-top: -2px;
}

/* Notification Text */
.birthday-notification-content {
    flex: 1;
}

.birthday-notification-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 4px;
}

html.dark .birthday-notification-title {
    color: #fff;
}

.birthday-notification-subtitle {
    font-size: 14px;
    color: #86868b;
    margin: 0;
}

/* Close Button - FIXED VISIBILITY */
.birthday-notification-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgb(120 120 128 / 16%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    color: #000;
}

.birthday-notification-close:hover {
    background: rgb(120 120 128 / 24%);
    transform: scale(1.1);
}

.birthday-notification-close svg {
    width: 12px;
    height: 12px;
    fill: currentcolor;
}

html.dark .birthday-notification-close {
    background: rgb(120 120 128 / 24%);
    color: #fff;
}

html.dark .birthday-notification-close:hover {
    background: rgb(120 120 128 / 36%);
}

/* ═══════════════════════════════════════════════════════════
   BIRTHDAY CELEBRATION OVERLAY (Dec 7) - iMessage Style
   ═══════════════════════════════════════════════════════════ */

.birthday-celebration {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: fadeIn 1s ease-out, bgShift 15s ease-in-out infinite;
}

/* Light Mode - Bright Celebration */
html:not(.dark) .birthday-celebration {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 25%, #667eea 50%, #764ba2 75%, #f093fb 100%);
    background-size: 400% 400%;
}

/* Dark Mode - Elegant Deep Gradient */
html.dark .birthday-celebration {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #1a1a2e 100%);
    background-size: 400% 400%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes bgShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Birthday Message */
.birthday-message {
    text-align: center;
    color: white;
    z-index: 10;
    animation: scaleIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards,
        float 3s ease-in-out 1.5s infinite;
}

@keyframes scaleIn {
    from {
        transform: scale(0.5) translateY(50px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.birthday-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    margin: 0 0 20px;
    background: linear-gradient(45deg, #fff, #ffd700, #fff, #ffd700);
    background-size: 300% 300%;
    background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
    text-shadow: 0 0 40px rgb(255 215 0 / 50%);
    filter: drop-shadow(0 4px 20px rgb(255 215 0 / 30%));
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.birthday-subtitle {
    font-size: clamp(1.2rem, 4vw, 2rem);
    margin: 0 0 30px;
    opacity: 0.95;
    font-weight: 500;
    text-shadow: 0 2px 10px rgb(0 0 0 / 30%);
}

.birthday-age {
    font-size: clamp(1rem, 3vw, 1.5rem);
    opacity: 0.9;
    margin: 0 0 40px;
    font-weight: 600;
    text-shadow: 0 2px 10px rgb(0 0 0 / 30%);
}

/* Cake Animation - iMessage Style */
.birthday-cake {
    font-size: clamp(4rem, 15vw, 8rem);
    animation: cakeBounce 1s ease-in-out 1.2s backwards,
        rotate 3s ease-in-out 2s infinite,
        shadowPulse 2s ease-in-out 2s infinite;
    filter: drop-shadow(0 10px 30px rgb(0 0 0 / 30%));
}

@keyframes cakeBounce {
    0% {
        transform: translateY(-200px) scale(0) rotate(-180deg);
        opacity: 0;
    }

    50% {
        transform: translateY(20px) scale(1.1) rotate(10deg);
    }

    70% {
        transform: translateY(-10px) scale(0.95) rotate(-5deg);
    }

    100% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes rotate {

    0%,
    100% {
        transform: rotate(-5deg) scale(1);
    }

    50% {
        transform: rotate(5deg) scale(1.05);
    }
}

@keyframes shadowPulse {

    0%,
    100% {
        filter: drop-shadow(0 10px 30px rgb(0 0 0 / 30%));
    }

    50% {
        filter: drop-shadow(0 15px 40px rgb(255 215 0 / 50%));
    }
}

/* Continue Button - Apple Style */
.birthday-continue-btn {
    margin-top: 40px;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgb(0 0 0 / 20%);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: fadeInUp 0.6s ease-out 2s backwards,
        btnPulse 2s ease-in-out 3s infinite;
}

html.dark .birthday-continue-btn {
    background: #fff;
    color: #1a1a2e;
    box-shadow: 0 10px 30px rgb(0 0 0 / 50%);
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes btnPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgb(0 0 0 / 20%);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgb(255 215 0 / 40%);
    }
}

.birthday-continue-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgb(0 0 0 / 30%);
}

.birthday-continue-btn:active {
    transform: translateY(-2px) scale(1.02);
}

html.dark .birthday-continue-btn:hover {
    box-shadow: 0 15px 40px rgb(255 255 255 / 20%);
}

/* ═══════════════════════════════════════════════════════════
   CONFETTI ANIMATION
   ═══════════════════════════════════════════════════════════ */

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffd700;
    animation: confettiFall linear infinite;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.confetti:nth-child(1) {
    left: 10%;
    animation-duration: 3s;
    animation-delay: 0s;
    background: #ff6b6b;
}

.confetti:nth-child(2) {
    left: 20%;
    animation-duration: 2.5s;
    animation-delay: 0.2s;
    background: #4ecdc4;
}

.confetti:nth-child(3) {
    left: 30%;
    animation-duration: 3.5s;
    animation-delay: 0.4s;
    background: #ffd700;
}

.confetti:nth-child(4) {
    left: 40%;
    animation-duration: 2.8s;
    animation-delay: 0.1s;
    background: #95e1d3;
}

.confetti:nth-child(5) {
    left: 50%;
    animation-duration: 3.2s;
    animation-delay: 0.3s;
    background: #ff6b6b;
}

.confetti:nth-child(6) {
    left: 60%;
    animation-duration: 2.6s;
    animation-delay: 0.5s;
    background: #4ecdc4;
}

.confetti:nth-child(7) {
    left: 70%;
    animation-duration: 3.3s;
    animation-delay: 0.2s;
    background: #ffd700;
}

.confetti:nth-child(8) {
    left: 80%;
    animation-duration: 2.9s;
    animation-delay: 0.4s;
    background: #95e1d3;
}

.confetti:nth-child(9) {
    left: 90%;
    animation-duration: 3.1s;
    animation-delay: 0.1s;
    background: #ff6b6b;
}

.confetti:nth-child(10) {
    left: 15%;
    animation-duration: 2.7s;
    animation-delay: 0.6s;
    background: #4ecdc4;
}

/* ═══════════════════════════════════════════════════════════
   BALLOONS
   ═══════════════════════════════════════════════════════════ */

.balloon {
    position: absolute;
    bottom: -100px;
    font-size: 3rem;
    animation: balloonFloat 4s ease-in-out infinite;
}

@keyframes balloonFloat {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

.balloon:nth-child(1) {
    left: 5%;
    animation-delay: 0s;
    animation-duration: 3.5s;
}

.balloon:nth-child(2) {
    left: 15%;
    animation-delay: 0.5s;
    animation-duration: 4s;
}

.balloon:nth-child(3) {
    left: 85%;
    animation-delay: 1s;
    animation-duration: 3.8s;
}

.balloon:nth-child(4) {
    left: 95%;
    animation-delay: 0.3s;
    animation-duration: 4.2s;
}

/* ═══════════════════════════════════════════════════════════
   FIREWORKS
   ═══════════════════════════════════════════════════════════ */

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: fireworkExplode 1.5s ease-out infinite;
}

@keyframes fireworkExplode {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(1);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   SPARKLES
   ═══════════════════════════════════════════════════════════ */

.sparkle {
    position: absolute;
    font-size: 1.5rem;
    animation: sparkleFloat 2s ease-in-out infinite;
    opacity: 0;
}

@keyframes sparkleFloat {

    0%,
    100% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-50px) scale(1);
    }
}

.sparkle:nth-child(odd) {
    animation-delay: 0s;
}

.sparkle:nth-child(even) {
    animation-delay: 1s;
}

/* ═══════════════════════════════════════════════════════════
   FADE OUT ANIMATION
   ═══════════════════════════════════════════════════════════ */

.birthday-celebration.fade-out {
    animation: fadeOut 1s ease-in forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════ */

@media (width <=768px) {
    .birthday-notification {
        max-width: calc(100% - 20px);
        padding: 12px 16px;
        top: 10px;
    }

    .birthday-calendar-icon {
        width: 50px;
        height: 50px;
    }

    .calendar-day {
        font-size: 24px;
    }

    .birthday-notification-title {
        font-size: 14px;
    }

    .birthday-notification-subtitle {
        font-size: 12px;
    }

    .birthday-cake {
        font-size: 4rem;
    }

    .birthday-continue-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

    .birthday-notification,
    .birthday-celebration,
    .confetti,
    .balloon,
    .firework,
    .sparkle,
    .birthday-cake {
        animation: none !important;
    }

    .birthday-title {
        -webkit-text-fill-color: white;
    }
}