/* Loading Indicators for Page Navigation */

/* Global Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.page-loader.active {
    display: flex;
}

/* Spinner Animation */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #00A0B0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Text */
.loading-text {
    margin-top: 20px;
    font-size: 16px;
    color: #6b7280;
    font-weight: 500;
}

/* Navigation Link Loading States */
.nav-link.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.nav-link.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid #00A0B0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translateY(-50%);
}

/* Button Loading States */
.btn.loading {
    position: relative;
    pointer-events: none;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

/* Card Loading Skeleton */
.card.loading {
    position: relative;
    overflow: hidden;
}

.card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Progress Bar */
.progress-bar-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #00A0B0, #4ade80);
    z-index: 9998;
    transition: width 0.3s ease;
}

/* Mobile Loading Indicators */
@media (max-width: 768px) {
    .page-loader {
        background: rgba(255, 255, 255, 0.98);
    }
    
    .spinner {
        width: 40px;
        height: 40px;
    }
    
    .loading-text {
        font-size: 14px;
    }
}

/* Skeleton Loading for Content */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-image {
    height: 200px;
    margin-bottom: 12px;
    border-radius: 8px;
}

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

/* Specific Component Loaders */
.search-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #00A0B0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

/* Toast-style Loading Notification */
.loading-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9997;
    transform: translateY(100px);
    transition: transform 0.3s ease;
}

.loading-toast.show {
    transform: translateY(0);
}

.loading-toast .mini-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Pulse Animation for Loading States */
.pulse-loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}