/* Reset và cài đặt cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Container loading */
.loading {
    text-align: center;
}

/* Màn hình loading */
#loading-screen {
    font-size: 2rem;
    font-weight: bold;
    color: #d63384;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Hiệu ứng chữ nhấp nháy */
#loading-screen {
    animation: blink 1.5s infinite alternate;
}

@keyframes blink {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Spinner loading */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #d63384;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Dots loading */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #d63384;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
.dot:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.5);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Flower loading (phù hợp với Women's Day) */
.flower-loader {
    width: 80px;
    height: 80px;
    margin: 20px auto;
    position: relative;
}

.petal {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ff69b4;
    border-radius: 50% 50% 50% 0;
    animation: flowerBloom 2s infinite ease-in-out;
}

.petal:nth-child(1) { top: 0; left: 30px; transform-origin: bottom center; animation-delay: 0s; }
.petal:nth-child(2) { top: 30px; right: 0; transform-origin: left center; animation-delay: 0.2s; }
.petal:nth-child(3) { bottom: 0; left: 30px; transform-origin: top center; animation-delay: 0.4s; }
.petal:nth-child(4) { top: 30px; left: 0; transform-origin: right center; animation-delay: 0.6s; }
.petal:nth-child(5) { top: 10px; left: 10px; transform-origin: bottom right; animation-delay: 0.8s; }
.petal:nth-child(6) { top: 10px; right: 10px; transform-origin: bottom left; animation-delay: 1s; }
.petal:nth-child(7) { bottom: 10px; right: 10px; transform-origin: top left; animation-delay: 1.2s; }
.petal:nth-child(8) { bottom: 10px; left: 10px; transform-origin: top right; animation-delay: 1.4s; }

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

/* Progress bar loading */
.progress-container {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin: 20px auto;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff69b4, #d63384);
    border-radius: 4px;
    animation: progress 3s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ==========================
   Responsive cho các nền tảng
   ========================== */

/* Điện thoại nhỏ (dưới 576px) */
@media (max-width: 575px) {
    #loading-screen { font-size: 1.2rem; }
    .loading-spinner { width: 40px; height: 40px; }
    .dot { width: 8px; height: 8px; }
    .flower-loader { width: 60px; height: 60px; }
    .progress-container { width: 200px; }
}

/* Tablet dọc & điện thoại lớn (576px – 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    #loading-screen { font-size: 1.5rem; }
    .loading-spinner { width: 50px; height: 50px; }
    .progress-container { width: 250px; }
}

/* Tablet ngang (768px – 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    #loading-screen { font-size: 1.8rem; }
    .flower-loader { width: 70px; height: 70px; }
    .progress-container { width: 280px; }
}

/* Laptop (992px – 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    #loading-screen { font-size: 2rem; }
    .flower-loader { width: 80px; height: 80px; }
}

/* Desktop lớn (từ 1200px trở lên) */
@media (min-width: 1200px) {
    #loading-screen { font-size: 2.2rem; }
    .loading-spinner { width: 70px; height: 70px; }
}