/* Simple Loading Page with Blur Background */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);  /* เปลี่ยนเป็นสีขาวที่มีความโปร่งใส */
    backdrop-filter: blur(8px);  /* เพิ่ม blur effect */
    -webkit-backdrop-filter: blur(8px);  /* สำหรับ Safari */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    transition: opacity 0.6s ease-out;
}

.loading-container.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-progress {
    width: 240px;
    height: 6px;
    background-color: var(--theme-light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);  /* เพิ่มเงาเล็กน้อยให้ดูเด่นขึ้น */
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--theme) 0%, var(--font-orange) 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

.loading-text {
    color: var(--font-color);
    font-size: var(--font-p);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.7);  /* เพิ่มพื้นหลังให้ข้อความ */
    padding: 5px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);  /* เพิ่มเงาเล็กน้อย */
}

.loading-dots {
    display: inline-flex;
    margin-left: 5px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--theme);
    margin: 0 2px;
    animation: dot-pulse 1.5s infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Supporting animations */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes dot-pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .loading-progress {
        width: 200px;
    }
}
