/* Universal Toast Notification System */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
    max-width: 400px;
}

.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-content i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-content span {
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* Toast Types */
.toast-success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.toast-success .toast-content i {
    color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.toast-error .toast-content i {
    color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.toast-warning .toast-content i {
    color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.toast-info .toast-content i {
    color: #3b82f6;
}

/* Toast Positions */
.toast-top-right {
    top: 20px;
    right: 20px;
    left: auto;
    bottom: auto;
}

.toast-top-left {
    top: 20px;
    left: 20px;
    right: auto;
    bottom: auto;
}

.toast-bottom-right {
    bottom: 20px;
    right: 20px;
    top: auto;
    left: auto;
}

.toast-bottom-left {
    bottom: 20px;
    left: 20px;
    top: auto;
    right: auto;
}

.toast-top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    bottom: auto;
}

.toast-bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    right: auto;
}

/* Toast with progress bar */
.toast-with-progress {
    position: relative;
    overflow: hidden;
}

.toast-with-progress::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    animation: toast-progress 5s linear forwards;
}

@keyframes toast-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Toast with action button */
.toast-with-action {
    padding-right: 16px;
}

.toast-action {
    background: none;
    border: 1px solid currentColor;
    color: inherit;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-action:hover {
    background: currentColor;
    color: white;
}

/* Toast stacking */
.toast-container {
    pointer-events: none;
}

.toast {
    pointer-events: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
        padding: 14px 16px;
    }
    
    .toast-content span {
        font-size: 0.875rem;
    }
    
    .toast-top-center,
    .toast-bottom-center {
        left: 10px;
        right: 10px;
        transform: none;
    }
}

@media (max-width: 480px) {
    .toast-container {
        top: 5px;
        right: 5px;
        left: 5px;
    }
    
    .toast {
        padding: 12px 14px;
        border-radius: 6px;
    }
    
    .toast-content {
        gap: 8px;
    }
    
    .toast-content i {
        font-size: 1rem;
    }
    
    .toast-content span {
        font-size: 0.8rem;
    }
    
    .toast-close {
        width: 20px;
        height: 20px;
        font-size: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1f2937;
        color: #f9fafb;
        border-color: #4b5563;
    }
    
    .toast-content span {
        color: #f9fafb;
    }
    
    .toast-close {
        color: #9ca3af;
    }
    
    .toast-close:hover {
        background: #374151;
        color: #d1d5db;
    }
    
    .toast-success {
        background: linear-gradient(135deg, #1f2937 0%, #064e3b 100%);
    }
    
    .toast-error {
        background: linear-gradient(135deg, #1f2937 0%, #7f1d1d 100%);
    }
    
    .toast-warning {
        background: linear-gradient(135deg, #1f2937 0%, #78350f 100%);
    }
    
    .toast-info {
        background: linear-gradient(135deg, #1f2937 0%, #1e3a8a 100%);
    }
}

/* Animation variations */
.toast-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.toast-slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

.toast-slide-in-top {
    animation: slideInTop 0.3s ease-out;
}

.toast-slide-in-bottom {
    animation: slideInBottom 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
} 