/* ========================================================
   MODALS & POPUPS STYLESHEET
   Quản Lý Chi Tiêu - Modular Component
   ======================================================== */

/* MODAL OVERLAY & CONTAINER */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-card {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    background: #FFFFFF;
    border-radius: var(--radius-lg, 24px);
    border: 1px solid var(--border-card, rgba(14, 165, 233, 0.16));
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.25);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: #FFFFFF;
    z-index: 2;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    background: #FAFAFA;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--text-muted, #64748B);
    cursor: pointer;
    border-radius: 8px;
    padding: 4px 8px;
    transition: all 0.2s;
}

.btn-close:hover {
    color: var(--danger, #EF4444);
    background: rgba(239, 68, 68, 0.1);
}

/* CONFIRMATION MODAL */
.confirm-card {
    max-width: 420px;
    text-align: center;
    padding: 28px 24px;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.confirm-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

.confirm-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.confirm-title {
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
}

.confirm-message {
    color: var(--text-secondary, #475569);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: none;
    padding: 0;
    background: transparent;
}

/* PWA INSTALL MODAL */
.pwa-modal-card {
    max-width: 480px;
}

.pwa-modal-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 18px;
}

.pwa-header-flex {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
}

.pwa-subtitle {
    font-size: 12px;
    color: var(--text-muted, #64748B);
    margin: 2px 0 0 0;
}

/* FUND DEPOSIT TARGET BOX */
.fund-deposit-target-box {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-card, rgba(14, 165, 233, 0.16));
}

.deposit-fund-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: #8B5CF6;
    color: #FFF;
}

.deposit-fund-name {
    font-weight: 700;
    font-size: 16px;
}

.deposit-fund-balance {
    font-size: 13px;
    color: var(--text-secondary, #475569);
    margin-top: 2px;
}

.deposit-balance-num {
    font-weight: 700;
    color: #10B981;
}

.btn-deposit-submit {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
}

.btn-save-password {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
}

/* GENERAL MODAL UTILITIES */
.card-padding-20 {
    padding: 20px;
}

.card-header-mb-16 {
    margin-bottom: 16px;
}

.btn-filter-reset {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 10px;
}

.text-fund {
    color: #A78BFA;
}

/* Profile action rows share the form surface in both themes. */
#profile-modal .profile-tab-content > .modal-footer {
    background: transparent;
    border-top: none !important;
}

#profile-modal button,
#profile-modal .btn,
#profile-modal a {
    text-decoration: none !important;
}
