/**
 * Toast Notification Styles
 * Position: Bottom Right
 */

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
    width: 360px;
}

/* Individual Toast */
.toast {
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    overflow: hidden;
    pointer-events: auto;
    transform: translateX(120%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.25, 1.35);
    width: 360px; /* Fixed width for consistency */
}

.toast.show {
    transform: translateX(0);
}

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

/* Toast Content */
.toast-content {
    display: flex;
    align-items: center;
    padding: 16px;
    position: relative;
}

/* Toast Icon */
.toast-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
}

/* Toast Type Styles */
.toast.success {
    border-left: 2px solid #28a745;
}

.toast.success .toast-icon {
    color: #28a745;
}

.toast.error {
    border-left: 2px solid #dc3545;
}

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

.toast.warning {
    border-left: 2px solid #ffc107;
}

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

.toast.info {
    border-left: 2px solid #17a2b8;
}

.toast.info .toast-icon {
    color: #17a2b8;
}

/* Toast Message */
.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #2c3e50;
    word-wrap: break-word;
    white-space: pre-line; /* Preserve line breaks */
    max-height: 300px; /* Limit height for long error lists */
    overflow-y: auto; /* Allow scrolling for very long lists */
}

/* Custom scrollbar for toast messages */
.toast-message::-webkit-scrollbar {
    width: 6px;
}

.toast-message::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.toast-message::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.toast-message::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 16px;
    margin-left: 12px;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.toast-progress::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: currentColor;
    transform: translateX(-100%);
}

.toast.success .toast-progress::before {
    background-color: #28a745;
}

.toast.error .toast-progress::before {
    background-color: #dc3545;
}

.toast.warning .toast-progress::before {
    background-color: #ffc107;
}

.toast.info .toast-progress::before {
    background-color: #17a2b8;
}

/* Animation for auto-dismiss */
.toast.auto-dismiss .toast-progress::before {
    animation: progress var(--toast-duration, 5s) linear forwards;
}

@keyframes progress {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .toast-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
    }
    
    .toast {
        width: 100%;
    }
}

/* Dark mode support (if Octeth implements it in the future) */
@media (prefers-color-scheme: dark) {
    .toast {
        background-color: #2d3748;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
    
    .toast-message {
        color: #e2e8f0;
    }
    
    .toast-close {
        color: #a0aec0;
    }
}