/* ============================================
   Toast Notifications (Sonner-style)
   Self-contained: uses CSS variable fallbacks so
   this component works on pages that don't load
   main.css (e.g. public booking pages).
   ============================================ */

.toast-container {
    position: fixed;
    bottom: var(--spacing-lg, 1.5rem);
    right: var(--spacing-lg, 1.5rem);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm, 0.5rem);
    pointer-events: none;
    max-width: 400px;
}

/* Override Bootstrap 5's .toast:not(.show) { display: none } which hides
   our custom toasts (we use .toast-show, not Bootstrap's .show class). */
.toast-container .toast {
    display: flex !important;
    align-items: stretch;
    background: var(--color-card-bg, #ffffff);
    border-radius: var(--radius-md, 0.5rem);
    box-shadow: var(--shadow-lg, 0 10px 15px rgba(0, 0, 0, 0.1));
    overflow: hidden;
    pointer-events: auto;
    min-width: 300px;
    max-width: 400px;

    /* Slide animation */
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

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

.toast-container .toast.toast-hiding {
    transform: translateX(120%);
    opacity: 0;
}

/* Toast content */
.toast-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 0.5rem);
    padding: var(--spacing-md, 1rem);
    flex: 1;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--color-text, #232323);
    word-break: break-word;
}

/* Toast close button */
.toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    background: transparent;
    border: none;
    border-left: 1px solid var(--color-border, #e0e0e0);
    color: var(--color-text-light, #33232c);
    font-size: 1.25rem;
    cursor: pointer;
    transition: background-color var(--transition-fast, 0.15s ease), color var(--transition-fast, 0.15s ease);
}

.toast-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--color-text, #232323);
}

/* Toast types - left border accent */
.toast-success {
    border-left: 4px solid var(--color-success, #008139);
}

.toast-success .toast-icon {
    color: var(--color-success, #008139);
}

.toast-error {
    border-left: 4px solid var(--color-error, #d9002b);
}

.toast-error .toast-icon {
    color: var(--color-error, #d9002b);
}

.toast-warning {
    border-left: 4px solid var(--color-warning, #f59e0b);
}

.toast-warning .toast-icon {
    color: #d39e00;
}

.toast-info {
    border-left: 4px solid var(--color-info, #6431da);
}

.toast-info .toast-icon {
    color: var(--color-info, #6431da);
}

/* Mobile responsive */
@media (max-width: 480px) {
    .toast-container {
        left: var(--spacing-sm, 0.5rem);
        right: var(--spacing-sm, 0.5rem);
        bottom: var(--spacing-sm, 0.5rem);
        max-width: none;
    }

    .toast-container .toast {
        min-width: auto;
        max-width: none;
    }
}
