/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Particles Background */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

/* Music Control */
.music-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.music-control button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.music-control button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Container */
.container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 100px 0;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Floating Hearts */
.floating-hearts {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    transform: rotate(45deg);
    animation: float 6s ease-in-out infinite;
}

.heart::before,
.heart::after {
    content: '';
    width: 20px;
    height: 20px;
    position: absolute;
    background: #ff6b6b;
    border-radius: 50%;
}

.heart::before {
    top: -10px;
    left: 0;
}

.heart::after {
    left: -10px;
    top: 0;
}

.heart:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.heart:nth-child(2) {
    left: 30%;
    animation-delay: 1s;
}

.heart:nth-child(3) {
    left: 50%;
    animation-delay: 2s;
}

.heart:nth-child(4) {
    left: 70%;
    animation-delay: 3s;
}

.heart:nth-child(5) {
    left: 90%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(45deg) scale(0);
        opacity: 0;
    }
    10%, 90% {
        opacity: 1;
    }
    50% {
        transform: translateY(0vh) rotate(45deg) scale(1);
    }
}

/* Cake */
.cake-container {
    margin-bottom: 40px;
    position: relative;
}

.cake {
    position: relative;
    margin: 0 auto;
    width: 120px;
    height: 130px;
    animation: gentle-bounce 3s ease-in-out infinite;
}

.cake-layer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.cake-bottom {
    width: 120px;
    height: 45px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #CD853F 100%);
    bottom: 0;
    border-radius: 12px 12px 20px 20px;
    border: 1px solid #654321;
}

.cake-middle {
    width: 100px;
    height: 38px;
    background: linear-gradient(135deg, #FFB6C1 0%, #FF91A4 50%, #FFC0CB 100%);
    bottom: 40px;
    border-radius: 10px;
    border: 1px solid #FF91A4;
}

.cake-top {
    width: 80px;
    height: 32px;
    background: linear-gradient(135deg, #FF1493 0%, #FF69B4 50%, #FFB6C1 100%);
    bottom: 73px;
    border-radius: 10px 10px 16px 16px;
    border: 1px solid #DC143C;
}

.cake-decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.decoration {
    position: absolute;
    font-size: 10px;
    animation: decoration-sparkle 3s ease-in-out infinite;
}

.dec-1 {
    bottom: 12px;
    left: 25px;
    animation-delay: 0s;
}

.dec-2 {
    bottom: 12px;
    right: 25px;
    animation-delay: 1s;
}

.dec-3 {
    bottom: 82px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 2s;
}

.candle {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 18px;
    background: linear-gradient(180deg, #FFD700 0%, #DAA520 100%);
    border-radius: 3px 3px 1px 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.flame {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 10px;
    background: radial-gradient(ellipse at center bottom, #FF4500 0%, #FFD700 80%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flame-dance 0.5s ease-in-out infinite alternate;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.5);
}

@keyframes gentle-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.02);
    }
}

@keyframes flame-dance {
    0% {
        transform: translateX(-50%) scale(1) rotate(-1deg);
        filter: brightness(1);
    }
    100% {
        transform: translateX(-50%) scale(1.08) rotate(1deg);
        filter: brightness(1.2);
    }
}

@keyframes decoration-sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.2) rotate(5deg);
        filter: brightness(1.3);
    }
}

/* Main Title */
.main-title {
    margin-bottom: 30px;
}

.glitter-text {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    background: linear-gradient(45deg, #FFD700, #FF69B4, #00BFFF, #32CD32, #FFD700);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 3s ease-in-out infinite, glow 2s ease-in-out infinite alternate;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

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

@keyframes glow {
    from {
        filter: drop-shadow(0 0 20px #FFD700);
    }
    to {
        filter: drop-shadow(0 0 40px #FF69B4);
    }
}

/* Birthday Message */
.birthday-message {
    margin-bottom: 40px;
}

.subtitle {
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out 0.5s both;
}

.age-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: fadeInUp 1s ease-out 1s both;
}

.age-number {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 4px 15px rgba(255, 215, 0, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

.age-text {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

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

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Date Range */
.date-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    animation: fadeInUp 1s ease-out 1.5s both;
}

.date-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.date-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.date-arrow {
    color: #FFD700;
    font-size: 1.5rem;
    animation: bounce-horizontal 2s ease-in-out infinite;
}

@keyframes bounce-horizontal {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(10px);
    }
    60% {
        transform: translateX(5px);
    }
}

/* Sections */
.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.title-decoration {
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #FFD700, #FF69B4);
    margin: 0 auto;
    border-radius: 2px;
    position: relative;
}

.title-decoration::before,
.title-decoration::after {
    content: '';
    position: absolute;
    top: -4px;
    width: 12px;
    height: 12px;
    background: #FF69B4;
    border-radius: 50%;
}

.title-decoration::before {
    left: -6px;
}

.title-decoration::after {
    right: -6px;
}

/* Wishes Section */
.wishes-section {
    padding: 100px 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    margin: 50px 0;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

.wish-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wish-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.wish-card:hover::before {
    opacity: 1;
    animation: shimmer 0.7s ease-in-out;
}

.wish-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.wish-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: float-icon 3s ease-in-out infinite;
}

.wish-card:nth-child(2) .wish-icon {
    animation-delay: 0.5s;
}

.wish-card:nth-child(3) .wish-icon {
    animation-delay: 1s;
}

.wish-card:nth-child(4) .wish-icon {
    animation-delay: 1.5s;
}

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

.wish-card h3 {
    color: #FFD700;
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.wish-card p {
    color: white;
    line-height: 1.6;
    font-size: 1rem;
}

/* Photo Gallery */
.gallery-section {
    padding: 100px 0;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

.photo-frame {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.photo-frame:hover {
    transform: rotate(2deg) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.memory-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.photo-frame:hover .memory-photo {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px 15px 15px;
    text-align: center;
    transform: translateY(100%);
    transition: all 0.3s ease;
}

.photo-frame:hover .photo-overlay {
    transform: translateY(0);
}

.photo-overlay p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Countdown Section */
.countdown-section {
    padding: 100px 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    margin: 50px 0;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.countdown-caption {
    text-align: center;
    margin-bottom: 40px;
}

.countdown-message {
    color: #FFD700;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    font-style: italic;
    animation: gentle-glow 3s ease-in-out infinite alternate;
}

@keyframes gentle-glow {
    from {
        text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    }
    to {
        text-shadow: 0 4px 15px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.2);
    }
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.time-unit {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 30px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.time-unit:hover::before {
    left: 100%;
}

.time-unit:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
}

.time-value {
    display: block;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
    animation: digital-glow 2s ease-in-out infinite alternate;
}

@keyframes digital-glow {
    from { text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5); }
    to { text-shadow: 0 4px 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.3); }
}

.time-label {
    display: block;
    color: white;
    font-size: 1rem;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Message Section */
.message-section {
    padding: 100px 0;
}

.personal-message {
    max-width: 800px;
    margin: 0 auto;
}

.message-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 50px 40px;
    border-radius: 30px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.message-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FFD700, #FF69B4, #00BFFF, #32CD32);
    border-radius: 30px;
    z-index: -1;
    animation: border-rotate 4s linear infinite;
    opacity: 0.7;
}

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

.message-text {
    color: white;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    line-height: 1.8;
    margin-bottom: 30px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.signature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #FFD700;
    font-weight: 600;
    font-size: 1.2rem;
}

.signature i {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 50%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    75% { transform: scale(1.1); }
}

/* Footer */
.footer {
    padding: 50px 0;
    text-align: center;
    margin-top: 50px;
}

.footer-content {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.footer-hearts {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.footer-hearts i {
    color: #FF69B4;
    font-size: 1.2rem;
    animation: twinkle 2s ease-in-out infinite;
}

.footer-hearts i:nth-child(2) {
    animation-delay: 0.5s;
}

.footer-hearts i:nth-child(3) {
    animation-delay: 1s;
}

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

/* Fireworks */
.fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

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

.firework:nth-child(1) {
    left: 20%;
    animation-delay: 0s;
    background: #ff6b6b;
}

.firework:nth-child(2) {
    left: 50%;
    animation-delay: 1s;
    background: #4ecdc4;
}

.firework:nth-child(3) {
    left: 80%;
    animation-delay: 2s;
    background: #45b7d1;
}

@keyframes firework {
    0% {
        transform: translateY(100vh) scale(1);
        opacity: 1;
    }
    15% {
        transform: translateY(20vh) scale(1);
        opacity: 1;
    }
    25% {
        transform: translateY(20vh) scale(1);
        opacity: 1;
        box-shadow: 0 0 10px currentColor;
    }
    30% {
        transform: translateY(20vh) scale(0);
        opacity: 0;
        box-shadow: 
            0 0 50px currentColor,
            20px 0 30px currentColor,
            -20px 0 30px currentColor,
            0 20px 30px currentColor,
            0 -20px 30px currentColor,
            15px 15px 20px currentColor,
            15px -15px 20px currentColor,
            -15px 15px 20px currentColor,
            -15px -15px 20px currentColor;
    }
    100% {
        transform: translateY(20vh) scale(0);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 80px 0;
    }
    
    .wishes-grid {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .countdown-timer {
        gap: 20px;
    }
    
    .time-unit {
        min-width: 100px;
        padding: 25px 15px;
    }
    
    .date-range {
        flex-direction: column;
        gap: 15px;
    }
    
    .date-arrow {
        transform: rotate(90deg);
    }
    
    .message-content {
        padding: 40px 25px;
    }
    
    .music-control {
        top: 15px;
        right: 15px;
    }
    
    .music-control button {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .photo-gallery {
        grid-template-columns: 1fr;
    }
    
    .countdown-timer {
        gap: 15px;
    }
    
    .time-unit {
        min-width: 90px;
        padding: 20px 10px;
    }
    
    .wishes-grid {
        padding: 0 5px;
    }
    
    .wish-card {
        padding: 30px 20px;
    }
    
    .section-title h2 {
        margin-bottom: 15px;
    }
    
    .wishes-section,
    .countdown-section {
        margin: 30px 0;
        padding: 80px 0;
    }
}

/* Welcome Overlay Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Mobile-friendly touch target improvements */
@media (max-width: 768px) {
    /* Improve touch targets */
    #welcome-overlay div[style*="border"] {
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Prevent text selection on mobile */
    #welcome-overlay {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Improve button hover for mobile */
    #welcome-overlay div[style*="border"]:active {
        transform: scale(0.98) !important;
        background: rgba(255,255,255,0.2) !important;
    }
}

/* Smooth transitions for better UX */
#welcome-overlay * {
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Improve countdown timer responsiveness */
@media (max-width: 640px) {
    .countdown-timer {
        grid-template-columns: repeat(2, 1fr);
        display: grid;
        gap: 15px;
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 400px) {
    .countdown-timer {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 260px;
    }
    
    .time-unit {
        min-width: auto;
        padding: 15px 8px;
    }
}