/* Basic reset and body setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #000000;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* New Loading Placeholder (Phong cách deferredFadeRoute) */
.deferred-loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Gradient tối theo code Flutter */
    background: linear-gradient(to bottom right, #1a1a1a, #000000, #0d0d0d);
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

/* ─── App-load progress UI — SCOPED chỉ trong #loading-placeholder ─── */
/* Class generic (.loading-text, .loading-progress-bar) chỉ apply khi nằm
   trong #loading-placeholder (initial app load), tránh va chạm với
   các loading state khác trong app */

#loading-placeholder .loading-text {
    color: rgba(255, 255, 255, 0.92);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 15px;
    font-weight: 500;
    margin-top: 32px;
    text-align: center;
    min-height: 22px;
    letter-spacing: 0.4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#loading-placeholder .loading-progress-bar {
    position: relative;
    width: 240px;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 16px;
    box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3);
}

#loading-placeholder .loading-progress-fill {
    position: relative;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50, #2196F3, #9C27B0);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.4);
    transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#loading-placeholder .loading-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 100%
    );
    animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Soft glow under loader circle — chỉ initial load */
#loading-placeholder .loader-circle {
    box-shadow: 0 0 24px 6px rgba(33, 150, 243, 0.18), 0 0 40px 10px rgba(156, 39, 176, 0.08);
}

.loader-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    /* Gradient đa sắc cho vòng tròn */
    background: linear-gradient(45deg, #4CAF50, #2196F3, #9C27B0);
    box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Spinner giả lập CircularProgressIndicator */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Ẩn placeholder khi Flutter đã sẵn sàng */
.loading-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Font warm-up hidden class */
.font-warmup {
    position: absolute;
    visibility: hidden;
    font-size: 0px;
    pointer-events: none;
}
