/**
 * Toast Service CSS - Modern Compact Toast Styling
 * Left accent bar, rounded corners, two-line layout
 */

/* Base toast overrides — compact, rounded with left accent */
.toast-container .toast {
    --bs-toast-max-width: 300px;
    --bs-toast-border-color: transparent;
    font-size: 0.8rem;
    border-radius: 10px;
    border: none;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Toast Sizes — override max-width for larger toasts */
.toast-container .toast.toast-md {
    --bs-toast-max-width: 380px;
    min-width: 360px;
}
.toast-container .toast.toast-lg {
    --bs-toast-max-width: 460px;
    min-width: 440px;
}

/* Toast Type Styling — left accent bar */
.toast-service-success {
    --bs-toast-bg: #fff;
    border-left: 4px solid #198754 !important;
}

.toast-service-error {
    --bs-toast-bg: #fff;
    border-left: 4px solid #dc3545 !important;
}

.toast-service-warning {
    --bs-toast-bg: #fff;
    border-left: 4px solid #ffc107 !important;
}

.toast-service-info {
    --bs-toast-bg: #fff;
    border-left: 4px solid #0d6efd !important;
}

.toast-service-plain {
    --bs-toast-bg: #fff;
    border-left: 4px solid #6c757d !important;
}

/* Toast Icon Styling — colored circle background */
.toast-service-icon {
    width: 24px;
    height: 24px;
    font-size: 0.85rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Toast Icon Colors — icon in colored circle */
.toast-service-success .toast-service-icon {
    color: #fff;
    background: #198754;
}
.toast-service-error .toast-service-icon {
    color: #fff;
    background: #dc3545;
}
.toast-service-warning .toast-service-icon {
    color: #000;
    background: #ffc107;
}
.toast-service-info .toast-service-icon {
    color: #fff;
    background: #0d6efd;
}
.toast-service-plain .toast-service-icon {
    color: #fff;
    background: #6c757d;
}

/* Close Button — subtle */
.toast-service-close {
    filter: none;
    opacity: 0.35;
    padding: 0.35rem !important;
    font-size: 0.6rem;
}
.toast-service-close:hover {
    opacity: 0.8;
}

/* Toast Container — wide enough for largest toast size */
.toast-container {
    max-width: 480px;
}

/* Toast Animation */
.toast {
    transition: all 0.25s ease-in-out;
}
.toast.showing {
    opacity: 0;
    transform: translateX(100%);
}
.toast.show {
    opacity: 1;
    transform: translateX(0);
}
.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

/* Responsive */
@media (max-width: 576px) {
    .toast-container {
        max-width: calc(100vw - 20px);
        left: 10px !important;
        right: 10px !important;
        transform: none !important;
    }
    .toast-container.position-fixed.top-0.start-50.translate-middle-x,
    .toast-container.position-fixed.bottom-0.start-50.translate-middle-x {
        left: 10px !important;
        right: 10px !important;
        transform: none !important;
        width: calc(100% - 20px);
    }
}

/* Toast Header — compact, no border */
.toast-header {
    padding: 0.4rem 0.6rem 0.1rem;
    border-bottom: none;
    font-size: 0.78rem;
    font-weight: 600;
    background: transparent !important;
}

.toast-header strong {
    font-size: 0.78rem;
    font-weight: 600;
    color: #212529;
}

/* Toast Body — compact, muted description text */
.toast-body {
    padding: 0.25rem 0.6rem 0.45rem;
    word-wrap: break-word;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #6c757d;
}

.toast-body .toast-message {
    line-height: 1.35;
}

/* Toast Stacking — tighter */
.toast-container .toast + .toast {
    margin-top: 0.4rem;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .toast-service-plain {
        --bs-toast-bg: rgba(33, 37, 41, 0.95);
        color: var(--bs-body-color);
    }
    .toast-service-success,
    .toast-service-error,
    .toast-service-warning,
    .toast-service-info {
        --bs-toast-bg: rgba(33, 37, 41, 0.95);
    }
    .toast-header strong {
        color: #e9ecef;
    }
    .toast-body {
        color: #adb5bd;
    }
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 0 0 10px 10px;
    transition: width linear;
}
.toast-service-success .toast-progress { background-color: #198754; }
.toast-service-error .toast-progress { background-color: #dc3545; }
.toast-service-warning .toast-progress { background-color: #ffc107; }
.toast-service-info .toast-progress { background-color: #0d6efd; }

/* Toast Action Buttons */
.toast-actions {
    padding: 0.15rem 0.6rem 0.45rem;
    display: flex;
    gap: 0.35rem;
}
.toast-actions .btn {
    font-size: 0.72rem;
    padding: 0.12rem 0.45rem;
}
