/* ===== Page Loader ===== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #be3733 0%, #8c2a27 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
    max-width: 300px;
    width: 100%;
}

/* Spinner Rings */
.spinner-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #fff;
    border-bottom-color: rgba(255, 200, 200, 0.3);
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-top-color: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(190, 55, 51, 0.2);
    animation-direction: reverse;
    animation-duration: 1.2s;
}

.spinner-ring:nth-child(3) {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    border-top-color: rgba(255, 255, 255, 0.7);
    border-bottom-color: rgba(190, 55, 51, 0.1);
    animation-duration: 1s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loader Logo */
.loader-logo {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Logo Image - SINGLE DEFINITION */
.loader-logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Loader Text */
.loader-text {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.9;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.95);
}

/* Progress Bar */
.loader-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff9a9a, #be3733, #8c2a27);
    border-radius: 10px;
    animation: progress 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(190, 55, 51, 0.5);
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .page-loader {
        background: linear-gradient(135deg, #be3733 0%, #a1302d 100%);
    }
    
    .loader-logo {
        font-size: 20px;
    }
    
    .loader-logo-img {
        width: 35px;
        height: 35px;
    }
    
    .spinner-loader {
        width: 60px;
        height: 60px;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    .page-loader {
        background: linear-gradient(135deg, #2d1a1a 0%, #1a0f0f 100%);
    }
    
    .page-loader .loader-logo span,
    .page-loader .loader-text {
        color: #ffb3b3;
    }
    
    .spinner-ring {
        border-top-color: #ffb3b3;
        border-bottom-color: rgba(190, 55, 51, 0.2);
    }
}

/* ===== Print Styles ===== */
@media print {
    .page-loader {
        display: none !important;
    }
}