/**
 * Loading Splash Screen - Option 3: Contextual Progress
 * 
 * Personalized loading screen with user avatar, greeting, and step-by-step progress
 * Combined design featuring avatar with spinning ring and animated progress bar
 * 
 * @package AgendaTotaal
 * @version 2.0.0
 */

/* ==========================================
   LOADING SPLASH CONTAINER
   ========================================== */

.loading-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1973B9 0%, #1476BC 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Hide main content while splash is active */
body.splash-active .main-wrapper {
    opacity: 0 !important;
    visibility: hidden !important;
}

body.splash-active {
    overflow: hidden;
}

/* Immediately visible state - shows splash before JS loads */
.loading-splash.immediate-show {
    display: flex !important;
    opacity: 1 !important;
}

.loading-splash.active {
    display: flex;
    animation: fadeIn 0.5s ease forwards;
}

.loading-splash.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

.loading-splash .loading-content {
    text-align: center;
    color: white;
    max-width: 500px;
    padding: 40px;
}

/* ==========================================
   AVATAR SECTION
   ========================================== */

.loading-splash .avatar-container {
    margin: 0 auto 20px;
    position: relative;
    width: 100px;
    height: 100px;
}

.loading-splash .avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #e3f2fd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    color: #1973B9;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: avatarZoom 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.loading-splash .avatar-ring {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 116px;
    height: 116px;
    border: 3px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1.5s linear infinite;
}

/* ==========================================
   GREETING SECTION
   ========================================== */

.loading-splash .greeting {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 5px;
    animation: slideDown 0.6s ease 0.2s both;
}

.loading-splash .time-greeting {
    font-size: 30px;
    margin-bottom: 30px;
    animation: slideDown 0.6s ease 0.3s both;
}

/* ==========================================
   PROGRESS SECTION
   ========================================== */

.loading-splash .progress-container {
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    height: 10px;
    margin: 25px 0 15px 0;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    animation: slideUp 0.6s ease 0.4s both;
}

.loading-splash .progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffffff 0%, #e3f2fd 100%);
    border-radius: 20px;
    transition: width 0.4s ease;
    box-shadow: 0 2px 8px rgba(255,255,255,0.3);
}

.loading-splash .progress-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    min-height: 24px;
    animation: slideUp 0.6s ease 0.5s both;
}

.loading-splash .progress-percentage {
    font-size: 14px;
    opacity: 1.0;
    animation: slideUp 0.6s ease 0.5s both;
}

/* ==========================================
   STEP INDICATORS
   ========================================== */

.loading-splash .step-indicators {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding: 0 10px;
    animation: slideUp 0.6s ease 0.6s both;
}

.loading-splash .step {
    text-align: center;
    flex: 1;
    position: relative;
}

.loading-splash .step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    font-size: 16px;
    transition: all 0.3s;
}

.loading-splash .step.active .step-icon {
    background: white;
    color: #1973B9;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(255,255,255,0.4);
}

.loading-splash .step.completed .step-icon {
    background: rgba(255,255,255,0.6);
}

.loading-splash .step-label {
    font-size: 12px;
    font-weight: 600;
    opacity: 1.0;
    transition: all 0.3s;
}

.loading-splash .step.active .step-label {
    font-size: 13px;
    transform: scale(1.1);
    text-shadow: 0 2px 8px rgba(255,255,255,0.6);
    font-weight: 700;
}

.loading-splash .step.completed .step-label {
    opacity: 0.9;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes avatarZoom {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

