/* Toast Notification System - Modern replacement for alert() */

/* Toast container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-container.bottom-right {
    top: auto;
    bottom: 20px;
    right: 20px;
}

.toast-container.bottom-left {
    top: auto;
    bottom: 20px;
    left: 20px;
    right: auto;
}

.toast-container.top-left {
    top: 20px;
    left: 20px;
    right: auto;
}

.toast-container.top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
}

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

/* Toast notification */
.toast {
    background: #ffffff !important;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    pointer-events: all;
    animation: slideInRight 0.3s ease-out;
    position: relative;
    overflow: hidden;
    opacity: 1 !important;
    z-index: 10001 !important;
}

.toast-container.top-left .toast,
.toast-container.bottom-left .toast {
    animation: slideInLeft 0.3s ease-out;
}

.toast-container.top-center .toast,
.toast-container.bottom-center .toast {
    animation: slideInDown 0.3s ease-out;
}

/* Toast variants */
.toast.success {
    border-left: 4px solid #4CAF50;
}

.toast.error {
    border-left: 4px solid #f44336;
}

.toast.warning {
    border-left: 4px solid #FF9800;
}

.toast.info {
    border-left: 4px solid #2196F3;
}

/* Toast icon */
.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #4CAF50;
}

.toast.error .toast-icon {
    color: #f44336;
}

.toast.warning .toast-icon {
    color: #FF9800;
}

.toast.info .toast-icon {
    color: #2196F3;
}

/* Toast content */
.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: #333333 !important;
    opacity: 1 !important;
}

.toast-message {
    font-size: 14px;
    color: #666666 !important;
    line-height: 1.4;
    opacity: 1 !important;
}

/* Toast close button */
.toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    transform-origin: left;
}

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

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

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

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

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translate(-50%, -100px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

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

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-400px);
        opacity: 0;
    }
}

@keyframes slideOutUp {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -100px);
        opacity: 0;
    }
}

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

/* Toast dismissing */
.toast.dismissing {
    animation: slideOutRight 0.3s ease-out forwards;
}

.toast-container.top-left .toast.dismissing,
.toast-container.bottom-left .toast.dismissing {
    animation: slideOutLeft 0.3s ease-out forwards;
}

.toast-container.top-center .toast.dismissing,
.toast-container.bottom-center .toast.dismissing {
    animation: slideOutUp 0.3s ease-out forwards;
}

/* Action button in toast */
.toast-action {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 4px;
    color: inherit;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    margin-left: 8px;
}

.toast-action:hover {
    background: currentColor;
    color: white;
}

.toast.success .toast-action {
    color: #4CAF50;
}

.toast.error .toast-action {
    color: #f44336;
}

.toast.warning .toast-action {
    color: #FF9800;
}

.toast.info .toast-action {
    color: #2196F3;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast-container.bottom-right,
    .toast-container.bottom-left,
    .toast-container.bottom-center {
        bottom: 10px;
    }
    
    .toast-container.top-center,
    .toast-container.bottom-center {
        transform: none;
        left: 10px;
        right: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* Compact toast variant */
.toast.compact {
    padding: 12px 16px;
    min-width: 250px;
}

.toast.compact .toast-icon {
    font-size: 20px;
}

.toast.compact .toast-title {
    font-size: 14px;
}

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

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #2d2d2d;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }
    
    .toast-title {
        color: #e0e0e0;
    }
    
    .toast-message {
        color: #b0b0b0;
    }
    
    .toast-close {
        color: #999;
    }
    
    .toast-close:hover {
        background: #3d3d3d;
        color: #e0e0e0;
    }
}

/* Toast with image/avatar */
.toast-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Toast stacking */
.toast:not(:last-child) {
    margin-bottom: 0;
}
