/* Match jquery-confirm popups (successAlert/failAlert/errorAlert/$.confirm) to the Investia theme.
   !important throughout: jquery-confirm's own bundled "dark" theme CSS ties on specificity
   with plain overrides and wins on source order in some builds, so overrides must out-rank it. */

.jconfirm .jconfirm-box {
    width: 90% !important;
    max-width: 440px !important;
    background: var(--bg-card, #16161f) !important;
    border: 1px solid var(--border, rgba(45,212,168,0.12)) !important;
    border-radius: 16px !important;
    color: var(--text-primary, #f0ece4) !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
    padding: 1.5rem !important;
}

.jconfirm .jconfirm-title-c {
    color: var(--text-primary, #f0ece4) !important;
    font-weight: 700 !important;
    font-size: 1.15rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Title SVG Icon Helpers */
.jc-title-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
}
.jc-title-icon svg { width: 20px; height: 20px; flex-shrink: 0; }

.jc-title-success { background: rgba(45, 212, 168, 0.15); color: var(--accent, #2dd4a8); }
.jc-title-error { background: rgba(231, 76, 94, 0.15); color: var(--danger, #e74c5e); }
.jc-title-warning { background: rgba(240, 160, 48, 0.15); color: var(--warning, #f0a030); }
.jc-title-confirm { background: rgba(74, 144, 217, 0.15); color: var(--blue, #4a90d9); }

.jconfirm .jconfirm-content-pane,
.jconfirm .jconfirm-content {
    color: var(--text-secondary, #9a958c) !important;
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
}

.jconfirm .jconfirm-closeIcon {
    color: var(--text-muted, #5a5650) !important;
    top: 1rem !important; right: 1rem !important;
}
.jconfirm .jconfirm-closeIcon:hover {
    color: var(--danger, #e74c5e) !important;
}

.jconfirm .jconfirm-bg {
    background-color: rgba(0,0,0,0.65) !important;
    backdrop-filter: blur(4px) !important;
}

.jconfirm .jconfirm-buttons {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 0.5rem !important;
    margin-top: 1.25rem !important;
    float: none !important;
}

/* Reset base button styles inside jconfirm */
.jconfirm .jconfirm-buttons button,
.jconfirm .jconfirm-buttons .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    border-radius: var(--btn-radius-sm, 8px) !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    font-family: inherit !important;
    text-transform: none !important;
    padding: 0.55rem 1.25rem !important;
    cursor: pointer !important;
    transition: all 0.25s !important;
    margin: 0 !important;
    float: none !important;
    outline: none !important;
}

/* ── Primary / Success Button ── */
.jconfirm .jconfirm-buttons button.btn-primary,
.jconfirm .jconfirm-buttons button.btn-success,
.jconfirm .jconfirm-buttons button.btn-green {
    background: var(--btn-primary-bg, linear-gradient(135deg, #2dd4a8, #1aab87)) !important;
    color: var(--bg-primary, #0a0a0f) !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(45,212,168,0.25) !important;
}
.jconfirm .jconfirm-buttons button.btn-primary:hover,
.jconfirm .jconfirm-buttons button.btn-success:hover,
.jconfirm .jconfirm-buttons button.btn-green:hover {
    box-shadow: 0 6px 18px rgba(45,212,168,0.35) !important;
    transform: translateY(-1px) !important;
}

/* ── Danger / Red Button ── */
.jconfirm .jconfirm-buttons button.btn-danger,
.jconfirm .jconfirm-buttons button.btn-red {
    background: var(--btn-danger-bg, rgba(231,76,94,0.12)) !important;
    border: 1px solid var(--btn-danger-border, #e74c5e) !important;
    color: var(--btn-danger-color, #e74c5e) !important;
    box-shadow: none !important;
}
.jconfirm .jconfirm-buttons button.btn-danger:hover,
.jconfirm .jconfirm-buttons button.btn-red:hover {
    background: var(--btn-danger-hover-bg, rgba(231,76,94,0.22)) !important;
    box-shadow: 0 4px 12px rgba(231,76,94,0.2) !important;
    transform: translateY(-1px) !important;
}

/* ── Warning / Amber Button ── */
.jconfirm .jconfirm-buttons button.btn-warning,
.jconfirm .jconfirm-buttons button.btn-orange {
    background: var(--btn-warning-bg, rgba(240,160,48,0.12)) !important;
    border: 1px solid var(--btn-warning-border, #f0a030) !important;
    color: var(--btn-warning-color, #f0a030) !important;
}
.jconfirm .jconfirm-buttons button.btn-warning:hover,
.jconfirm .jconfirm-buttons button.btn-orange:hover {
    background: rgba(240,160,48,0.22) !important;
    transform: translateY(-1px) !important;
}

/* ── Secondary / Blue Button ── */
.jconfirm .jconfirm-buttons button.btn-secondary,
.jconfirm .jconfirm-buttons button.btn-blue {
    background: var(--btn-secondary-bg, rgba(74,144,217,0.14)) !important;
    border: 1px solid var(--btn-secondary-border, #4a90d9) !important;
    color: var(--btn-secondary-color, #4a90d9) !important;
}
.jconfirm .jconfirm-buttons button.btn-secondary:hover,
.jconfirm .jconfirm-buttons button.btn-blue:hover {
    background: rgba(74,144,217,0.28) !important;
    transform: translateY(-1px) !important;
}

/* ── Ghost / Cancel / Default Neutral Button ── */
.jconfirm .jconfirm-buttons button.btn-default,
.jconfirm .jconfirm-buttons button.btn-ghost,
.jconfirm .jconfirm-buttons button.btn-cancel {
    background: transparent !important;
    border: 1px solid var(--border, rgba(45,212,168,0.12)) !important;
    color: var(--text-secondary, #9a958c) !important;
    box-shadow: none !important;
}
.jconfirm .jconfirm-buttons button.btn-default:hover,
.jconfirm .jconfirm-buttons button.btn-ghost:hover,
.jconfirm .jconfirm-buttons button.btn-cancel:hover {
    border-color: var(--text-muted, #5a5650) !important;
    color: var(--text-primary, #f0ece4) !important;
    background: rgba(255,255,255,0.06) !important;
}

/* Top accent bar matching type */
.jconfirm.jconfirm-type-green .jconfirm-box { border-top: 4px solid var(--accent, #2dd4a8) !important; }
.jconfirm.jconfirm-type-red .jconfirm-box { border-top: 4px solid var(--danger, #e74c5e) !important; }
.jconfirm.jconfirm-type-blue .jconfirm-box { border-top: 4px solid var(--blue, #4a90d9) !important; }
.jconfirm.jconfirm-type-orange .jconfirm-box { border-top: 4px solid var(--warning, #f0a030) !important; }

.jconfirm .jconfirm-content ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.jconfirm .jconfirm-content li { margin-bottom: 0.2rem; }

/* ── Light Mode Overrides ── */
body.light-mode .jconfirm .jconfirm-box {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.08) !important;
    color: #1a1a2e !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15) !important;
}
body.light-mode .jconfirm .jconfirm-title-c { color: #1a1a2e !important; }
body.light-mode .jconfirm .jconfirm-content-pane,
body.light-mode .jconfirm .jconfirm-content { color: #5a5f6d !important; }
body.light-mode .jconfirm .jconfirm-buttons button.btn-default,
body.light-mode .jconfirm .jconfirm-buttons button.btn-ghost,
body.light-mode .jconfirm .jconfirm-buttons button.btn-cancel {
    border-color: rgba(0,0,0,0.15) !important;
    color: #5a5f6d !important;
}
body.light-mode .jconfirm .jconfirm-buttons button.btn-default:hover,
body.light-mode .jconfirm .jconfirm-buttons button.btn-ghost:hover,
body.light-mode .jconfirm .jconfirm-buttons button.btn-cancel:hover {
    border-color: rgba(0,0,0,0.3) !important;
    color: #1a1a2e !important;
    background: rgba(0,0,0,0.04) !important;
}
