/* ═══════════════════════════════════════════════════════════════════
   NOTIFY.CSS — Isaflor Toast & Confirm Framework
   Loaded automatically by notify.js; may also be included manually.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Toast Container ──────────────────────────────────────────────── */
.nfy-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: 360px;
    max-width: calc(100vw - 48px);
}

/* ── Toast ────────────────────────────────────────────────────────── */
.nfy-toast {
    pointer-events: all;
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 12px 13px 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 14px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s;
}

html.dark .nfy-toast {
    background: #1c1f2e;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 1px 4px rgba(0, 0, 0, 0.2);
}

.nfy-toast:hover {
    box-shadow:
        0 6px 28px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.05);
}
html.dark .nfy-toast:hover {
    box-shadow:
        0 6px 32px rgba(0, 0, 0, 0.5),
        0 2px 6px rgba(0, 0, 0, 0.25);
}

.nfy-toast--in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.nfy-toast--out {
    opacity: 0 !important;
    transform: translateY(-10px) scale(0.97) !important;
    transition: opacity 0.25s ease, transform 0.25s ease !important;
}

/* Left accent bar */
.nfy-toast-bar {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 14px 0 0 14px;
    flex-shrink: 0;
}

/* Icon wrapper */
.nfy-toast-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 14px;
}
.nfy-toast-icon svg {
    width: 15px;
    height: 15px;
}

/* Body */
.nfy-toast-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 4px;
}

.nfy-toast-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}
html.dark .nfy-toast-title { color: #f1f5f9; }

.nfy-toast-msg {
    font-size: 12.5px;
    font-weight: 400;
    color: #64748b;
    line-height: 1.45;
    word-break: break-word;
}
html.dark .nfy-toast-msg { color: rgba(255, 255, 255, 0.48); }

/* When there's no title, the message is styled as the primary content */
.nfy-toast-msg--solo {
    font-weight: 500;
    color: #1e293b;
}
html.dark .nfy-toast-msg--solo { color: rgba(255, 255, 255, 0.85); }

/* Close button */
.nfy-toast-x {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    padding: 0;
    margin-right: 6px;
    transition: background 0.15s, color 0.15s;
    align-self: center;
}
.nfy-toast-x:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #475569;
}
html.dark .nfy-toast-x { color: rgba(255, 255, 255, 0.28); }
html.dark .nfy-toast-x:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}
.nfy-toast-x svg { width: 12px; height: 12px; }

/* Progress bar */
.nfy-toast-prog {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    border-radius: 0 0 14px 14px;
    transform-origin: left;
    animation: nfyProgShrink linear forwards;
    opacity: 0.6;
}

@keyframes nfyProgShrink {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ── Overlay ──────────────────────────────────────────────────────── */
.nfy-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 4, 12, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

html:not(.dark) .nfy-overlay {
    background: rgba(15, 23, 42, 0.52);
}

.nfy-overlay--in  { opacity: 1; }
.nfy-overlay--out { opacity: 0; pointer-events: none; }

/* ── Dialog card ──────────────────────────────────────────────────── */
.nfy-dialog {
    position: relative;
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 32px 28px 26px;
    width: min(420px, 100%);
    text-align: center;
    box-shadow:
        0 40px 90px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: scale(0.92) translateY(12px);
    transition: transform 0.32s cubic-bezier(0.34, 1.46, 0.64, 1);
}

/* Light mode dialog */
html:not(.dark) .nfy-dialog {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 4px 14px rgba(0, 0, 0, 0.06);
}

.nfy-overlay--in  .nfy-dialog { transform: scale(1) translateY(0); }
.nfy-overlay--out .nfy-dialog { transform: scale(0.92) translateY(12px); }

/* Top accent line */
.nfy-dialog-accent {
    display: block;
    position: absolute;
    top: 0;
    left: 32px;
    right: 32px;
    height: 1.5px;
    border-radius: 0 0 4px 4px;
}

/* Dialog icon */
.nfy-dialog-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 8px auto 18px;
}
.nfy-dialog-icon svg { width: 22px; height: 22px; }

/* Title */
.nfy-dialog-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.025em;
    line-height: 1.25;
    margin: 0 0 8px;
}
html:not(.dark) .nfy-dialog-title { color: #0f172a; }

/* Message */
.nfy-dialog-msg {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.46);
    line-height: 1.6;
    margin: 0 0 24px;
    word-break: break-word;
}
html:not(.dark) .nfy-dialog-msg { color: #64748b; }

/* Actions row */
.nfy-dialog-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.nfy-btn {
    flex: 1;
    padding: 11px 18px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    letter-spacing: -0.01em;
    line-height: 1;
    font-family: inherit;
}
.nfy-btn:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}
.nfy-btn:hover  { transform: translateY(-1px); }
.nfy-btn:active { transform: translateY(0) scale(0.98); }

/* Cancel */
.nfy-btn--cancel {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.65);
}
.nfy-btn--cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}
html:not(.dark) .nfy-btn--cancel {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}
html:not(.dark) .nfy-btn--cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Confirm (colored via inline style) */
.nfy-btn--ok {
    color: #ffffff;
}
.nfy-btn--ok:hover { filter: brightness(1.1); }

/* ── Spinner (_loading) ───────────────────────────────────────────── */
@keyframes nfySpin {
    to { transform: rotate(360deg); }
}
.nfy-spin-el {
    animation: nfySpin 0.75s linear infinite;
    display: block;
}

/* ── Action button (toast con acción) ─────────────────────────────── */
.nfy-toast-action {
    flex-shrink: 0;
    padding: 5px 11px;
    border-radius: 7px;
    border: 1px solid;
    background: transparent;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: opacity 0.15s, filter 0.15s;
    margin-right: 6px;
}
.nfy-toast-action:hover {
    filter: brightness(1.15);
    opacity: 0.9;
}

/* ── Prompt input ─────────────────────────────────────────────────── */
.nfy-dialog-input-wrap {
    margin-bottom: 20px;
}
.nfy-dialog-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.nfy-dialog-input:focus {
    border-color: var(--nfy-focus, #f97316);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nfy-focus, #f97316) 18%, transparent);
}
html:not(.dark) .nfy-dialog-input {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
}
html:not(.dark) .nfy-dialog-input:focus {
    border-color: var(--nfy-focus, #f97316);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}
.nfy-dialog-input::placeholder {
    color: rgba(255, 255, 255, 0.22);
}
html:not(.dark) .nfy-dialog-input::placeholder {
    color: #94a3b8;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .nfy-container {
        top: 72px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: 100%;
    }
    .nfy-dialog {
        padding: 26px 20px 22px;
        border-radius: 18px;
    }
    .nfy-dialog-actions {
        flex-direction: column-reverse;
    }
    .nfy-btn {
        padding: 13px 18px;
        font-size: 14px;
    }
}
