/*
 * nidhi-notify.css — styles for the shared notification layer (nidhi-notify.js).
 * Toast stack + dialog modals. Palette follows nidhi-clean-ui.css (slate/blue).
 */

/* ------------------------------------------------------------------ */
/* Toasts                                                              */
/* ------------------------------------------------------------------ */

.nidhi-toast-root {
    position: fixed;
    top: 84px;              /* below the fixed app header */
    right: 16px;
    z-index: 10600;         /* above Bootstrap modals (1050) and footer bar (999) */
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 340px;
    max-width: calc(100vw - 32px);
    pointer-events: none;   /* clicks pass through the empty column */
}

.nidhi-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
    font-size: 0.8rem;
    color: #334155;
    pointer-events: auto;
    animation: nidhi-toast-in 0.18s ease-out;
}

.nidhi-toast.is-leaving {
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes nidhi-toast-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

.nidhi-toast__icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    line-height: 22px;
    border-radius: 50%;
    text-align: center;
    font-size: 0.7rem;
    color: #ffffff;
}

.nidhi-toast--success { border-left-color: #16a34a; }
.nidhi-toast--success .nidhi-toast__icon { background: #16a34a; }

.nidhi-toast--error { border-left-color: #dc2626; }
.nidhi-toast--error .nidhi-toast__icon { background: #dc2626; }

.nidhi-toast--warning { border-left-color: #d97706; }
.nidhi-toast--warning .nidhi-toast__icon { background: #d97706; }

.nidhi-toast--info { border-left-color: #2563eb; }
.nidhi-toast--info .nidhi-toast__icon { background: #2563eb; }

.nidhi-toast__body {
    flex: 1 1 auto;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.nidhi-toast__title {
    font-weight: 700;
    margin-bottom: 2px;
    color: #1e293b;
}

.nidhi-toast__msg {
    line-height: 1.4;
}

.nidhi-toast__close {
    flex: 0 0 auto;
    background: none;
    border: 0;
    padding: 0 2px;
    font-size: 1rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
}

.nidhi-toast__close:hover {
    color: #334155;
}

/* ------------------------------------------------------------------ */
/* Dialogs                                                             */
/* ------------------------------------------------------------------ */

.nidhi-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 10500;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: nidhi-overlay-in 0.15s ease-out;
}

@keyframes nidhi-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.nidhi-dialog {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.30);
    width: 420px;
    max-width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    animation: nidhi-dialog-in 0.18s ease-out;
}

@keyframes nidhi-dialog-in {
    from { opacity: 0; transform: translateY(-14px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.nidhi-dialog__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px 0 18px;
}

.nidhi-dialog__icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    text-align: center;
    font-size: 0.85rem;
    color: #ffffff;
    background: #2563eb;
}

.nidhi-dialog--danger .nidhi-dialog__icon { background: #dc2626; }
.nidhi-dialog--warning .nidhi-dialog__icon { background: #d97706; }

.nidhi-dialog__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.nidhi-dialog__body {
    padding: 12px 18px;
}

.nidhi-dialog__msg {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #475569;
    word-wrap: break-word;
}

.nidhi-dialog__label {
    display: block;
    margin: 10px 0 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
}

.nidhi-dialog__input {
    width: 100%;
}

.nidhi-dialog__error {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #dc2626;
    min-height: 1em;
}

.nidhi-dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 4px 18px 16px 18px;
}

.nidhi-dialog__footer .btn {
    min-width: 84px;
}

/* ------------------------------------------------------------------ */
/* Responsiveness, motion, print                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
    .nidhi-toast-root {
        top: auto;
        bottom: 70px;      /* above the fixed footer bar */
        right: 8px;
        left: 8px;
        width: auto;
    }

    .nidhi-dialog {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nidhi-toast,
    .nidhi-dialog,
    .nidhi-dialog-overlay {
        animation: none;
    }
    .nidhi-toast.is-leaving {
        transition: none;
    }
}

@media print {
    .nidhi-toast-root,
    .nidhi-dialog-overlay {
        display: none !important;
    }
}
