/**
 * Global Anti-Double Submission & Professional Progress & Page Loader CSS
 */

/* Top Animated Progress Bar */
#nprogress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3.5px;
    background: linear-gradient(90deg, #4f46e5, #3b82f6, #06b6d4, #10b981);
    z-index: 9999999;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    box-shadow: 0 0 12px rgba(79, 70, 229, 0.8), 0 0 4px rgba(6, 182, 212, 0.6);
    pointer-events: none;
    border-radius: 0 2px 2px 0;
}

/* Button Loading State */
.btn-is-loading {
    position: relative !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.82 !important;
    transition: all 0.2s ease-in-out !important;
}

.btn-is-loading .spinner-border {
    width: 0.95rem;
    height: 0.95rem;
    border-width: 0.15em;
    vertical-align: -0.15em;
}

/* Subtle disabled look when forms submit */
form[data-submitted="true"] button[type="submit"]:not(.btn-is-loading),
form[data-submitted="true"] input[type="submit"]:not(.btn-is-loading) {
    pointer-events: none !important;
    opacity: 0.7 !important;
}

/* Central Page Loader Overlay */
#global-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#global-page-loader.active {
    opacity: 1;
    visibility: visible;
}

.global-loader-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px 36px;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 240px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    animation: loaderPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes loaderPopIn {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.loader-logo-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    animation: loaderPulse 1.8s infinite ease-in-out;
}

.loader-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(79, 70, 229, 0.12);
    border-top-color: #4f46e5;
    border-right-color: #06b6d4;
    border-radius: 50%;
    animation: loaderSpin 0.85s linear infinite;
}

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

@keyframes loaderPulse {
    0%, 100% { transform: scale(0.92); opacity: 0.88; }
    50% { transform: scale(1.05); opacity: 1; }
}

.loader-brand-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.loader-brand-sub {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}
