/* ============================================
   Toast Notification System
   Bihar Vihaan Enterprise
   ============================================ */

/* --- Toast Container --- */
#bv-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 40px);
}

/* --- Individual Toast --- */
.bv-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    transform: translateX(calc(100% + 20px));
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.bv-toast.bv-toast-show {
    transform: translateX(0);
    opacity: 1;
}

.bv-toast.bv-toast-hide {
    transform: translateX(calc(100% + 20px));
    opacity: 0;
}

/* --- Type Borders --- */
.bv-toast-success { border-left-color: #16a34a; }
.bv-toast-error   { border-left-color: #dc2626; }
.bv-toast-warning { border-left-color: #d97706; }
.bv-toast-info    { border-left-color: #2563eb; }

/* --- Icon --- */
.bv-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    font-size: 15px;
    line-height: 1;
}

.bv-toast-success .bv-toast-icon { color: #16a34a; }
.bv-toast-error   .bv-toast-icon { color: #dc2626; }
.bv-toast-warning .bv-toast-icon { color: #d97706; }
.bv-toast-info    .bv-toast-icon { color: #2563eb; }

/* --- Message --- */
.bv-toast-message {
    flex: 1;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
    color: #1e293b;
    padding-right: 8px;
}

/* --- Close Button --- */
.bv-toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}

.bv-toast-close:hover {
    color: #475569;
    background: #f1f5f9;
}

.bv-toast-close:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

/* --- Progress Bar --- */
.bv-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
}

.bv-toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: bv-toast-timer linear forwards;
}

.bv-toast-success .bv-toast-progress-bar { background: #16a34a; }
.bv-toast-error   .bv-toast-progress-bar { background: #dc2626; }
.bv-toast-warning .bv-toast-progress-bar { background: #d97706; }
.bv-toast-info    .bv-toast-progress-bar { background: #2563eb; }

@keyframes bv-toast-timer {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* --- Mobile --- */
@media (max-width: 576px) {
    #bv-toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
        width: auto;
    }

    .bv-toast {
        padding: 12px 14px;
    }

    .bv-toast-message {
        font-size: 0.8125rem;
    }
}

/* --- Dark mode support --- */
[data-theme="dark"] .bv-toast,
body.dark-mode .bv-toast {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .bv-toast-message,
body.dark-mode .bv-toast-message {
    color: #f1f5f9;
}

[data-theme="dark"] .bv-toast-close,
body.dark-mode .bv-toast-close {
    color: #64748b;
}

[data-theme="dark"] .bv-toast-close:hover,
body.dark-mode .bv-toast-close:hover {
    color: #94a3b8;
    background: #334155;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .bv-toast {
        transition: none;
        transform: none;
        opacity: 1;
    }
    .bv-toast.bv-toast-hide {
        opacity: 0;
    }
    .bv-toast-progress-bar {
        animation: none;
    }
}
