/* ========================================
   ELEGANT LOADING SCREEN
   Modern, elegant preloader with smooth animations
   ======================================== */

.elegant-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.elegant-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Animated Background Pattern */
.elegant-loader::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 40px,
            rgba(227, 30, 36, 0.02) 40px,
            rgba(227, 30, 36, 0.02) 80px);
    animation: pattern-move 20s linear infinite;
}

@keyframes pattern-move {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(40px, 40px);
    }
}

/* Loader Content Container */
.loader-content {
    position: relative;
    text-align: center;
    z-index: 2;
}

/* Company Logo */
.loader-logo {
    max-width: 220px;
    height: auto;
    margin-bottom: 50px;
    opacity: 0;
    animation: logo-appear 0.8s ease-out 0.3s forwards;
}

@keyframes logo-appear {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Loading Animation Container */
.loading-animation {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
}

/* Circular Spinner */
.spinner-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    margin: -40px 0 0 -40px;
    border: 4px solid transparent;
    border-top-color: #e31e24;
    border-right-color: #e31e24;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    border-top-color: rgba(227, 30, 36, 0.5);
    border-right-color: rgba(227, 30, 36, 0.5);
    animation-duration: 1.5s;
    animation-direction: reverse;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Center Dot with Pulse */
.loader-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    background: #e31e24;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

/* Loading Text */
.loading-text {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    animation: text-fade 1s ease-out 0.6s forwards;
}

@keyframes text-fade {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animated Dots after Text */
.loading-text::after {
    content: '';
    display: inline-block;
    width: 20px;
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }

    100% {
        content: '';
    }
}

/* Progress Bar */
.progress-container {
    width: 250px;
    height: 3px;
    background: rgba(227, 30, 36, 0.1);
    border-radius: 10px;
    margin: 25px auto 0;
    overflow: hidden;
    opacity: 0;
    animation: text-fade 1s ease-out 0.8s forwards;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #e31e24 0%, #ff4444 100%);
    border-radius: 10px;
    width: 0;
    animation: progress 2s ease-out forwards;
}

@keyframes progress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .loader-logo {
        max-width: 180px;
        margin-bottom: 40px;
    }

    .loading-animation {
        width: 80px;
        height: 80px;
        margin-bottom: 25px;
    }

    .spinner-ring {
        width: 60px;
        height: 60px;
        margin: -30px 0 0 -30px;
    }

    .spinner-ring:nth-child(2) {
        width: 45px;
        height: 45px;
        margin: -22.5px 0 0 -22.5px;
    }

    .loading-text {
        font-size: 14px;
        letter-spacing: 1.5px;
    }

    .progress-container {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .loader-logo {
        max-width: 150px;
        margin-bottom: 35px;
    }

    .loading-text {
        font-size: 12px;
        letter-spacing: 1px;
    }

    .progress-container {
        width: 180px;
    }
}