/* ============================================
   UNIVERSAL PAGE LOADER
   Include this in all pages for loading states
   ============================================ */

/* Page Loader Overlay */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Loader Logo */
.page-loader-logo {
    width: 180px;
    height: auto;
    margin-bottom: 30px;
    animation: logoFadeIn 0.8s ease-out;
}

/* Spinner */
.page-loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #b10202;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* Loading Text */
.page-loader-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    letter-spacing: 1px;
    font-family: "Montserrat", sans-serif;
    animation: textPulse 1.5s ease-in-out infinite;
}

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

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Content Loader (for sections within pages) */
.content-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
}

.content-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(177, 2, 2, 0.1);
    border-top-color: #b10202;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

.content-loader-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* Skeleton Loader for Cards */
.skeleton-loader {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-card {
    background: var(--admin-card, #1a1a1a);
    border: 1px solid var(--admin-border, #2a2a2a);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 10px;
}

.skeleton-text.title {
    width: 70%;
    height: 20px;
    margin-bottom: 15px;
}

.skeleton-text.short {
    width: 40%;
}

/* Admin-specific loader */
.admin-loader {
    background: var(--admin-bg);
}

.admin-loader .page-loader-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-red);
}

/* Error State */
.loader-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loader-error-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.loader-error-title {
    font-size: 18px;
    font-weight: 600;
    color: #ef4444;
    margin-bottom: 10px;
}

.loader-error-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
    max-width: 400px;
}

.loader-error-retry {
    background: #b10202;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.loader-error-retry:hover {
    background: #8a0101;
}

/* Empty State */
.loader-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.loader-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.loader-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.loader-empty-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    max-width: 400px;
}

/* Responsive */
@media (max-width: 768px) {
    .page-loader-logo {
        width: 140px;
    }
    
    .page-loader-spinner {
        width: 40px;
        height: 40px;
    }
    
    .page-loader-text {
        font-size: 12px;
    }
}