/**
 * ui-feedback.css - MeinTango
 * Styles for Loading Overlay and Toast Notifications
 */

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(3px);
}

#loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

#loading-message {
    color: white;
    font-family: 'Noto Serif', serif;
    font-style: italic;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 450px;
    padding: 1.25rem 2.5rem 1.25rem 1.25rem; /* More space on the right for the X */
    border-radius: var(--radius-lg);
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.75rem;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
    position: relative; /* Base for absolute close button */
}

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

.toast-content {
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word; /* Crucial for long technical error messages */
    flex: 1;
}

.toast-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    opacity: 0.4;
    padding: 0.25rem;
    line-height: 1;
    color: inherit;
    transition: opacity 0.2s;
}

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

/* Toast Types */
.toast-success {
    background-color: #dcfce7;
    color: #166534;
    border-left: 5px solid #22c55e;
}

.toast-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 5px solid #ef4444;
}

.toast-info {
    background-color: #f0f9ff;
    color: #0369a1;
    border-left: 5px solid #0ea5e9;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    #toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
        transform: translateY(120%);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}
