/* ═══════════════════════════════════════════════════════════════
   ECEL Alert System — CSS
   HellRaiser theme: dark glass, red/gold accents
   ═══════════════════════════════════════════════════════════════ */

/* ────────────── Toast Stack ────────────── */
.ecel-toast-stack {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 99999;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.6rem;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 2rem);
}

/* ────────────── Single Toast ────────────── */
.ecel-toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-family: 'Inter', 'Barlow', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    pointer-events: auto;
    transform: translateX(110%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.05);
}

.ecel-toast--visible {
    transform: translateX(0);
    opacity: 1;
}

.ecel-toast--exit {
    transform: translateX(110%);
    opacity: 0;
}

/* Toast icon */
.ecel-toast__icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.ecel-toast__msg {
    flex: 1;
    word-break: break-word;
}

.ecel-toast__close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 0 0.2rem;
    line-height: 1;
}
.ecel-toast__close:hover { opacity: 1; }

/* ── Toast variants ── */
.ecel-toast--success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}
.ecel-toast--success .ecel-toast__icon { color: #10b981; }

.ecel-toast--error {
    background: rgba(220, 38, 38, 0.18);
    border: 1px solid rgba(220, 38, 38, 0.5);
    color: #fca5a5;
}
.ecel-toast--error .ecel-toast__icon { color: #ef4444; }

.ecel-toast--warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fde68a;
}
.ecel-toast--warning .ecel-toast__icon { color: #f59e0b; }

.ecel-toast--info {
    background: rgba(17, 23, 37, 0.92);
    border: 1px solid rgba(220, 38, 38, 0.25);
    color: #e5e7eb;
}
.ecel-toast--info .ecel-toast__icon { color: #dc2626; }


/* ═══════════════════════════════════════════════════════════════
   Modal Overlay (Confirm / Prompt)
   ═══════════════════════════════════════════════════════════════ */
.ecel-modal__overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}
.ecel-modal--active {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.ecel-modal--closing {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

/* ────────────── Modal Card ────────────── */
.ecel-modal__card {
    background: linear-gradient(165deg, #1a1a2e 0%, #16161a 60%, #1a1017 100%);
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 60px rgba(220,38,38,0.08);
    overflow: hidden;
    transform: scale(0.88) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s ease;
}
.ecel-modal--active .ecel-modal__card {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.ecel-modal--closing .ecel-modal__card {
    transform: scale(0.92) translateY(10px);
    opacity: 0;
}

/* ── Card type accents (top glow line) ── */
.ecel-modal--warning {
    border-top: 3px solid #f59e0b;
}
.ecel-modal--danger {
    border-top: 3px solid #dc2626;
}
.ecel-modal--info {
    border-top: 3px solid #dc2626;
}

/* ────────────── Header ────────────── */
.ecel-modal__header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.2rem 1.4rem 0.5rem;
}

.ecel-modal__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.ecel-modal--warning .ecel-modal__icon { color: #f59e0b; }
.ecel-modal--danger  .ecel-modal__icon { color: #ef4444; }
.ecel-modal--info    .ecel-modal__icon { color: #dc2626; }

.ecel-modal__title {
    margin: 0;
    font-family: 'Bebas Neue', 'Barlow', sans-serif;
    font-size: 1.35rem;
    letter-spacing: 0.06em;
    color: #f3f4f6;
    text-transform: uppercase;
}

/* ────────────── Body ────────────── */
.ecel-modal__body {
    padding: 0.5rem 1.4rem 1rem;
    font-family: 'Inter', 'Barlow', sans-serif;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #9ca3af;
    white-space: pre-line;
}

/* ────────────── Input (prompt) ────────────── */
.ecel-modal__input-wrap {
    padding: 0 1.4rem 0.8rem;
}

.ecel-modal__input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(220,38,38,0.25);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-family: 'Inter', 'Barlow', sans-serif;
    font-size: 0.88rem;
    color: #f3f4f6;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.ecel-modal__input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}
.ecel-modal__input::placeholder {
    color: rgba(156,163,175,0.5);
}

.ecel-modal__textarea {
    min-height: 80px;
    resize: vertical;
}

/* ────────────── Actions ────────────── */
.ecel-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.8rem 1.4rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.ecel-modal__btn {
    padding: 0.55rem 1.3rem;
    border-radius: 8px;
    border: none;
    font-family: 'Barlow', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ecel-modal__btn--cancel {
    background: rgba(255,255,255,0.06);
    color: #9ca3af;
    border: 1px solid rgba(255,255,255,0.08);
}
.ecel-modal__btn--cancel:hover {
    background: rgba(255,255,255,0.1);
    color: #e5e7eb;
}

.ecel-modal__btn--confirm {
    color: #fff;
}

/* Confirm button variants */
.ecel-modal__btn--warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 15px rgba(245,158,11,0.25);
}
.ecel-modal__btn--warning:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 20px rgba(245,158,11,0.4);
    transform: translateY(-1px);
}

.ecel-modal__btn--danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 15px rgba(220,38,38,0.25);
}
.ecel-modal__btn--danger:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 20px rgba(220,38,38,0.4);
    transform: translateY(-1px);
}

.ecel-modal__btn--info {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    box-shadow: 0 4px 15px rgba(220,38,38,0.25);
}
.ecel-modal__btn--info:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 20px rgba(220,38,38,0.4);
    transform: translateY(-1px);
}

/* ────────────── Responsive ────────────── */
@media (max-width: 480px) {
    .ecel-toast-stack {
        bottom: 1rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
        width: auto;
    }
    .ecel-modal__card {
        max-width: 100%;
    }
    .ecel-modal__title {
        font-size: 1.15rem;
    }
    .ecel-modal__actions {
        flex-direction: column-reverse;
    }
    .ecel-modal__btn {
        width: 100%;
        text-align: center;
    }
}
