/**
 * Modern Preloader Styles
 * Reusable preloader component for all pages
 */

.page-preloader {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-preloader.hidden {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.preloader-content {
    text-align: center;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preloader-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 35px;
    position: relative;
    display: none;
}

.preloader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: logoFloat 2s ease-in-out infinite;
}

.preloader-logo.has-logo {
    display: block;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.preloader-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    position: relative;
}

.preloader-spinner::before,
.preloader-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.preloader-spinner::before {
    width: 60px;
    height: 60px;
    border: 3px solid #e0e0e0;
    border-top-color: #00a149;
    animation: spin 1s linear infinite;
}

.preloader-spinner::after {
    width: 45px;
    height: 45px;
    top: 7.5px;
    left: 7.5px;
    border: 3px solid #f0f0f0;
    border-bottom-color: #319131;
    animation: spin 0.7s linear infinite reverse;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.preloader-text {
    color: #1f2937;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #00a149 0%, #319131 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

.preloader-subtitle {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.preloader-dots {
    display: inline-block;
    width: 20px;
}

.preloader-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}
