/* AJAX Components - Loading Overlay and Toast Notifications */
/* Using standard CSS properties for styling */

/* Loading Overlay Styles */
.ajax-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.3s;
}

.ajax-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Loading Spinner */
.ajax-spinner {
    display: inline-block;
    width: 4rem;
    height: 4rem;
    border: 4px solid #fff;
    border-top-color: transparent;
    border-radius: 9999px;
    animation: spin 1s linear infinite;
}

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

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
}

.btn-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: inherit;
}

.btn-loading .btn-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 9999px;
    margin-left: 0.5rem;
    animation: spin 0.6s linear infinite;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

/* Toast Base Styles */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1.5px 4px rgba(0,0,0,0.04);
    transform: translateX(0);
    transition: all 0.3s ease-in-out;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
    position: relative;
}

.toast.removing {
    animation: slideOutRight 0.3s ease-in;
}

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

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

/* Toast Variants */
.toast-success {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.toast-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.toast-warning {
    background: #fefce8;
    border: 1px solid #fef08a;
    color: #92400e;
}

.toast-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
}

.toast-success .toast-icon {
    color: #22c55e;
}

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

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

.toast-info .toast-icon {
    color: #3b82f6;
}

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

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.875rem;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

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

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 0.25rem;
    background-color: currentColor;
    opacity: 0.3;
    border-bottom-left-radius: 0.5rem;
    animation: progress linear;
}

.toast-success .toast-progress {
    background-color: #22c55e;
}

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

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

.toast-info .toast-progress {
    background-color: #3b82f6;
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}
