﻿/* ================================================================
   Modern Loading Screen Styles
   ================================================================ */

/* Main loading screen container */
.modern-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modern-loading-screen.active {
    opacity: 1;
    visibility: visible;
}

/* Loading content wrapper */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 340px;
    padding: 24px;
    gap: 24px;
}

/* ================================================================
   Dynamic Loading Text
   ================================================================ */
.loading-text-container {
    height: 28px;
    overflow: hidden;
    position: relative;
    width: 100%;
    text-align: center;
}

.loading-text {
    font-family: var(--font-brand-text, Inter, sans-serif);
    font-weight: 500;
    font-size: 16px;
    color: #5D5D5D;
    text-align: center;
    position: absolute;
    width: 100%;
    left: 0;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.loading-text.active {
    opacity: 1;
    transform: translateY(0);
}

.loading-text.exit {
    opacity: 0;
    transform: translateY(20px);
}

/* ================================================================
   Progress Bar
   ================================================================ */
.loading-progress-container {
    width: 100%;
    max-width: 293px;
}

.loading-progress-bar {
    width: 100%;
    height: 8px;
    background: #DBDEFF;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.loading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1B1F52 0%, #3D468B 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

/* Animated shimmer effect on progress bar */
.loading-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

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

/* Indeterminate progress animation */
.loading-progress-fill.indeterminate {
    width: 30%;
    animation: indeterminate 1.5s infinite ease-in-out;
}

@keyframes indeterminate {
    0% {
        left: -30%;
    }
    100% {
        left: 100%;
    }
}

/* ================================================================
   Fun Facts Carousel (Timeout State)
   ================================================================ */
.fun-facts-section {
    width: 100%;
    max-width: 293px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    display: none;
}

.fun-facts-section.visible {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.fun-fact-card {
    display: flex;
    width: 100%;
    padding: 16px 12px;
    align-items: center;
    gap: 12px;
    border-radius: 4px;
    background: #FFF;
    box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.25) inset;
    margin-bottom: 16px;
}

.fun-fact-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fun-fact-icon svg {
    width: 28px;
    height: 28px;
}

.fun-fact-text {
    font-family: var(--font-brand-text, Inter, sans-serif);
    font-weight: 400;
    font-size: 14px;
    color: #000;
    line-height: 1.4;
    flex: 1;
}

/* Carousel animation */
.fun-facts-carousel {
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

.fun-fact-item {
    position: absolute;
    width: 100%;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fun-fact-item.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
}

.fun-fact-item.exit-left {
    opacity: 0;
    transform: translateX(-100%);
}

/* Timeout message */
.timeout-message {
    color: #9C9C9C;
    text-align: center;
    font-family: var(--font-brand-text, Inter, sans-serif);
    font-size: 16px;
    font-weight: 400;
    margin-top: 8px;
}

/* ================================================================
   Carousel Indicators
   ================================================================ */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    bottom: 28px;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #DBDEFF;
    transition: background 0.3s ease;
}

.carousel-indicator.active {
    background: #3D468B;
}

/* ================================================================
   Responsive adjustments
   ================================================================ */
@media (max-width: 400px) {
    .loading-content {
        padding: 16px;
    }
    
    .fun-fact-card {
        padding: 12px 10px;
        gap: 10px;
    }
    
    .fun-fact-text {
        font-size: 13px;
    }
}