/* ============================================
   BukiPi ZE - Toast Notification System
   Verbesserte Version mit besserer Lesbarkeit
   ============================================ */

/* Toast Container - Fixed Position Top Right */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10100;
    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;
    border-radius: 8px;
    overflow: hidden;
    /* Stärkerer Schatten für bessere Abhebung */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

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

/* ============================================
   Toast Content Box - SOLIDE Farben!
   ============================================ */
.toast .toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    position: relative;
}

/* Toast Icon */
.toast .toast-icon {
    font-size: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast Message */
.toast .toast-message {
    flex: 1;
    line-height: 1.5;
    word-break: break-word;
    font-size: 14px;
    font-weight: 500;
}

/* 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;
}

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

/* ============================================
   Typ-spezifische Farben - SOLIDE, gut lesbar!
   ============================================ */

/* SUCCESS - Grün */
.toast.toast-success .toast-content {
    background: #2e7d32;  /* Solides Grün */
    color: #ffffff;
}

.toast.toast-success .toast-icon {
    color: #ffffff;
}

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

.toast.toast-success .toast-close {
    color: #ffffff;
}

/* ERROR - Rot */
.toast.toast-error .toast-content {
    background: #c62828;  /* Solides Rot */
    color: #ffffff;
}

.toast.toast-error .toast-icon {
    color: #ffffff;
}

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

.toast.toast-error .toast-close {
    color: #ffffff;
}

/* WARNING - Gelb/Orange mit dunklem Text */
.toast.toast-warning .toast-content {
    background: #ff9800;  /* Solides Orange */
    color: #1a1a1a;       /* Dunkler Text für Kontrast */
}

.toast.toast-warning .toast-icon {
    color: #1a1a1a;
}

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

.toast.toast-warning .toast-close {
    color: #1a1a1a;
}

/* INFO - Blau */
.toast.toast-info .toast-content {
    background: #1565c0;  /* Solides Blau */
    color: #ffffff;
}

.toast.toast-info .toast-icon {
    color: #ffffff;
}

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

.toast.toast-info .toast-close {
    color: #ffffff;
}

/* ============================================
   Progress Bar für Auto-Dismiss
   ============================================ */
.toast .toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.3);
}

.toast .toast-progress-bar {
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    width: 100%;
    /* Animation wird per JS gesteuert */
    transition: width linear;
}

.toast.toast-warning .toast-progress-bar {
    background-color: rgba(0, 0, 0, 0.3);
}

/* ============================================
   Hover & Interaction
   ============================================ */

/* Hover pausiert visuell (Animation wird per JS pausiert) */
.toast:hover {
    transform: translateX(0) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

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

/* ============================================
   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%;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.toast .toast-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.toast.toast-warning .toast-close:focus {
    outline-color: rgba(0, 0, 0, 0.3);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.2s ease;
        transform: none !important;
    }
    
    .toast.toast-show {
        transform: none !important;
    }
    
    .toast.toast-hide {
        transform: none !important;
    }
}