/* TOAST STYLES - KUNDUZGI VA KECHKI REJIM UCHUN
   Bu CSS ni light-style.css va dark-style.css dan keyin yuklang */

/* ============ TOAST ASOSIY STILLARI ============ */
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    min-width: 300px;
}

.toast-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: calc(var(--border-radius) - 1px) calc(var(--border-radius) - 1px) 0 0;
}

.toast-header strong {
    color: var(--text-primary);
    font-weight: 600;
}

.toast-header small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.toast-body {
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 1rem;
    border-radius: 0 0 calc(var(--border-radius) - 1px) calc(var(--border-radius) - 1px);
}

/* Close button */
.toast .btn-close {
    background-color: transparent;
    opacity: 0.6;
    transition: var(--transition-fast);
    width: 10px;
    height: 10px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Kechki rejim uchun close button */
body[data-theme="dark"] .toast .btn-close,
.dark-mode .toast .btn-close {
    filter: invert(1);
}

.toast .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* Toast Icon Styles */
#toastIcon {
    font-size: 1.125rem;
    transition: var(--transition-fast);
}

/* Success Toast */
.toast.toast-success .toast-header {
    background: rgba(16, 185, 129, 0.1);
    border-bottom-color: rgba(16, 185, 129, 0.2);
}

.toast.toast-success #toastIcon {
    color: var(--success);
}

.toast.toast-success .toast-header strong {
    color: var(--success);
}

/* Error Toast */
.toast.toast-error .toast-header {
    background: rgba(239, 68, 68, 0.1);
    border-bottom-color: rgba(239, 68, 68, 0.2);
}

.toast.toast-error #toastIcon {
    color: var(--danger);
}

.toast.toast-error .toast-header strong {
    color: var(--danger);
}

/* Warning Toast */
.toast.toast-warning .toast-header {
    background: rgba(245, 158, 11, 0.1);
    border-bottom-color: rgba(245, 158, 11, 0.2);
}

.toast.toast-warning #toastIcon {
    color: var(--warning);
}

.toast.toast-warning .toast-header strong {
    color: var(--warning);
}

/* Info Toast */
.toast.toast-info .toast-header {
    background: rgba(14, 165, 233, 0.1);
    border-bottom-color: rgba(14, 165, 233, 0.2);
}

.toast.toast-info #toastIcon {
    color: var(--info);
}

.toast.toast-info .toast-header strong {
    color: var(--info);
}

/* Animation Effects */
.toast {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.hide {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Progress bar for auto-hide */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    animation: progress 4s linear;
    transform-origin: left;
}

@keyframes progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Hover effect */
.toast:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.toast:hover::after {
    animation-play-state: paused;
}

/* Mobile responsive */
@media (max-width: 576px) {
    .toast-container {
        left: 0 !important;
        right: 0 !important;
        padding: 0.5rem !important;
    }
    
    .toast {
        width: 100%;
        max-width: calc(100vw - 1rem);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
    }
    
    .toast.hide {
        animation: none;
    }
    
    .toast::after {
        animation: none;
        display: none;
    }
}

/* Multiple toasts stacking */
.toast-container .toast + .toast {
    margin-top: 0.5rem;
}

/* Custom toast positions */
.toast-container.top-start {
    top: 0;
    left: 0;
}

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

.toast-container.bottom-end {
    bottom: 0;
    right: 0;
    top: auto;
}

.toast-container.bottom-start {
    bottom: 0;
    left: 0;
    top: auto;
}

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