/**
 * DEMANDU Toast Notification Styles
 * 
 * Einheitliches Styling für das Toast-System.
 * Verwendet CSS-Variablen aus variables.css
 */

/* ============================================
   CONTAINER
   ============================================ */

.toast-container {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Position: Oben Mittig */
.toast-container--top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

/* ============================================
   TOAST BASE
   ============================================ */

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    min-width: 320px;
    max-width: 480px;
    background: var(--white, #ffffff);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.12);
    border-left: 4px solid var(--gray-400, #9ca3af);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    
    /* Animation */
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: 
        opacity 0.3s ease,
        transform 0.3s ease;
}

.toast--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast--hiding {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
}

/* ============================================
   TOAST TYPES
   ============================================ */

/* Success */
.toast--success {
    border-left-color: var(--success-400, #4ade80);
    background: linear-gradient(135deg, var(--white) 0%, var(--success-50, #f0fdf4) 100%);
}

.toast--success .toast__icon {
    color: var(--success-500, #22c55e);
    background: var(--success-100, #dcfce7);
}

/* Info */
.toast--info {
    border-left-color: var(--blue-400, #60a5fa);
    background: linear-gradient(135deg, var(--white) 0%, var(--blue-50, #eff6ff) 100%);
}

.toast--info .toast__icon {
    color: var(--blue-500, #3b82f6);
    background: var(--blue-100, #dbeafe);
}

/* Warning */
.toast--warning {
    border-left-color: var(--warning-400, #fbbf24);
    background: linear-gradient(135deg, var(--white) 0%, var(--warning-50, #fffbeb) 100%);
}

.toast--warning .toast__icon {
    color: var(--warning-600, #d97706);
    background: var(--warning-100, #fef3c7);
}

/* Error */
.toast--error {
    border-left-color: var(--danger-400, #f87171);
    background: linear-gradient(135deg, var(--white) 0%, var(--danger-50, #fef2f2) 100%);
}

.toast--error .toast__icon {
    color: var(--danger-500, #ef4444);
    background: var(--danger-100, #fee2e2);
}

/* ============================================
   TOAST ICON
   ============================================ */

.toast__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.125rem;
}

/* ============================================
   TOAST CONTENT
   ============================================ */

.toast__content {
    flex: 1;
    min-width: 0;
}

.toast__message {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-800, #1f2937);
    line-height: 1.4;
    word-wrap: break-word;
}

/* Details Toggle */
.toast__details-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 0;
    background: none;
    border: none;
    font-size: 0.8125rem;
    color: var(--gray-500, #6b7280);
    cursor: pointer;
    transition: color 0.2s;
}

.toast__details-toggle:hover {
    color: var(--gray-700, #374151);
}

.toast__details-toggle i {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

/* Details Content */
.toast__details {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--gray-50, #f9fafb);
    border-radius: var(--radius-md, 8px);
    font-size: 0.8125rem;
    color: var(--gray-600, #4b5563);
    line-height: 1.5;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   CLOSE BUTTON
   ============================================ */

.toast__close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--gray-400, #9ca3af);
    cursor: pointer;
    transition: 
        background 0.2s,
        color 0.2s;
}

.toast__close:hover {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-600, #4b5563);
}

.toast__close:active {
    background: var(--gray-200, #e5e7eb);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    transform-origin: left;
}

.toast--success .toast__progress {
    background: var(--success-400, #4ade80);
}

.toast--info .toast__progress {
    background: var(--blue-400, #60a5fa);
}

.toast--warning .toast__progress {
    background: var(--warning-400, #fbbf24);
}

.toast--error .toast__progress {
    background: var(--danger-400, #f87171);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 576px) {
    .toast-container {
        padding: 12px;
        left: 0;
        right: 0;
        transform: none;
    }
    
    .toast-container--top-center {
        align-items: stretch;
    }
    
    .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.1s;
        transform: none !important;
    }
    
    .toast__progress {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .toast {
        border: 2px solid currentColor;
        box-shadow: none;
    }
}
