/**
 * Error Handler UI Styles
 * Styles for error messages, notifications, and status indicators
 */

/* Global Error Container */
#global-error-container {
    max-width: 500px;
    min-width: 350px;
}

#global-error-container .alert {
    margin-bottom: 0;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#global-error-container .alert-heading {
    font-size: 1rem;
    font-weight: 600;
}

#global-error-container .btn-group-sm .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Notification Container */
#notification-container {
    max-width: 350px;
}

#notification-container .toast {
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#notification-container .toast-header {
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#notification-container .toast-body {
    font-size: 0.875rem;
}

/* API Status Indicator */
.api-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.api-status-indicator .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6c757d;
    animation: pulse 2s infinite;
}

.api-status-indicator.online .status-dot {
    background-color: #28a745;
}

.api-status-indicator.degraded .status-dot {
    background-color: #ffc107;
}

.api-status-indicator.offline .status-dot {
    background-color: #dc3545;
}

.api-status-indicator.rate-limited .status-dot {
    background-color: #fd7e14;
}

/* Status dot pulse animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Error message animations */
.alert {
    animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Toast animations */
.toast {
    animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading states */
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive design */
@media (max-width: 768px) {
    #global-error-container {
        left: 1rem !important;
        right: 1rem !important;
        transform: none !important;
        max-width: none;
        min-width: auto;
    }
    
    #notification-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
    
    .api-status-indicator {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .api-status-indicator {
        background-color: #343a40;
        border-color: #495057;
        color: #f8f9fa;
    }
    
    #global-error-container .alert {
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    }
    
    #notification-container .toast {
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .api-status-indicator {
        border-width: 2px;
    }
    
    .alert {
        border-width: 2px !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .alert,
    .toast {
        animation: none;
    }
    
    .api-status-indicator .status-dot {
        animation: none;
    }
    
    * {
        transition: none !important;
    }
} 