/* 
==================================
Modern Loader Styles - Professional Design
==================================
*/

/* Loader Container */
.loader-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-display.hide-loader {
    opacity: 0;
    visibility: hidden;
}

/* Logo Loading Container */
.logo-loading {
    text-align: center;
    animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Logo Icon */
.logo-loading .icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #257396 0%, #1a5571 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 15px 50px rgba(37, 115, 150, 0.3);
    position: relative;
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-loading .icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(135deg, #89d5f6, #257396, #89d5f6);
    border-radius: inherit;
    z-index: -1;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.logo-loading .icon img {
    max-width: 60%;
    max-height: 60%;
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    position: relative;
    z-index: 1;
}

/* Loading Text */
.logo-loading h6 {
    color: #257396;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Modern Loader Animation - Circular Dots */
.loader-ellipsis {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    height: 30px;
}

.loader-ellipsis div {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #257396, #89d5f6);
    animation: bounce 1.4s infinite ease-in-out both;
    box-shadow: 0 4px 10px rgba(37, 115, 150, 0.3);
}

.loader-ellipsis div:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-ellipsis div:nth-child(2) {
    animation-delay: -0.16s;
}

.loader-ellipsis div:nth-child(3) {
    animation-delay: 0s;
}

.loader-ellipsis div:nth-child(4) {
    animation-delay: 0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Alternative Spinner Loader */
.loader-spinner {
    display: none; /* Hidden by default, can be used as alternative */
    width: 50px;
    height: 50px;
    margin: 1rem auto 0;
    border: 4px solid rgba(137, 213, 246, 0.2);
    border-top: 4px solid #89d5f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress Bar (Optional) */
.loader-progress {
    display: none; /* Hidden by default */
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 1.5rem auto 0;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #89d5f6, #257396);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
        margin-left: 0%;
    }
    50% {
        width: 70%;
        margin-left: 15%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

/* Loading Text Animation */
.loading-text {
    display: none; /* Hidden by default */
    color: #89d5f6;
    font-size: 0.9rem;
    margin-top: 1rem;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 576px) {
    .logo-loading .icon {
        width: 80px;
        height: 80px;
    }
    
    .logo-loading h6 {
        font-size: 1.1rem;
    }
    
    .loader-ellipsis {
        transform: scale(0.9);
    }
}

/* Background Animation Elements */
.loader-display::before,
.loader-display::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.loader-display::before {
    top: -10%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #89d5f6 0%, transparent 70%);
    animation: floatLoader1 8s ease-in-out infinite;
}

.loader-display::after {
    bottom: -10%;
    left: -5%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #89d5f6 0%, transparent 70%);
    animation: floatLoader2 10s ease-in-out infinite reverse;
}

@keyframes floatLoader1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-20px, -20px) scale(1.1);
    }
}

@keyframes floatLoader2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(20px, 20px) scale(1.1);
    }
}
