/**
 * Toast Component Styles
 *
 * Wiederverwendbare Toast-Benachrichtigungen
 *
 * Klassen:
 * - .toast - Toast-Container
 * - .toast.show - Sichtbarer Toast
 * - .toast.success - Erfolgsmeldung (--success-color)
 * - .toast.warning - Warnung (--warning-color)
 * - .toast.error - Fehlermeldung (--error-color)
 * - .toast.info - Information (--primary-color)
 */

/* Container Positions */
.toast-container {
    position: fixed;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 420px;
    width: 100%;
    padding: 16px;
}

.toast-container--top-right {
    top: 0;
    right: 0;
}

.toast-container--top-left {
    top: 0;
    left: 0;
}

.toast-container--top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.toast-container--bottom-right {
    bottom: 0;
    right: 0;
}

.toast-container--bottom-left {
    bottom: 0;
    left: 0;
}

.toast-container--bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Base Toast - innerhalb des toast-container */
.toast-container .toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background-color: #fff;
    color: #374151;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

/* Transform variations by position */
.toast-container--top-left .toast,
.toast-container--bottom-left .toast {
    transform: translateX(-100%);
}

.toast-container--top-center .toast,
.toast-container--bottom-center .toast {
    transform: translateY(-20px);
}

/* Show state */
.toast-container .toast.show {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

/* Hide state */
.toast-container .toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-container--top-left .toast.hide,
.toast-container--bottom-left .toast.hide {
    transform: translateX(-100%);
}

/* Type variants - bordered style (default) */
.toast-container .toast.success {
    border-left: 4px solid var(--success-color, #7ea820);
}

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

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

.toast-container .toast.info {
    border-left: 4px solid var(--primary-color, #007abb);
}

/* Icon */
.toast-container .toast .toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast-container .toast.success .toast-icon {
    color: var(--success-color, #7ea820);
}

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

.toast-container .toast.warning .toast-icon {
    color: var(--warning-color, #cc7a00);
}

.toast-container .toast.info .toast-icon {
    color: var(--primary-color, #007abb);
}

/* Content */
.toast-container .toast .toast-content {
    flex: 1;
    min-width: 0;
}

.toast-container .toast .toast-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.toast-container .toast .toast-message {
    color: #6b7280;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-line;
}

/* Close button */
.toast-container .toast .toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-container .toast .toast-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

/* Progress bar */
.toast-container .toast .toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background-color: currentColor;
    opacity: 0.3;
}

.toast-container .toast.success .toast-progress {
    background-color: var(--success-color, #7ea820);
}

.toast-container .toast.error .toast-progress {
    background-color: var(--error-color, #c84646);
}

.toast-container .toast.warning .toast-progress {
    background-color: var(--warning-color, #cc7a00);
}

.toast-container .toast.info .toast-progress {
    background-color: var(--primary-color, #007abb);
}

/* Filled style (legacy) */
.toast-container .toast.filled {
    border-left: none !important;
}

.toast-container .toast.filled.success {
    background-color: var(--success-color, #7ea820);
    color: white;
}

.toast-container .toast.filled.error {
    background-color: var(--error-color, #c84646);
    color: white;
}

.toast-container .toast.filled.warning {
    background-color: var(--warning-color, #cc7a00);
    color: white;
}

.toast-container .toast.filled.info {
    background-color: var(--primary-color, #007abb);
    color: white;
}

.toast-container .toast.filled .toast-content {
    flex: 1;
}

.toast-container .toast.filled .toast-title {
    color: white;
}

.toast-container .toast.filled .toast-message {
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: pre-line;
}

.toast-container .toast.filled .toast-message svg {
    flex-shrink: 0;
    vertical-align: -3px;
}

.toast-container .toast.filled .toast-close {
    color: white;
    opacity: 0.8;
}

.toast-container .toast.filled .toast-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    opacity: 1;
}

/* ============================================
   LEGACY TOAST STYLES
   Für alte Implementierungen die #toast Element
   direkt im HTML haben (nicht im .toast-container)
   ============================================ */
#toast.toast,
.toast-container > .toast#toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--success-color, #7ea820);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 10000;
    font-size: 14px;
    border-left: none;
    pointer-events: none;
}

#toast.toast.show,
.toast-container > .toast#toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#toast.toast.error {
    background-color: var(--error-color, #c84646);
}

#toast.toast.warning {
    background-color: var(--warning-color, #cc7a00);
}

#toast.toast.info {
    background-color: var(--primary-color, #007abb);
}
