/* Thiết lập chiều cao Full Viewport cho HTML và BODY */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Thiết lập font và màu nền chung */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to bottom right, #fce4ec, #f8bbd0, #e91e63); /* Nền hồng/đỏ gradient */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; /* Ngăn cuộn trang */
    position: relative;
    perspective: 1000px;
}

/* --- Nội dung chính --- */
.container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 900px;
    z-index: 200; /* Nằm giữa các hiệu ứng */
    position: relative;
    transform-style: preserve-3d;
    animation: slideIn 1.5s ease-out forwards;
}

/* Tiêu đề nhấp nháy */
h1 {
    color: #880e4f;
    font-size: 3em;
    margin-bottom: 25px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(-100vw);
    transition: all 0.3s ease;
}

h1.animate {
    animation: titleSlideFromLeft 2s ease-out forwards;
}

.blinking-text {
    opacity: 0;
    transform: translateX(-100vw);
    transition: all 0.3s ease;
}

.blinking-text.animate {
    animation: blink 1.5s infinite alternate, titleSlideFromLeft 2s ease-out forwards, titleSway 4s ease-in-out 3s infinite;
}

/* Thông điệp */
.message {
    font-size: 1.3em;
    line-height: 1.8;
    margin-bottom: 40px;
    color: #555;
    font-style: italic;
    opacity: 0;
    transform: translateX(100vw);
    transition: all 0.3s ease;
}

.message.animate {
    animation: messageSlideFromRight 2.5s ease-out 0.5s forwards, messageSway 4s ease-in-out 3s infinite;
}

.message:hover {
    transform: translateX(0) scale(1.02);
    color: #880e4f;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

/* Vùng bó hoa */
.flower-bouquet p {
    font-weight: bold;
    color: #d81b60;
    font-style: normal;
    font-size: 1.1em;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.3s ease;
}

.flower-bouquet p.animate {
    animation: bouquetSlideUp 3s ease-out 1s forwards;
}

.flower-bouquet p:hover {
    transform: translateY(0) scale(1.05);
    color: #e91e63;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
/* --- Vùng chứa hiệu ứng TRÁI TIM (phía trên) --- */
.falling-hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 40vh; 
    pointer-events: none;
    z-index: 1500; 
    overflow: hidden; 
}

/* --- Vùng chứa hiệu ứng HOA HỒNG (phía dưới) --- */
.falling-flowers-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 10vh; /* Theo yêu cầu mới */
    pointer-events: none;
    z-index: 1500; 
    overflow: hidden; 
}

/* --- VÙNG CHỨA PHÁO HOA (Phủ toàn màn hình) --- */
#fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2000; /* Cao nhất để pháo hoa hiển thị trên tất cả */
    overflow: hidden;
}

/* Kiểu hạt pháo hoa */
.firework-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    opacity: 0;
    will-change: transform, opacity;
}

/* Kiểu chung cho các phần tử hiệu ứng (hoa và trái tim) */
.flower, .heart {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

/* --- Hình ảnh bạn gái ẩn hiện --- */
.background-images-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 250; /* Tăng Z-index lên cao hơn .container (z-index: 200) */
    pointer-events: none;
}

.girl-image {
    position: absolute;
    width: 280px; /* Giữ nguyên kích thước ảnh */
    border-radius: 15px; /* Giữ bo góc 15px */
    object-fit: cover;
    opacity: 0;
    filter: brightness(100%) saturate(120%); 
    transition: all 1.5s ease-in-out;
    transform: scale(0.7) rotate(0deg); 
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.7); /* Giữ viền trắng */
    will-change: transform, opacity, left, top;
    z-index: 1; /* Đảm bảo ảnh ở dưới text */
}

/* --- Lớp phủ chào mừng --- */
#welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 192, 203, 0.95);
    color: #880e4f;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    text-align: center;
    transition: opacity 1s ease-out;
    cursor: pointer;
}

#welcome-overlay p {
    font-size: 1.5em;
    margin-bottom: 20px;
    font-weight: bold;
}

#start-button {
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    background-color: #d81b60;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.1s ease;
}

#start-button:hover {
    background-color: #880e4f;
    transform: translateY(-2px);
}

#welcome-overlay.hidden {
    opacity: 0;
    pointer-events: none; 
}

/* --- Animations --- */
@keyframes blink {
    0%, 100% { opacity: 1; text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2); }
    50% { opacity: 0.7; text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.6); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-50px) scale(0.8); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Thêm animation cho hạt pháo hoa - sẽ được tạo động trong JS */
@keyframes explode {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) scale(0.5); /* Sử dụng biến CSS */
    }
}

/* --- Animations cho Text --- */
@keyframes titleSlideFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-100vw) scale(0.8);
    }
    30% {
        opacity: 0.6;
        transform: translateX(-50vw) scale(0.9);
    }
    70% {
        opacity: 0.9;
        transform: translateX(-10vw) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes messageSlideFromRight {
    0% {
        opacity: 0;
        transform: translateX(100vw) scale(0.8);
    }
    30% {
        opacity: 0.6;
        transform: translateX(50vw) scale(0.9);
    }
    70% {
        opacity: 0.9;
        transform: translateX(10vw) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes bouquetSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    50% {
        opacity: 0.8;
        transform: translateY(10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Animations lặp lại cho Text --- */
@keyframes titleSway {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-20px);
    }
    50% {
        transform: translateX(0);
    }
    75% {
        transform: translateX(20px);
    }
}

@keyframes messageSway {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-20px);
    }
    50% {
        transform: translateX(0);
    }
    75% {
        transform: translateX(20px);
    }
}