@keyframes modalFadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.9); }
}

@keyframes modalBGFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* ─── CUSTOM MODAL STYLES ─── */
#alertModal .modal-content {
    background: linear-gradient(135deg, #fafdff 70%, #e3f0ff 100%);
    border-radius: 14px;
    box-shadow: 0 4px 32px rgba(0, 80, 180, 0.18), 0 1.5px 8px rgba(0, 80, 180, 0.08);
    border: 1px solid #e3e8f0;
    padding: 1.5rem 2.5rem;
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

#confirmModal .modal-content {
    background: linear-gradient(120deg, #fff 80%, #eafff7 100%);
    border-radius: 14px;
    box-shadow: 0 4px 32px rgba(0, 180, 80, 0.18), 0 1.5px 8px rgba(0, 180, 80, 0.08);
    border: 1px solid #e3e8f0;
    padding: 1.5rem 2.5rem;
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

#promptModal .modal-content {
    background: linear-gradient(120deg, #fff 80%, #fffbe3 100%);
    border-radius: 14px;
    box-shadow: 0 4px 32px rgba(180, 160, 0, 0.18), 0 1.5px 8px rgba(180, 160, 0, 0.08);
    border: 1px solid #e3e8f0;
    padding: 1.5rem 2.5rem;
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

#invoice-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

#payment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

#appointment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

#consultation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 100px auto;
    padding: 20px;
    width: max-content;
    position: relative;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.refresh-button {
    margin-left: 10px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
    font-size: 18px;
}

.refresh-button img {
    width: 48px;
    height: 48px;
}

.refresh-button:hover {
    background: url('refresh-logo-hover.png') no-repeat center center;
    padding: 10px;
    cursor: pointer;
}

.invoice-item {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin: 10px 0;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.invoice-item:hover {
    background: rgba(240, 240, 240, 0.5);
}

.consultation-item {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin: 10px 0;
    position: relative;
}

.loading-bar {
    height: 5px;
    width: 100%;
    background-color: #004080;
    position: relative;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-content--closing {
    animation: modalFadeOut 0.35s ease forwards !important;
}

.modal--closing {
    animation: modalBGFadeOut 0.35s ease forwards !important;
}

@keyframes loading-animation {
    0% {
        transform: scaleX(0);
    }

    50% {
        transform: scaleX(1);
    }

    100% {
        transform: scaleX(0);
    }
}

.loading-bar.active {
    animation: loading-animation 2s ease-in-out infinite;
    opacity: 1;
}

.invoice-title {
    cursor: pointer;
    font-weight: bold;
    margin: 10px 0;
}

.arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
    float: right;
    cursor: pointer;
}

.invoice-scrollable {
    max-height: 800px;
    overflow-y: auto;
}

.spinner {
    width: 3rem;
    /* Adjust size as needed */
    height: 3rem;
    /* Adjust size as needed */
    animation: spin 1s linear infinite;
    /* Spin animation */
}

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

    100% {
        transform: rotate(360deg);
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    /* Center vertically */
    justify-content: center;
    /* Center horizontally */
    z-index: 1050;
    /* Bootstrap modal z-index */
    backdrop-filter: blur(5px);
    /* Optional: add a blur effect */
}

.modal--no-blur {
    backdrop-filter: none;
    /* Remove blur effect */
}

.modal-body {
    background: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center content */
    justify-content: center;
    /* Center content */
}

.modal-dialog {
    display: flex;
    align-items: center;
    /* Center content of modal */
    background: none;
    box-shadow: none;
}

.modal-content {
    border: none;
    /* Remove border if needed */
    background: none;
    /* Make background transparent */
    box-shadow: none;
}

/* Modal close button styled like .btn-close but with custom texture */
.modal-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
    /* Use your close icon, center and cover */
    background-image: url('../images/ui/closebtn-black.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
    opacity: 0.7;
    transition: opacity 0.2s, box-shadow 0.2s;
    /* Remove default content property */
    content: '';
}

.modal-close-button:hover,
.modal-close-button:focus {
    opacity: 0.5;
    background-image: url('../images/ui/closebtn-black.png');
    background-repeat: no-repeat;
    background-position: center;
}

/* ─── EDIT USER MODAL STYLING ─── */
#editUserModal .modal-dialog {
    /* center & constrain width */
    max-width: 800px;
    margin: 1.5rem auto;
    width: 100%;
    padding: 0 1rem;
    /* side padding on very small */
}

#editUserModal .modal-content {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-width: 500px;
    width: 100%;
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin: 0 auto;
    display: block;
}

#editUserModal .modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    box-sizing: border-box;
    padding-top: 1.5rem !important;
    padding-bottom: 1rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

#editUserModal .modal-body .form-control {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    display: block;
}

#editUserModal .mb-2,
#editUserModal .form-check {
    width: 100%;
    max-width: 100%;
    display: block;
}

#editUserModal .modal-header,
#editUserModal .modal-footer {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

#editUserModal .modal-body {
    display: block;
}

#editUserModal .modal-body {
    align-items: unset !important;
    justify-content: unset !important;
}