:root {
    --alert-success: rgb(11, 150, 96);
    --alert-success-soft: rgba(39, 199, 135, 0.8);
    --alert-danger: rgb(211, 57, 57);
    --alert-danger-soft: rgba(255, 107, 107, 0.8);
    --alert-primary: rgba(73, 142, 250, 1);
    --alert-primary-soft: rgba(91, 155, 255, 0.8);
    --alert-warning: rgba(255, 200, 97, 1);
    --alert-warning-soft: rgba(255, 200, 97, 0.8);
    --alert-bg: rgba(255, 255, 255, 0.9);
    --alert-border: rgba(0, 0, 0, 0.08);
    --alert-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    --btn-radius: 10px;
    --btn-max-height: 44px;
    --text-color: rgba(28, 28, 28, 0.92);
    --title-color: rgba(10, 10, 10, 0.95);
}

[data-theme="dark"] {
    --alert-success: rgb(11, 150, 96);
    --alert-success-soft: rgba(55, 210, 150, 0.5);
    --alert-danger: rgb(176, 37, 37);
    --alert-danger-soft: rgba(255, 100, 100, 0.5);
    --alert-primary: rgba(27, 81, 165, 1);
    --alert-primary-soft: rgba(130, 175, 255, 0.5);
    --alert-warning: rgba(219, 162, 52, 1);
    --alert-warning-soft: rgba(255, 210, 120, 0.5);
    --alert-bg: rgba(28, 28, 33, 0.8);
    --alert-border: rgba(255, 255, 255, 0.07);
    --alert-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    --text-color: rgba(232, 232, 232, 1);
    --title-color: rgba(255, 255, 255, 1);
}

.custom-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    animation: fadeIn .25s ease;
}

[data-theme="dark"] .custom-alert-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.custom-alert-overlay.hide {
    animation: fadeOut .25s forwards;
}

.custom-alert-box {
    position: relative;
    width: 30em;
    max-width: 95%;
    padding: 28px;
    border-radius: 16px;
    background: var(--alert-bg);
    border: 1px solid var(--alert-border);
    backdrop-filter: blur(16px);
    box-shadow: var(--alert-shadow);
    animation: popIn .35s cubic-bezier(.2,.8,.2,1);
    color: var(--text-color);
}

    .custom-alert-box.hide {
        animation: popOut .25s forwards;
    }

    .custom-alert-box.success {
        background: linear-gradient(180deg, var(--alert-success-soft), transparent 80%);
    }

    .custom-alert-box.danger {
        background: linear-gradient(180deg, var(--alert-danger-soft), transparent 90%);
    }

    .custom-alert-box.primary {
        background: linear-gradient(180deg, var(--alert-primary-soft), transparent 80%);
    }

    .custom-alert-box.warning {
        background: linear-gradient(180deg, var(--alert-warning-soft), transparent 80%);
    }

.custom-alert-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    color: var(--title-color);
}

.custom-alert-message {
    max-height: 28vh;
    overflow: auto;
    padding: 8px 0 10px;
    font-size: 15px;
    color: var(--text-color);
    opacity: 0.9;
    text-align: center;
}

.custom-alert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 14px;
    border-radius: var(--btn-radius);
    border: none;
    cursor: pointer;
    max-height: var(--btn-max-height);
    transition: all .18s ease;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

    .custom-alert-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    }

.custom-alert-btn-success {
    background: var(--alert-success);
    color: #fff;
}

.custom-alert-btn-danger {
    background: var(--alert-danger);
    color: #fff;
}

.custom-alert-btn-primary {
    background: var(--alert-primary);
    color: #fff;
}

.custom-alert-btn-warning {
    background: var(--alert-warning);
    color: #000;
}

.custom-alert-btn-white {
    background: #555;
    color: #fff;
}

[data-theme="dark"] .custom-alert-btn-white {
    background: #666;
}

.custom-alert-yes-btn {
    background: var(--alert-success);
}

.custom-alert-no-btn {
    background: var(--alert-danger);
}

.custom-alert-cancel-btn {
    background: #999;
    color: #fff;
}

.custom-alert-btn-text {
    margin-left: 4px;
}

[dir="rtl"] .custom-alert-btn-text {
    margin-left: 0;
    margin-right: 4px;
}

.custom-alert-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    outline: none;
    margin-top: 10px;
    background: #fff;
    color: #222;
}

[data-theme="dark"] .custom-alert-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #eee;
}

.custom-alert-input:focus {
    border-color: var(--alert-primary);
    box-shadow: 0 0 0 2px rgba(110, 168, 254, 0.25);
}

.custom-alert-icon {
    display: flex;
    justify-content: center;
    opacity: 0.9;
    margin-bottom: 6px;
}

.custom-alert-close {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
}

[dir="rtl"] .custom-alert-close {
    right: auto;
    left: 14px;
}

.custom-alert-box div:last-child {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

@keyframes popIn {
    0% {
        transform: scale(.85);
        opacity: 0;
    }

    70% {
        transform: scale(1.03);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes popOut {
    to {
        transform: scale(.85);
        opacity: 0;
    }
}
