/* Professional Loading Indicators - Shared Styles */

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
    cursor: not-allowed;
}

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

.btn-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    z-index: 1;
}

.btn-outline-secondary.btn-loading::before,
.btn-outline-primary.btn-loading::before,
.btn-secondary.btn-loading::before {
    border: 2px solid rgba(108, 117, 125, 0.3);
    border-top-color: currentColor;
}

.btn-primary.btn-loading::before,
.btn-success.btn-loading::before {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
}

@keyframes btn-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Page/Section Loading State */
.page-loading {
    position: relative;
    min-height: 300px;
    pointer-events: none;
}

.page-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 10;
    border-radius: 10px;
}

.page-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(252, 120, 0, 0.15);
    border-top-color: #fc7800;
    border-right-color: #fc7800;
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    z-index: 11;
    box-shadow: 0 2px 10px rgba(252, 120, 0, 0.2);
}

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

/* Loading Overlay for Full Page Operations */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    animation: fadeIn 0.2s ease-in forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.loading-overlay .loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fc7800;
    border-right-color: #fc7800;
    border-radius: 50%;
    animation: spin-overlay 0.9s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    box-shadow: 0 4px 20px rgba(252, 120, 0, 0.3);
}

.loading-overlay .loading-text {
    margin-top: 20px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

/* Inline Loading Spinner */
.inline-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(252, 120, 0, 0.2);
    border-top-color: #fc7800;
    border-radius: 50%;
    animation: inline-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* Loading State for Form Sections */
.section-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.section-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(252, 120, 0, 0.15);
    border-top-color: #fc7800;
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    z-index: 10;
}

