/* =========================================================
   Confirm modal
========================================================= */

[x-cloak] {
    display: none !important;
}

html.confirm-modal-open,
html.confirm-modal-open body {
    overflow: hidden;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    direction: rtl;
}

.confirm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.64);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.confirm-modal__positioner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: 20px;
    pointer-events: none;
}

.confirm-modal__panel {
    width: min(100%, 460px);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e7ebef;
    border-radius: 20px;
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.2),
        0 8px 24px rgba(15, 23, 42, 0.12);
    pointer-events: auto;
}

.confirm-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 0;
}

.confirm-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 16px;
    font-size: 23px;
}

.confirm-modal__icon--danger {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.confirm-modal__icon--archive {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.confirm-modal__icon--warning {
    color: #c2410c;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.confirm-modal__icon--info {
    color: #0284c7;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
}

.confirm-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    cursor: pointer;
    transition:
        color 160ms ease,
        background-color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.confirm-modal__close:hover:not(:disabled) {
    color: #161616;
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.confirm-modal__close:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.confirm-modal__body {
    padding: 20px 24px 24px;
}

.confirm-modal__title {
    margin: 0;
    color: #161616;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.7;
}

.confirm-modal__description {
    margin: 9px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 2;
}

.confirm-modal__subject {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 16px;
    padding: 12px 14px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.9;
}

.confirm-modal__subject-label {
    flex: 0 0 auto;
    color: #64748b;
}

.confirm-modal__subject-value {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #1e293b;
    font-weight: 700;
}

.confirm-modal__error {
    margin-top: 14px;
    padding: 10px 12px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.9;
}

.confirm-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    background: #f8fafc;
    border-top: 1px solid #e7ebef;
}

.confirm-modal__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 108px;
    min-height: 44px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    transition:
        color 160ms ease,
        background-color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.confirm-modal__button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.confirm-modal__button:focus-visible,
.confirm-modal__close:focus-visible {
    outline: 3px solid rgba(0, 179, 155, 0.2);
    outline-offset: 2px;
}

.confirm-modal__button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.confirm-modal__button--cancel {
    color: #475569;
    background: #ffffff;
    border-color: #dbe2e8;
}

.confirm-modal__button--cancel:hover:not(:disabled) {
    color: #161616;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.confirm-modal__button--danger {
    color: #ffffff;
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.2);
}

.confirm-modal__button--danger:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
}

.confirm-modal__button--archive,
.confirm-modal__button--warning {
    color: #ffffff;
    background: #d97706;
    border-color: #d97706;
    box-shadow: 0 8px 18px rgba(217, 119, 6, 0.2);
}

.confirm-modal__button--archive:hover:not(:disabled),
.confirm-modal__button--warning:hover:not(:disabled) {
    background: #b45309;
    border-color: #b45309;
}

.confirm-modal__button--info {
    color: #ffffff;
    background: #00b39b;
    border-color: #00b39b;
    box-shadow: 0 8px 18px rgba(0, 179, 155, 0.2);
}

.confirm-modal__button--info:hover:not(:disabled) {
    background: #009985;
    border-color: #009985;
}

.confirm-modal__spinner {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: confirm-modal-spin 700ms linear infinite;
}

/* =========================================================
   Transitions
========================================================= */

.confirm-modal-transition-enter,
.confirm-modal-transition-leave {
    transition: opacity 180ms ease;
}

.confirm-modal-transition-enter-start,
.confirm-modal-transition-leave-end {
    opacity: 0;
}

.confirm-modal-transition-enter-end,
.confirm-modal-transition-leave-start {
    opacity: 1;
}

.confirm-modal-panel-enter {
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.confirm-modal-panel-enter-start {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
}

.confirm-modal-panel-enter-end {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.confirm-modal-panel-leave {
    transition:
        opacity 140ms ease,
        transform 140ms ease;
}

.confirm-modal-panel-leave-start {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.confirm-modal-panel-leave-end {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
}

@keyframes confirm-modal-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   Dark theme
========================================================= */

[data-theme="dark"] .confirm-modal__backdrop {
    background: rgba(0, 0, 0, 0.72);
}

[data-theme="dark"] .confirm-modal__panel {
    background: #232323;
    border-color: #383838;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .confirm-modal__title {
    color: #f8fafc;
}

[data-theme="dark"] .confirm-modal__description {
    color: #a8b0ba;
}

[data-theme="dark"] .confirm-modal__close {
    color: #a8b0ba;
    background: #2c2c2c;
    border-color: #3d3d3d;
}

[data-theme="dark"] .confirm-modal__close:hover:not(:disabled) {
    color: #ffffff;
    background: #343434;
    border-color: #4a4a4a;
}

[data-theme="dark"] .confirm-modal__subject {
    color: #cbd5e1;
    background: #1c1c1c;
    border-color: #383838;
}

[data-theme="dark"] .confirm-modal__subject-label {
    color: #94a3b8;
}

[data-theme="dark"] .confirm-modal__subject-value {
    color: #f1f5f9;
}

[data-theme="dark"] .confirm-modal__error {
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.22);
    border-color: rgba(248, 113, 113, 0.3);
}

[data-theme="dark"] .confirm-modal__footer {
    background: #1c1c1c;
    border-color: #383838;
}

[data-theme="dark"] .confirm-modal__button--cancel {
    color: #cbd5e1;
    background: #2c2c2c;
    border-color: #424242;
}

[data-theme="dark"] .confirm-modal__button--cancel:hover:not(:disabled) {
    color: #ffffff;
    background: #343434;
    border-color: #505050;
}

[data-theme="dark"] .confirm-modal__icon--danger {
    color: #f87171;
    background: rgba(127, 29, 29, 0.22);
    border-color: rgba(248, 113, 113, 0.28);
}

[data-theme="dark"] .confirm-modal__icon--archive {
    color: #fbbf24;
    background: rgba(120, 53, 15, 0.23);
    border-color: rgba(251, 191, 36, 0.28);
}

[data-theme="dark"] .confirm-modal__icon--warning {
    color: #fb923c;
    background: rgba(124, 45, 18, 0.23);
    border-color: rgba(251, 146, 60, 0.28);
}

[data-theme="dark"] .confirm-modal__icon--info {
    color: #2dd4bf;
    background: rgba(13, 148, 136, 0.14);
    border-color: rgba(45, 212, 191, 0.24);
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 575.98px) {
    .confirm-modal__positioner {
        align-items: flex-end;
        padding: 12px;
    }

    .confirm-modal__panel {
        width: 100%;
        border-radius: 18px;
    }

    .confirm-modal__header {
        padding: 20px 18px 0;
    }

    .confirm-modal__body {
        padding: 18px 18px 20px;
    }

    .confirm-modal__footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 14px 18px 18px;
    }

    .confirm-modal__button {
        width: 100%;
        min-width: 0;
        padding-inline: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .confirm-modal-transition-enter,
    .confirm-modal-transition-leave,
    .confirm-modal-panel-enter,
    .confirm-modal-panel-leave,
    .confirm-modal__button,
    .confirm-modal__close {
        transition: none !important;
    }
}
