.toast-container {
    position: fixed;
    /* Place toasts just below the app bar, with a small gap */
    top: calc(var(--appbar-height, 64px) + 12px);
    right: 20px;
    /* Ensure toasts appear above app bar, drawers, status bar */
    z-index: 2500;
    max-width: 350px;
    pointer-events: none;
}

.toast-notification {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
    overflow: hidden;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
    border-left: 4px solid;
    max-width: 350px;
    min-width: 300px;
}

.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-hide {
    transform: translateX(400px);
    opacity: 0;
}

.toast-success {
    border-left-color: #28a745;
}

.toast-info {
    border-left-color: #17a2b8;
}

.toast-warning {
    border-left-color: #ffc107;
}

.toast-error {
    border-left-color: #dc3545;
}

.toast-ticket {
    border-left-color: #2c5282;
}

.toast-header {
    display: flex;
    align-items: center;
    padding: 12px 16px 8px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.toast-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.toast-success .toast-icon {
    color: #28a745;
}

.toast-info .toast-icon {
    color: #17a2b8;
}

.toast-warning .toast-icon {
    color: #ffc107;
}

.toast-error .toast-icon {
    color: #dc3545;
}

.toast-ticket .toast-icon {
    color: #2c5282;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.toast-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #666;
}

.toast-body {
    padding: 8px 16px 12px 16px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.toast-action {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.toast-action .toast-link {
    display: inline-block;
    font-size: 12px;
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 999px;
    color: inherit;
    text-decoration: none;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
}

.toast-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2c5282, #4299e1);
    width: 100%;
    transform: scaleX(0);
    transform-origin: left;
    animation: progress-shrink linear forwards;
}

@keyframes progress-shrink {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .toast-notification {
        background: rgba(45, 55, 72, 0.95);
        color: white;
    }
    
    .toast-title {
        color: white;
    }
    
    .toast-body {
        color: #cbd5e0;
    }
    
    .toast-header {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .toast-action {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast-notification {
        max-width: none;
        min-width: auto;
    }
}
