/**
 * TycoSim v0.3 - Toast System
 * Modern notification system for user feedback
 */

/* Toast Container - fixed top-right */
#toast-container {
    position: fixed;
    top: 80px;
    /* unter Navbar */
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 400px;
    pointer-events: none;
    /* Erlaubt Klicks durch Container */
}

/* Individual Toast */
.toast {
    pointer-events: all;
    /* Toast selbst ist klickbar */
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--surface);
    border-radius: var(--radius-1);
    box-shadow: var(--shadow-3);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.toast.removing {
    animation: slideOut 0.3s ease-out forwards;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

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

.toast-message {
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    word-wrap: break-word;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--text);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* Toast Types */
.toast-success {
    background: linear-gradient(135deg,
            rgba(47, 210, 122, 0.1),
            rgba(47, 210, 122, 0.05));
    border-left: 4px solid var(--success);
}

.toast-success .toast-icon svg {
    color: var(--success);
}

.toast-error {
    background: linear-gradient(135deg,
            rgba(255, 77, 79, 0.1),
            rgba(255, 77, 79, 0.05));
    border-left: 4px solid var(--danger);
}

.toast-error .toast-icon svg {
    color: var(--danger);
}

.toast-warning {
    background: linear-gradient(135deg,
            rgba(245, 165, 36, 0.1),
            rgba(245, 165, 36, 0.05));
    border-left: 4px solid var(--warning);
}

.toast-warning .toast-icon svg {
    color: var(--warning);
}

.toast-info {
    background: linear-gradient(135deg,
            rgba(79, 140, 255, 0.1),
            rgba(79, 140, 255, 0.05));
    border-left: 4px solid var(--accent);
}

.toast-info .toast-icon svg {
    color: var(--accent);
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* =============================================================================
   INBOX SYSTEM (Etappe 2)
   ============================================================================= */

/* Inbox Button (in Navbar) */
.toast-inbox-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px 12px;
    font-size: 1.2em;
    transition: color 0.2s ease;
}

.toast-inbox-btn:hover {
    color: var(--accent);
}

/* Inbox Badge (unread count) */
.toast-inbox-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Inbox Panel (Dropdown) */
.toast-inbox-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 400px;
    max-height: 500px;
    background: var(--surface);
    border-radius: var(--radius-1);
    box-shadow: var(--shadow-3);
    border: 1px solid var(--border);
    display: none;
    z-index: 10000;
    overflow: hidden;
    flex-direction: column;
}

.toast-inbox-panel.open {
    display: flex;
}

/* Inbox Header */
.toast-inbox-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.toast-inbox-header h3 {
    margin: 0;
    font-size: var(--font-size-md);
}

/* Inbox List */
.toast-inbox-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Inbox Item */
.toast-inbox-item {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s ease;
}

.toast-inbox-item:hover {
    background: var(--surface-2);
}

.toast-inbox-item:last-child {
    border-bottom: none;
}

.toast-inbox-item.unread {
    background: rgba(79, 140, 255, 0.05);
    border-left: 3px solid var(--accent);
}

/* Inbox Empty State */
.toast-inbox-empty {
    padding: var(--space-6);
    text-align: center;
    color: var(--muted);
    font-size: var(--font-size-sm);
}

/* Responsive */
@media (max-width: 480px) {
    #toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
    }
}