/* ============================================
   BukiPi Toast Notification System CSS
   Baut auf bestehenden alert-Klassen auf
   ============================================ */

/* Toast Container - Fixed Position Top Right */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 420px;
}

/* Einzelner Toast */
.toast {
    pointer-events: auto;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 320px;
    max-width: 420px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Toast Animation - Einblenden */
.toast.toast-show {
    opacity: 1;
    transform: translateX(0);
}

/* Toast Animation - Ausblenden */
.toast.toast-hide {
    opacity: 0;
    transform: translateX(400px);
}

/* Alert Box innerhalb Toast */
.toast .alert {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    position: relative;
    border-radius: 4px;
}

/* Toast Icon */
.toast .toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

/* Toast Message */
.toast .toast-message {
    flex: 1;
    line-height: 1.5;
    word-break: break-word;
}

/* Close Button */
.toast .toast-close {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
    margin-left: 8px;
    flex-shrink: 0;
}

.toast .toast-close .material-icons {
    font-size: 20px;
}

/* Close Button Hover - Typ-spezifische Farben */
.toast-success .toast-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.toast-error .toast-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.toast-warning .toast-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.toast-info .toast-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.toast .toast-close:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* Optional: Progress Bar für Auto-Dismiss (erweiterte Version) */
.toast.toast-with-progress::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    animation: toast-progress linear;
}

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .toast {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
}

/* Hover Effect - Toast hebt sich an */
.toast:hover {
    transform: translateX(0) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.toast.toast-hide:hover {
    transform: translateX(400px);
}

/* Stacking - Mehrere Toasts übereinander */
.toast-container .toast:not(:last-child) {
    margin-bottom: 0;
}

/* Animation für gestapelte Toasts */
.toast-container .toast:nth-child(n+4) {
    opacity: 0.7;
    transform: scale(0.95);
}

/* Accessibility: Focus Styles */
.toast .toast-close:focus {
    outline: 2px solid rgba(0, 0, 0, 0.3);
    outline-offset: 2px;
}

.toast-success .toast-close:focus {
    outline-color: rgba(255, 255, 255, 0.5);
}

.toast-error .toast-close:focus {
    outline-color: rgba(255, 255, 255, 0.5);
}