/* ========== TOAST NOTIFICATION SYSTEM ========== */

/* Toast Container - positioned relative to viewport */
.toast-container {
    position: fixed;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none; /* Allow clicks through container */
}

/* Container positions */
.toast-top-right {
    top: 20px;
    right: 20px;
}

.toast-top-left {
    top: 20px;
    left: 20px;
}

.toast-bottom-right {
    bottom: 20px;
    right: 20px;
}

.toast-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Toast Card */
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    padding: 14px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    pointer-events: auto; /* Enable clicks on toast */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl; /* RTL support */
}

/* Toast Content */
.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0; /* Allow text to wrap */
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50%;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #2c3e50;
    word-wrap: break-word;
}

/* Toast Action Button */
.toast-action {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.toast-action:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: #95a5a6;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #2c3e50;
}

/* Toast Types - Color Variants */

/* Success Toast */
.toast-success {
    border-right: 4px solid #27ae60;
}

.toast-success .toast-icon {
    background: #d4edda;
    color: #27ae60;
}

.toast-success .toast-action {
    background: #27ae60;
    color: white;
}

.toast-success .toast-action:hover {
    background: #229954;
}

/* Error Toast */
.toast-error {
    border-right: 4px solid #e74c3c;
}

.toast-error .toast-icon {
    background: #f8d7da;
    color: #e74c3c;
}

.toast-error .toast-action {
    background: #e74c3c;
    color: white;
}

.toast-error .toast-action:hover {
    background: #c0392b;
}

/* Warning Toast */
.toast-warning {
    border-right: 4px solid #f39c12;
}

.toast-warning .toast-icon {
    background: #fff3cd;
    color: #f39c12;
}

.toast-warning .toast-action {
    background: #f39c12;
    color: white;
}

.toast-warning .toast-action:hover {
    background: #d68910;
}

/* Info Toast */
.toast-info {
    border-right: 4px solid #3498db;
}

.toast-info .toast-icon {
    background: #d1ecf1;
    color: #3498db;
}

.toast-info .toast-action {
    background: #3498db;
    color: white;
}

.toast-info .toast-action:hover {
    background: #2980b9;
}

/* Animations */

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

.toast:not(.toast-enter):not(.toast-exit) {
    opacity: 1;
    transform: translateX(0);
}

/* Exit animation */
.toast-exit {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
}

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

    /* Override positions for mobile - always top center */
    .toast-top-right,
    .toast-top-left,
    .toast-bottom-right,
    .toast-bottom-left {
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: auto;
    }

    .toast {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }

    .toast-message {
        font-size: 13px;
    }

    .toast-action {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .toast {
        padding: 12px 14px;
        gap: 8px;
    }

    .toast-content {
        gap: 8px;
    }

    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }

    .toast-close {
        width: 20px;
        height: 20px;
        font-size: 18px;
    }
}

/* Accessibility - Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast-enter,
    .toast-exit {
        transition: none;
    }
}
