/**
 * Loading Indicators Styles
 * Modern, professional loading spinners and skeletons
 */

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(79, 163, 255, 0.2);
    border-top-color: var(--primary-blue, #4FA3FF);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loading-spinner-large {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-overlay-content {
    text-align: center;
}

.loading-overlay-spinner {
    margin: 0 auto 1rem;
}

.loading-overlay-text {
    color: var(--charcoal, #1f2937);
    font-size: 1rem;
    font-weight: 500;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-outline-primary.btn-loading::after {
    border-color: rgba(79, 163, 255, 0.3);
    border-top-color: var(--primary-blue, #4FA3FF);
}

/* Form Loading State */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
    border-radius: 8px;
}

.form-loading .loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    margin-bottom: 0;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.skeleton-card {
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.page-loader-content {
    text-align: center;
}

.page-loader-logo {
    max-width: 150px;
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Progress Bar */
.loading-progress {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10001;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue, #4FA3FF), var(--primary-blue-light, #79BFFF));
    width: 0%;
    transition: width 0.3s ease;
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Inline Loading */
.inline-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--charcoal, #1f2937);
    font-size: 0.9rem;
}

/* Full Screen Loading */
.fullscreen-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    gap: 1.5rem;
}

.fullscreen-loading-text {
    font-size: 1.1rem;
    color: var(--charcoal, #1f2937);
    font-weight: 500;
}

