/**
 * Modern Toast Notifications for Walkie-Talkie
 * نوتیفیکیشن‌های Toast مدرن برای واکی‌تاکی
 * 
 * @package Timika
 * @version 1.0.0
 */

/* ========== Toast Container ========== */
.timika-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999999; /* بالاتر از modal واکی‌تاکی (999999) */
    pointer-events: none;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========== Toast Item ========== */
.timika-toast {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
    max-width: 400px;
    pointer-events: all;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.3s ease;
}

.timika-toast:hover {
    transform: translateX(-5px) scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(0, 0, 0, 0.08);
}

.timika-toast.removing {
    animation: toastSlideOut 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========== Toast Animations ========== */
@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    60% {
        transform: translateX(-10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(150%) scale(0.7);
    }
}

/* ========== Toast Icon ========== */
.timika-toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    position: relative;
}

.timika-toast-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    opacity: 0.15;
    background: currentColor;
}

.timika-toast-icon i {
    position: relative;
    z-index: 1;
    animation: toastIconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}

@keyframes toastIconPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

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

.timika-toast-title {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 4px 0;
    font-family: 'Vazirmatn', sans-serif;
}

.timika-toast-message {
    font-size: 13px;
    color: #546e7a;
    margin: 0;
    line-height: 1.4;
    font-family: 'Vazirmatn', sans-serif;
}

/* ========== Toast Close Button ========== */
.timika-toast-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.timika-toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg) scale(1.1);
}

.timika-toast-close i {
    font-size: 12px;
    color: #546e7a;
}

/* ========== Progress Bar ========== */
.timika-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    border-radius: 0 0 0 16px;
    animation: toastProgress linear;
}

@keyframes toastProgress {
    0% { width: 100%; }
    100% { width: 0%; }
}

/* ========== Toast Types ========== */
/* Success */
.timika-toast.success {
    border-right: 4px solid #4CAF50;
}

.timika-toast.success .timika-toast-icon {
    color: #4CAF50;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(76, 175, 80, 0.05) 100%);
}

.timika-toast.success .timika-toast-progress {
    background: #4CAF50;
}

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

.timika-toast.error .timika-toast-icon {
    color: #f44336;
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1) 0%, rgba(244, 67, 54, 0.05) 100%);
}

.timika-toast.error .timika-toast-progress {
    background: #f44336;
}

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

.timika-toast.warning .timika-toast-icon {
    color: #FF9800;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1) 0%, rgba(255, 152, 0, 0.05) 100%);
}

.timika-toast.warning .timika-toast-progress {
    background: #FF9800;
}

/* Info */
.timika-toast.info {
    border-right: 4px solid #2196F3;
}

.timika-toast.info .timika-toast-icon {
    color: #2196F3;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1) 0%, rgba(33, 150, 243, 0.05) 100%);
}

.timika-toast.info .timika-toast-progress {
    background: #2196F3;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .timika-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .timika-toast {
        min-width: auto;
        max-width: none;
        padding: 14px 16px;
    }
    
    .timika-toast-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .timika-toast-title {
        font-size: 13px;
    }
    
    .timika-toast-message {
        font-size: 12px;
    }
}

/* ========== Dark Mode Support ========== */
@media (prefers-color-scheme: dark) {
    .timika-toast {
        background: rgba(30, 30, 30, 0.98);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
                    0 0 0 1px rgba(255, 255, 255, 0.05);
    }
    
    .timika-toast-title {
        color: #eceff1;
    }
    
    .timika-toast-message {
        color: #b0bec5;
    }
    
    .timika-toast-close {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .timika-toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .timika-toast-close i {
        color: #b0bec5;
    }
}
