/* ============================================
   TOAST NOTIFICATION STYLES
   ============================================ */

.toast-container {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
    width: 100%;
    padding: 15px;
}

.toast-container.top-right {
    top: 20px;
    right: 20px;
}

.toast-container.top-left {
    top: 20px;
    left: 20px;
}

.toast-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.toast-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: slideIn 0.3s ease forwards;
    position: relative;
    overflow: hidden;
    border-left: 4px solid;
    font-family: inherit;
}

.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-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.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-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    font-family: inherit;
    word-break: break-word;
}

.toast-close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    font-size: 24px;
    line-height: 1;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    outline: none;
}

.toast-close:hover {
    color: #4b5563;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    background: currentColor;
    opacity: 0.3;
    animation: progress 3s linear forwards;
    transform-origin: left;
}

.toast.success .toast-progress-bar {
    background: #10b981;
}

.toast.error .toast-progress-bar {
    background: #ef4444;
}

.toast.warning .toast-progress-bar {
    background: #f59e0b;
}

.toast.info .toast-progress-bar {
    background: #3b82f6;
}

/* RTL Support */
html[dir="rtl"] .toast {
    border-left: none;
    border-right: 4px solid;
}

html[dir="rtl"] .toast.success {
    border-right-color: #10b981;
}

html[dir="rtl"] .toast.error {
    border-right-color: #ef4444;
}

html[dir="rtl"] .toast.warning {
    border-right-color: #f59e0b;
}

html[dir="rtl"] .toast.info {
    border-right-color: #3b82f6;
}

html[dir="rtl"] .toast-progress {
    left: auto;
    right: 0;
}

html[dir="rtl"] .toast-progress-bar {
    animation: progressRTL 3s linear forwards;
    transform-origin: right;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRTL {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideOutRTL {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

@keyframes progressRTL {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

html[dir="rtl"] .toast {
    animation: slideInRTL 0.3s ease forwards;
}

.toast.removing {
    animation: slideOut 0.3s ease forwards;
}

html[dir="rtl"] .toast.removing {
    animation: slideOutRTL 0.3s ease forwards;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .toast-container {
        max-width: calc(100% - 30px);
        padding: 10px;
    }

    .toast-container.top-right,
    .toast-container.top-left {
        top: 10px;
    }

    .toast {
        padding: 12px 16px;
    }

    .toast-content {
        font-size: 13px;
    }

    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }
}

/* Tablet Responsive */
@media (min-width: 481px) and (max-width: 768px) {
    .toast-container {
        max-width: 320px;
    }
}
