* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

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

/* Floating Particles */
.particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    pointer-events: none;
    animation: float 20s infinite;
    z-index: 1;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Fireworks Effect */
.firework-particle {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2001;
    opacity: 1;
    transition: transform 1.5s ease-out, opacity 1.5s ease-out;
    will-change: transform, opacity;
}

/* Confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #ffd700;
    pointer-events: none;
    animation: confettiFall 8s linear infinite;
    z-index: 2;
}

.confetti:nth-child(odd) {
    background: #ff6b6b;
    width: 8px;
    height: 15px;
}

.confetti:nth-child(3n) {
    background: #4ecdc4;
    width: 12px;
    height: 8px;
}

.confetti:nth-child(4n) {
    background: #95e1d3;
    width: 6px;
    height: 12px;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(100px) rotate(720deg);
        opacity: 0;
    }
}

/* Countdown Overlay */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden;
    touch-action: none;
}

.countdown-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.countdown-content {
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    width: 90%;
    position: relative;
    z-index: 2001;
}

.countdown-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 2rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.countdown-decoration {
    display: inline-block;
    font-size: 2.5rem;
    animation: countdownDecoFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    opacity: 0.8;
}

.countdown-deco-left {
    animation-delay: 0s;
}

.countdown-deco-right {
    animation-delay: 1.5s;
}

@keyframes countdownDecoFloat {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-10px) scale(1.2) rotate(180deg);
        opacity: 1;
    }
}

.countdown-cap {
    display: inline-block;
    font-size: 2.5rem;
    animation: bounce 2s infinite;
    margin-left: 0.5rem;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.time-unit {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 1.5rem 1.2rem;
    min-width: 100px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.time-unit:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.3),
        inset 0 0 30px rgba(255, 215, 0, 0.2);
}

.time-value {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.time-label {
    display: block;
    font-size: 1rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.open-invitation-btn {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 1.2rem 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease-out 0.6s both;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.open-invitation-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(102, 126, 234, 0.5),
        inset 0 0 30px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.open-invitation-btn:active {
    transform: translateY(-1px) scale(1.02);
}

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

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

/* Prevent body scroll when countdown overlay is visible */
body:has(.countdown-overlay:not(.hidden)) {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Envelope Cover - Modern Design */
.envelope-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden;
    /* Prevent scrolling on overlay */
    touch-action: none;
}

/* Prevent body scroll when overlay is visible */
body:has(.envelope-overlay:not(.hidden)) {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

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

.envelope-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.envelope-container {
    position: relative;
    width: 450px;
    height: 350px;
    cursor: pointer;
    perspective: 1200px;
    padding-bottom: 1rem;
}

.envelope {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.2s ease;
}

.envelope.opened {
    transform: translateY(-120px) scale(0.85) rotateX(-5deg);
}

.envelope-body {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff9e6 0%, #ffedcc 50%, #ffe6b3 100%);
    border-radius: 20px;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(255, 215, 0, 0.4),
        inset 0 0 100px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    padding: 3.5rem 2.5rem 4rem 2.5rem;
    z-index: 2;
    overflow: visible;
    border: 3px solid rgba(255, 215, 0, 0.5);
    position: relative;
}

.envelope-body > * {
    position: relative;
    z-index: 5;
    width: 100%;
}

.envelope-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.1) 20px,
            rgba(255, 255, 255, 0.1) 40px
        ),
        radial-gradient(circle at 30% 30%, rgba(255, 215, 0, 0.3) 0%, transparent 50%);
    border-radius: 20px;
    opacity: 0.6;
    z-index: 1;
}

.envelope-body::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #ffd700, #ffed4e, #ffd700, #fff9e6);
    background-size: 400% 400%;
    border-radius: 20px;
    z-index: -1;
    animation: borderGlow 3s ease infinite;
    opacity: 0.7;
}

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

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 42%;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    background-size: 200% 200%;
    border-radius: 20px 20px 0 0;
    transform-origin: top center;
    transform: rotateX(0deg);
    transition: transform 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 3;
    box-shadow: 
        0 -8px 30px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(255, 215, 0, 0.4),
        inset 0 0 60px rgba(255, 255, 255, 0.2);
    pointer-events: auto;
    border: 3px solid rgba(255, 215, 0, 0.6);
    border-bottom: none;
    animation: flapShimmer 3s ease infinite;
}

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

.envelope-flap::before {
    content: '✉️';
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    opacity: 0.9;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: envelopeIconFloat 3s ease-in-out infinite;
}

@keyframes envelopeIconFloat {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-8px); }
}

.envelope-flap::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(255, 215, 0, 0.2) 50%, transparent 100%);
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.envelope.opened .envelope-flap {
    transform: rotateX(-180deg);
}


.envelope-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
    animation: envelopeBounce 2.5s ease-in-out infinite;
    position: relative;
    z-index: 5;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}


@keyframes envelopeBounce {
    0%, 100% { 
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    }
    50% { 
        transform: translateY(-12px) scale(1.05);
        filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
    }
}

.envelope-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.6rem;
    margin-top: 0;
    font-weight: 700;
    text-shadow: 
        0 2px 4px rgba(255, 255, 255, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 5;
    line-height: 1.3;
    letter-spacing: 0.5px;
}


@keyframes titleGlow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

.envelope-message {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    margin-top: 0;
    font-weight: 500;
    position: relative;
    z-index: 5;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    text-align: center;
}



.click-to-open {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    border: 3px solid #ffd700;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    animation: buttonPulse 2s infinite;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: auto;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(255, 215, 0, 0.6);
    }
    50% {
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2), 0 0 0 10px rgba(255, 215, 0, 0);
    }
}

.click-to-open:hover {
    background: #ffd700;
    color: #1a1a1a;
    transform: translateX(-50%) translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
    animation: none;
    border-color: #ffed4e;
}

.envelope-container:hover .envelope {
    transform: scale(1.05);
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 10;
    display: block;
    will-change: opacity, transform;
}

.container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.98);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

.container.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
    animation: none;
    transition: opacity 0.6s ease-out 0.15s, visibility 0.6s ease-out 0.15s, transform 0.6s ease-out 0.15s;
}

/* Hide container when countdown or envelope overlay is visible */
body:has(.countdown-overlay:not(.hidden)) .container,
body:has(.envelope-overlay:not(.hidden)) .container {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: scale(0.95) !important;
}

/* Invitation Card */
.invitation-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 30px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 215, 0, 0.2);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.99);
    margin-top: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.6s ease-out 0.4s, transform 0.6s ease-out 0.4s;
    will-change: opacity, transform;
}

.container.show .invitation-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.invitation-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), 0 0 60px rgba(255, 215, 0, 0.3);
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.invitation-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.card-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.card-header .icon {
    font-size: 4rem;
    color: #ffd700;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

/* Graduate Photo Container */
.graduate-photo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease-out 0.1s both;
}

.graduate-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 5px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2),
                0 0 0 10px rgba(255, 215, 0, 0.1),
                0 0 0 20px rgba(118, 74, 162, 0.05);
    transition: all 0.3s ease;
    animation: photoFloat 3s ease-in-out infinite;
    margin-top: 25px;
}

.graduate-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3),
                0 0 0 10px rgba(255, 215, 0, 0.15),
                0 0 0 20px rgba(118, 74, 162, 0.1);
}

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

.graduation-cap {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 6rem;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3))
            drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
    animation: capBounce 2s ease-in-out infinite, capGlow 3s ease-in-out infinite;
    z-index: 3;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    transition: all 0.3s ease;
}

.graduation-cap:hover {
    transform: translateX(-50%) scale(1.1);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4))
            drop-shadow(0 0 30px rgba(255, 215, 0, 0.6));
}

@keyframes capBounce {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(-2deg); }
    50% { transform: translateX(-50%) translateY(-8px) rotate(2deg); }
}

@keyframes capGlow {
    0%, 100% { 
        filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3))
                drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    50% { 
        filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4))
                drop-shadow(0 0 30px rgba(255, 215, 0, 0.7));
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

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

.card-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    animation: fadeInUp 1s ease-out 0.3s both;
}

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

.card-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
    animation: fadeInUp 1s ease-out 0.5s both;
}

/* Content Sections */
.content-section {
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out 0.7s both;
}

/* Decorative separator - commented out */
/* .content-section::after,
.event-details::before {
    content: '✨';
    display: block;
    text-align: center;
    font-size: 1.5rem;
    margin: 2rem auto;
    opacity: 0.6;
    animation: sparkleFloat 3s ease-in-out infinite;
} */

@keyframes sparkleFloat {
    0%, 100% { 
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-10px) scale(1.2);
        opacity: 1;
    }
}

.greeting {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 2rem;
    line-height: 1.8;
    text-align: center;
    padding: 0 1rem;
    letter-spacing: 0.5px;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.greeting .highlight {
    font-weight: 600;
    background: linear-gradient(135deg, #667eea, #764ba2, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.congratulations {
    font-size: 1.1rem;
    color: #2c3e50;
    line-height: 1.9;
    margin-bottom: 2.5rem;
    padding: 2rem 1.8rem;
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.12) 0%, 
        rgba(255, 182, 193, 0.12) 50%,
        rgba(102, 126, 234, 0.08) 100%);
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease-out 0.4s both, greetingGlow 3s ease-in-out infinite;
}

.congratulations::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: rotateGradient 8s linear infinite;
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes greetingGlow {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.15),
                    0 0 0 1px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 0 12px 35px rgba(255, 215, 0, 0.25),
                    0 0 20px rgba(255, 215, 0, 0.2),
                    0 0 0 1px rgba(255, 255, 255, 0.15);
    }
}

.congratulations {
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.congratulations br {
    display: block;
    margin: 0.8rem 0;
}

/* Add decorative corner elements */
.congratulations::after {
    content: '✨';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.5rem;
    opacity: 0.5;
    animation: cornerSparkle 2s ease-in-out infinite;
}

@keyframes cornerSparkle {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(180deg);
    }
}

/* Enhanced emoji visibility in text */
.congratulations,
.greeting {
    position: relative;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced list items with staggered animation */
.detail-section li {
    opacity: 0;
    animation: listItemFadeIn 0.6s ease-out forwards;
}

.detail-section li:nth-child(1) { animation-delay: 0.1s; }
.detail-section li:nth-child(2) { animation-delay: 0.2s; }
.detail-section li:nth-child(3) { animation-delay: 0.3s; }
.detail-section li:nth-child(4) { animation-delay: 0.4s; }
.detail-section li:nth-child(5) { animation-delay: 0.5s; }
.detail-section li:nth-child(6) { animation-delay: 0.6s; }

@keyframes listItemFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Enhanced hover effects for detail sections */
.detail-section {
    cursor: pointer;
}

.detail-section:hover .detail-section li {
    transform: translateX(5px);
    transition: transform 0.3s ease;
}

/* Subtle pulse effect for important elements */
.graduate-info,
.notes-section {
    animation: subtlePulse 4s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.1);
    }
    50% {
        box-shadow: 0 12px 35px rgba(255, 215, 0, 0.2);
    }
}

.invitation-text {
    font-size: 1.1rem;
    color: #34495e;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.highlight {
    background: linear-gradient(135deg, #667eea, #764ba2, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    background-size: 200% 200%;
    animation: highlightGradient 3s ease infinite;
    display: inline-block;
    position: relative;
    padding: 0;
}

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

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

/* Event Details */
.event-details {
    margin-top: 2rem;
    position: relative;
}

/* .event-details::before {
    content: '🎓';
    display: block;
    text-align: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    opacity: 0.7;
    animation: capFloat 2.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.4));
} */

@keyframes capFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-8px) rotate(5deg);
        opacity: 1;
    }
}

.detail-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 15px;
    border: 2px solid transparent;
    transition: all 0.4s ease;
    animation: fadeInUp 1s ease-out 0.9s both;
}

.detail-section:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.2);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.detail-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: #2c3e50;
    margin-bottom: 1.2rem;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(135deg, #ffd700, #667eea, #ffd700) 1;
    border-image-slice: 1;
    padding-bottom: 0.8rem;
    display: inline-block;
    position: relative;
    animation: titleSlide 0.6s ease-out;
}

.detail-section h3::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 50%;
    height: 3px;
    background: linear-gradient(90deg, #ffd700, transparent);
    animation: titleUnderline 0.8s ease-out 0.3s both;
}

@keyframes titleSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes titleUnderline {
    from {
        width: 0;
    }
    to {
        width: 50%;
    }
}

.detail-section ul {
    list-style: none;
    padding-left: 0;
}

.detail-section li {
    font-size: 1.1rem;
    color: #34495e;
    margin-bottom: 0.8rem;
    padding-left: 2rem;
    position: relative;
    line-height: 1.6;
}

.detail-section li::before {
    content: '✨';
    position: absolute;
    left: 0;
    font-size: 1.2rem;
    animation: sparkleIcon 2s ease-in-out infinite;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6));
}

@keyframes sparkleIcon {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: scale(1.2) rotate(180deg);
        opacity: 0.8;
    }
}

.detail-section li strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Graduate Info Section */
.graduate-info {
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.12) 0%, 
        rgba(102, 126, 234, 0.08) 50%,
        rgba(255, 215, 0, 0.12) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
}

.graduate-info h3 {
    border-bottom: 3px solid #ffd700;
}

.graduate-info li {
    font-size: 1.15rem;
    padding-left: 2.5rem;
}

.graduate-info li::before {
    content: '✨';
    font-size: 1.3rem;
}

/* Notes Section */
.notes-section {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.08) 0%, 
        rgba(255, 215, 0, 0.08) 50%,
        rgba(102, 126, 234, 0.08) 100%);
}

.notes-section h3 {
    border-bottom: 2px solid #667eea;
}

.notes-section li::before {
    content: '💡';
}

/* Map Section */
.map-section {
    margin-top: 2rem;
}

.map-section h3 {
    margin-bottom: 1.5rem;
}

.map-container {
    position: relative;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: mapFadeIn 1s ease-out 1.2s both;
}

.map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.03) 0%, 
        transparent 50%,
        rgba(102, 126, 234, 0.03) 100%);
    pointer-events: none;
    z-index: 1;
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.map-container:hover::before {
    opacity: 1;
}

.map-container:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2),
                0 0 20px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

@keyframes mapFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.google-map {
    width: 100%;
    height: 400px;
    border-radius: 15px;
    border: none;
}

/* Footer Section */
.footer-section {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.1) 25%,
        rgba(255, 215, 0, 0.08) 50%,
        rgba(118, 75, 162, 0.1) 75%,
        rgba(102, 126, 234, 0.1) 100%);
    border: 3px solid transparent;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.1),
        inset 0 0 60px rgba(255, 215, 0, 0.05);
}

.footer-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 215, 0, 0.15), 
        transparent, 
        rgba(102, 126, 234, 0.1), 
        transparent);
    animation: shimmer 5s infinite;
}

.footer-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 50%, rgba(255, 215, 0, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%);
    border-radius: 25px;
    z-index: 1;
    pointer-events: none;
}

.footer-decoration-left,
.footer-decoration-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    opacity: 0.6;
    animation: footerDecoFloat 3s ease-in-out infinite;
    z-index: 2;
}

.footer-decoration-left {
    left: 2rem;
    animation-delay: 0s;
}

.footer-decoration-right {
    right: 2rem;
    animation-delay: 1.5s;
}

@keyframes footerDecoFloat {
    0%, 100% {
        transform: translateY(-50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-50%) scale(1.2) rotate(10deg);
        opacity: 0.9;
    }
}

.footer-text {
    margin: 0;
    position: relative;
    z-index: 3;
    display: inline-block;
}

.footer-text-main {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 30%,
        #ffd700 50%,
        #764ba2 70%,
        #667eea 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: footerTextGradient 3s ease infinite, footerTextFloat 3s ease-in-out infinite;
    display: inline-block;
    position: relative;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

.footer-text-signature {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    font-weight: 600;
    font-style: italic;
    letter-spacing: 2px;
    margin-top: 10px;
    display: inline-block;
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 50%,
        #ffd700 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: footerTextGradient 3s ease infinite;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.4));
    transform: rotate(-1deg);
}

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

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

.footer-underline {
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent, 
        #ffd700, 
        #667eea, 
        #ffd700, 
        transparent);
    background-size: 200% 100%;
    margin: 1rem auto 0;
    border-radius: 2px;
    animation: footerUnderlineShine 2s ease infinite;
    position: relative;
    z-index: 2;
}

@keyframes footerUnderlineShine {
    0%, 100% {
        background-position: -100% 0;
        opacity: 0.7;
    }
    50% {
        background-position: 100% 0;
        opacity: 1;
    }
}

/* Decorative Elements */
.decoration {
    position: absolute;
    font-size: 2rem;
    opacity: 0.3;
    color: #ffd700;
    animation: floatDeco 6s ease-in-out infinite;
}

@keyframes floatDeco {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.decoration.top-left {
    top: 20px;
    left: 20px;
}

.decoration.top-right {
    top: 20px;
    right: 20px;
}

.decoration.bottom-left {
    bottom: 20px;
    left: 20px;
}

.decoration.bottom-right {
    bottom: 20px;
    right: 20px;
}

/* Buttons */
.button-group {
    text-align: center;
    margin-top: 2rem;
    position: relative;
    z-index: 2;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    margin: 0.5rem;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

.btn:hover i {
    transform: scale(1.2);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.btn:hover::before {
    width: 400px;
    height: 400px;
}

.btn span {
    position: relative;
    z-index: 2;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 100% 100%;
    color: white;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    position: relative;
    z-index: 1;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 100% 100%;
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.btn-primary:hover::before {
    background: rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 5px 20px rgba(240, 147, 251, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(240, 147, 251, 0.6);
}


/* Back Button */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-button:hover {
    background: white;
    transform: translateX(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.scroll-to-top:active {
    transform: translateY(-3px) scale(1.05);
}

/* Skip to Content Link (Accessibility) */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #667eea;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

.skip-to-content:focus {
    top: 0;
}

/* Print Styles */
@media print {
    .countdown-overlay,
    .envelope-overlay,
    .particles-container,
    .scroll-to-top,
    .back-button,
    .open-invitation-btn {
        display: none !important;
    }

    body {
        background: white;
        padding: 0;
    }

    .invitation-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    .detail-section {
        page-break-inside: avoid;
    }

    .congratulations {
        background: rgba(255, 215, 0, 0.1);
        border: 1px solid rgba(255, 215, 0, 0.3);
    }

    @page {
        margin: 2cm;
    }
}

/* Loading States */
.loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Focus States for Accessibility */
*:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

/* Reduced Motion (Accessibility) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
    }

    .container {
        padding: 1rem 0.8rem;
        max-width: 100%;
    }

    .invitation-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
        margin-top: 3rem;
        margin-bottom: 1.5rem;
    }

    .invitation-card:hover {
        transform: none !important; /* Disable hover effect on mobile */
    }

    .card-header h1 {
        font-size: 2rem;
        margin-bottom: 0.3rem;
    }

    .card-header .icon {
        font-size: 3rem;
        margin-bottom: 0.8rem;
    }

    .graduate-photo {
        width: 150px;
        height: 150px;
        border: 4px solid rgba(102, 126, 234, 0.3);
    }

    .graduation-cap {
        font-size: 4.5rem;
        top: -30px;
        filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3))
                drop-shadow(0 0 18px rgba(255, 215, 0, 0.4));
    }

    .card-header p {
        font-size: 1rem;
    }

    .greeting {
        font-size: 1.3rem;
        line-height: 1.7;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    .congratulations {
        font-size: 1rem;
        padding: 1.2rem;
        line-height: 1.7;
        margin-bottom: 1.5rem;
    }

    .detail-section {
        padding: 1.2rem;
        margin-bottom: 1.5rem;
    }

    .detail-section h3 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }

    .detail-section li {
        font-size: 1rem;
        margin-bottom: 0.7rem;
        padding-left: 1.8rem;
        line-height: 1.6;
    }

    .decoration {
        display: none;
    }

    .back-button {
        top: 10px;
        left: 10px;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        position: fixed;
        z-index: 1000;
    }

    .button-group {
        margin-top: 1.5rem;
    }

    .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
        padding: 1rem;
    }

    .highlight {
        padding: 0.15rem 0.4rem;
        font-size: 0.95em;
    }

    .map-container {
        border-radius: 12px;
    }

    .google-map {
        height: 300px;
    }

    .footer-section {
        padding: 1.2rem 1rem;
        margin-top: 1.5rem;
    }

    .footer-decoration-left,
    .footer-decoration-right {
        font-size: 2rem;
    }

    .footer-decoration-left {
        left: 1rem;
    }

    .footer-decoration-right {
        right: 1rem;
    }

    .footer-text-main {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .footer-underline {
        width: 100px;
        margin-top: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem 0.5rem;
    }

    .invitation-card {
        padding: 1.5rem 1rem;
        margin-top: 3rem;
        border-radius: 15px;
    }

    .card-header h1 {
        font-size: 1.8rem;
    }

    .card-header .icon {
        font-size: 2.5rem;
    }

    .graduate-photo {
        width: 120px;
        height: 120px;
        border: 3px solid rgba(102, 126, 234, 0.3);
    }

    .graduation-cap {
        font-size: 3.5rem;
        top: -14px;
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))
                drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
    }

    .card-header p {
        font-size: 0.95rem;
    }

    .greeting {
        font-size: 1.15rem;
        line-height: 1.6;
        padding: 0 0.5rem;
    }

    .congratulations {
        font-size: 0.95rem;
        padding: 1rem;
    }

    .detail-section {
        padding: 1rem;
    }

    .detail-section h3 {
        font-size: 1.2rem;
    }

    .detail-section li {
        font-size: 0.95rem;
        padding-left: 1.5rem;
    }

    .btn {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }

    .back-button {
        top: 8px;
        left: 8px;
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .back-button span {
        display: none;
    }

    .highlight {
        padding: 0.1rem 0.3rem;
        font-size: 0.9em;
    }

    .map-container {
        border-radius: 10px;
    }

    .google-map {
        height: 250px;
    }

    .footer-section {
        padding: 1rem 0.8rem;
        margin-top: 1rem;
    }

    .footer-decoration-left,
    .footer-decoration-right {
        font-size: 1.5rem;
    }

    .footer-decoration-left {
        left: 0.5rem;
    }

    .footer-decoration-right {
        right: 0.5rem;
    }

    .footer-text-main {
        font-size: 1.3rem;
        letter-spacing: 1.5px;
    }

    .footer-underline {
        width: 80px;
        height: 2px;
        margin-top: 0.5rem;
    }
}

/* Sparkle Effect */
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffd700;
    border-radius: 50%;
    animation: sparkleAnim 2s infinite;
    pointer-events: none;
}

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

/* Countdown Section */
.countdown-section {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease-out 1.1s both;
}

.countdown-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 4s infinite;
}

.countdown-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.countdown-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.countdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.5s ease;
}

.countdown-item:hover::before {
    left: 100%;
}

.countdown-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.countdown-number {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1;
    animation: numberPulse 2s ease-in-out infinite;
}

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

.countdown-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Floating Balloons */
.balloon {
    position: fixed;
    width: 60px;
    height: 80px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
    animation: floatBalloon 15s infinite ease-in-out;
}

.balloon:nth-child(odd) {
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
}

.balloon:nth-child(even) {
    background: linear-gradient(135deg, #4ecdc4, #6ee7dc);
}

@keyframes floatBalloon {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) translateX(50px) rotate(180deg);
        opacity: 0;
    }
}

/* Shooting Stars */
.shooting-star {
    position: fixed;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 1;
    animation: shootStar 3s infinite;
}

@keyframes shootStar {
    0% {
        transform: translateX(-100px) translateY(-100px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(200vw) translateY(200vh);
        opacity: 0;
    }
}

/* Glowing Text */
.glow-text {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5),
                 0 0 20px rgba(255, 215, 0, 0.3),
                 0 0 30px rgba(255, 215, 0, 0.2);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.5),
                     0 0 20px rgba(255, 215, 0, 0.3),
                     0 0 30px rgba(255, 215, 0, 0.2);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8),
                     0 0 30px rgba(255, 215, 0, 0.5),
                     0 0 40px rgba(255, 215, 0, 0.3);
    }
}

/* Responsive Envelope */
@media (max-width: 768px) {
    .envelope-container {
        width: 90%;
        max-width: 380px;
        height: 320px;
        padding: 1rem;
        padding-bottom: 1.5rem;
    }

    .envelope-body {
        padding: 3rem 2rem 3.5rem 2rem;
        border-width: 2px;
    }

    .envelope-title {
        font-size: 1.7rem;
        margin-bottom: 0.5rem;
    }

    .envelope-icon {
        font-size: 3rem;
        margin-bottom: 0.9rem;
    }

    .envelope-message {
        font-size: 1rem;
        margin-bottom: 0.9rem;
    }


    .click-to-open {
        font-size: 1rem;
        padding: 0.9rem 2rem;
        bottom: 2rem;
    }

    .envelope-flap::before {
        font-size: 4rem;
        top: 44%;
    }

}

@media (max-width: 480px) {
    .envelope-container {
        width: 85%;
        height: 300px;
        padding-bottom: 1.5rem;
    }

    .envelope-body {
        padding: 2.8rem 1.8rem 3.5rem 1.8rem;
    }

    .envelope-title {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
    }

    .envelope-icon {
        font-size: 2.8rem;
        margin-bottom: 0.8rem;
    }

    .envelope-message {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }


    .click-to-open {
        font-size: 0.95rem;
        padding: 0.8rem 1.8rem;
        bottom: 2rem;
    }

    .envelope-flap::before {
        font-size: 3.5rem;
    }

}

/* Responsive Countdown Overlay */
@media (max-width: 768px) {
    .countdown-content h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
        gap: 0.5rem;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .countdown-decoration {
        font-size: 1.6rem;
    }
    
    .countdown-cap {
        font-size: 1.8rem;
    }

    .countdown-timer {
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .time-unit {
        min-width: 80px;
        padding: 1.2rem 1rem;
    }

    .time-value {
        font-size: 2.5rem;
    }

    .time-label {
        font-size: 0.9rem;
    }

    .open-invitation-btn {
        font-size: 1rem;
        padding: 1rem 2.5rem;
    }
}

@media (max-width: 480px) {
    .countdown-content h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        gap: 0.3rem;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .countdown-cap {
        font-size: 1.4rem;
    }

    .countdown-decoration {
        font-size: 1.3rem;
    }

    .countdown-timer {
        gap: 0.8rem;
        margin-bottom: 1.5rem;
    }

    .time-unit {
        min-width: 70px;
        padding: 1rem 0.8rem;
    }

    .time-value {
        font-size: 2rem;
    }

    .time-label {
        font-size: 0.8rem;
    }

    .open-invitation-btn {
        font-size: 0.95rem;
        padding: 0.9rem 2rem;
    }
}

/* Responsive Countdown */
@media (max-width: 768px) {
    .countdown-section {
        padding: 1.5rem 1rem;
        margin: 1.5rem 0;
    }

    .countdown-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .countdown-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .countdown-number {
        font-size: 2.5rem;
    }

    .countdown-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .countdown-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.6rem;
    }

    .countdown-item {
        padding: 1rem 0.6rem;
    }

    .countdown-number {
        font-size: 1.8rem;
        margin-bottom: 0.4rem;
    }

    .countdown-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .countdown-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    .countdown-item {
        padding: 0.8rem 0.5rem;
    }

    .countdown-number {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }

    .countdown-label {
        font-size: 0.65rem;
        letter-spacing: 0;
    }
}
