/**
 * WePref India & Squinal Pvt Ltd - Global Reactivity System
 * Dynamic Visual Feedback, Spinners, Top Progress Bar & Ripple Effects
 */

/* ==========================================================================
   1. Top Page Transition Progress Bar
   ========================================================================== */
#wepref-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999999;
    pointer-events: none;
    overflow: hidden;
}

#wepref-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #2563eb;
    border-radius: 0 2px 2px 0;
    transition: width 0.35s ease, opacity 0.4s ease;
    opacity: 0;
}

/* ==========================================================================
   2. Interactive Button Active & Press Feedback
   ========================================================================== */
button:not([disabled]):active,
.btn:not([disabled]):active,
input[type="submit"]:not([disabled]):active,
input[type="button"]:not([disabled]):active,
[role="button"]:not([disabled]):active {
    transform: scale(0.97) !important;
    transition: transform 0.05s ease-in-out !important;
}

/* Smooth transition back */
button,
.btn,
input[type="submit"],
input[type="button"],
[role="button"] {
    position: relative;
    transition: transform 0.15s ease, background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

/* ==========================================================================
   3. Material Ripple Wave Animation
   ========================================================================== */
.wepref-ripple-container {
    overflow: hidden !important;
}

.wepref-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: wepref-ripple-animation 0.6s cubic-bezier(0, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10;
}

.wepref-ripple-light {
    background-color: rgba(255, 255, 255, 0.42);
}

.wepref-ripple-dark {
    background-color: rgba(0, 0, 0, 0.18);
}

@keyframes wepref-ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==========================================================================
   4. Loading State & Spinners
   ========================================================================== */
.is-loading,
button.is-loading,
.btn.is-loading {
    position: relative !important;
    pointer-events: none !important;
    cursor: wait !important;
    opacity: 0.85 !important;
    user-select: none !important;
}

button:disabled,
input[type="submit"]:disabled,
.btn.disabled {
    cursor: not-allowed !important;
}

/* Inline Spinner */
.wepref-btn-spinner {
    display: inline-block;
    width: 1.05em;
    height: 1.05em;
    vertical-align: -0.16em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: wepref-spin 0.65s linear infinite;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

@keyframes wepref-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Pulse highlight on interactive elements */
.wepref-pulse-active {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35) !important;
}

/* ==========================================================================
   4. Customer Modal Dialog System
   ========================================================================== */


#assignCustomerModalBackdrop {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 999999 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}

#assignCustomerModalDialog {
    position: relative !important;
    width: 100% !important;
    max-width: 520px !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden !important;
    animation: advModalPop 0.18s ease-out !important;
}

@keyframes advModalPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Guarantee primary-button is ALWAYS solid blue with white text */
.primary-button,
button.primary-button,
a.primary-button,
input[type="submit"].primary-button {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border: 1px solid #1d4ed8 !important;
}

.primary-button:hover,
button.primary-button:hover,
a.primary-button:hover,
input[type="submit"].primary-button:hover {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
}