/* =====================================================================
   Toast Notification Styles
   ===================================================================== */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    pointer-events: none;
}

/* Toast */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary, #ffffff);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    min-width: 300px;
    max-width: 380px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dark .toast {
    background: var(--bg-primary, #1f2937);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

/* Toast hide animation */
.toast.toast-hide {
    opacity: 0;
    transform: translateX(100%);
}

/* Toast Types */
.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-question {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, var(--bg-primary, #ffffff) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.dark .toast-question {
    background: linear-gradient(135deg, var(--bg-primary, #1f2937) 0%, rgba(139, 92, 246, 0.1) 100%);
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
}

.toast-success .toast-icon {
    color: #10b981;
}

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

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-question .toast-icon {
    color: #8b5cf6;
    font-size: 24px;
}

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

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 4px;
}

.dark .toast-title {
    color: var(--text-primary, #f9fafb);
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.4;
    word-break: break-word;
}

.dark .toast-message {
    color: var(--text-secondary, #9ca3af);
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-tertiary, #9ca3af);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.toast-close:hover {
    background-color: var(--bg-secondary, #f3f4f6);
    color: var(--text-primary, #111827);
}

.dark .toast-close:hover {
    background-color: var(--bg-secondary, #374151);
    color: var(--text-primary, #f9fafb);
}

/* Hover effect for clickable toasts */
.toast[style*="cursor: pointer"] {
    transition: transform 0.2s, box-shadow 0.2s;
}

.toast[style*="cursor: pointer"]:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.dark .toast[style*="cursor: pointer"]:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

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

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* Animation variations for multiple toasts */
.toast-container .toast:nth-child(1) {
    animation-delay: 0ms;
}

.toast-container .toast:nth-child(2) {
    animation-delay: 50ms;
}

.toast-container .toast:nth-child(3) {
    animation-delay: 100ms;
}

.toast-container .toast:nth-child(4) {
    animation-delay: 150ms;
}

.toast-container .toast:nth-child(5) {
    animation-delay: 200ms;
}

/* Pulse animation for question toasts */
@keyframes pulse-border {
    0%, 100% {
        border-left-width: 4px;
    }
    50% {
        border-left-width: 6px;
    }
}

.toast-question {
    animation: pulse-border 2s ease-in-out infinite;
}

/* Smooth stacking effect */
.toast-container .toast {
    margin-bottom: 0;
}

.toast-container .toast + .toast {
    margin-top: 10px;
}
