/*
    Mijn Rimote - Loading Animation CSS
    Three bouncing dots with semi-transparent overlay
    Modern loading indicator for better user experience
*/

/* Loading overlay - covers entire viewport */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: none;
    /* Flexbox for modern browsers */
    justify-content: center;
    align-items: center;
    /* Fallback for older browsers */
    text-align: center;
}

/* Fallback positioning for older browsers */
#loading-overlay:before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
}

/* Loading container */
.loading-container {
    display: inline-block;
    vertical-align: middle;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Ensure it's always visible */
    position: relative;
    margin-top: 20vh;
}

/* Loading text */
.loading-text {
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Three dots container */
.loading-dots {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Individual dot */
.loading-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #0066cc;
    animation: loading-bounce 1.4s infinite ease-in-out both;
}

/* Stagger the animation for each dot */
.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

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

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

/* Bouncing animation keyframes */
@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Alternative pulsing animation for variety */
.loading-pulse .loading-dot {
    animation: loading-pulse 1.5s infinite ease-in-out;
}

@keyframes loading-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .loading-container {
        padding: 20px 30px;
        margin: 0 20px;
        max-width: calc(100vw - 40px);
    }
    
    .loading-text {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .loading-dot {
        width: 10px;
        height: 10px;
    }
    
    .loading-dots {
        gap: 6px;
    }
}

/* Fade in/out transitions */
.loading-fade-in {
    animation: loading-fadeIn 0.3s ease-out;
}

.loading-fade-out {
    animation: loading-fadeOut 0.2s ease-in;
}

@keyframes loading-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes loading-fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Prevent body scroll when loading is active */
body.loading-active {
    overflow: hidden;
}

/* Custom loading messages */
.loading-container.loading-api {
    background-color: rgba(240, 248, 255, 0.95);
}

.loading-container.loading-api .loading-dot {
    background-color: #1e7e34;
}

.loading-container.loading-form {
    background-color: rgba(255, 248, 240, 0.95);
}

.loading-container.loading-form .loading-dot {
    background-color: #e67e22;
}
