/* ======================
   AI Components Base
   ====================== */

/* Panel Base Styles */
.ai-panel {
    background: var(--bs-light);
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.ai-panel:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.ai-panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--bs-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-panel-body {
    padding: 1.5rem;
}

.ai-panel-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--bs-gray-200);
}

/* Status Indicators */
.ai-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.ai-status-active {
    background-color: var(--bs-success-bg-subtle);
    color: var(--bs-success);
}

.ai-status-inactive {
    background-color: var(--bs-danger-bg-subtle);
    color: var(--bs-danger);
}

.ai-status-warning {
    background-color: var(--bs-warning-bg-subtle);
    color: var(--bs-warning);
}

/* Analysis Components */
.ai-analysis-card {
    border: 1px solid var(--bs-gray-200);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.ai-analysis-header {
    border-bottom: 1px solid var(--bs-gray-200);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.ai-analysis-content {
    margin-bottom: 1rem;
}

.ai-analysis-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-gray-200);
}

/* Monitoring Dashboard */
.ai-monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ai-monitor-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.ai-monitor-metric {
    font-size: 2rem;
    font-weight: 600;
    margin: 1rem 0;
}

/* Provider Status */
.ai-provider-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-provider-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid var(--bs-gray-200);
}

.ai-provider-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: var(--bs-gray-100);
}

.ai-provider-info {
    flex-grow: 1;
}

/* Alert System */
.ai-alert {
    border-left: 4px solid transparent;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
    border-radius: 0 0.5rem 0.5rem 0;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.ai-alert-info {
    border-left-color: var(--bs-info);
}

.ai-alert-warning {
    border-left-color: var(--bs-warning);
}

.ai-alert-danger {
    border-left-color: var(--bs-danger);
}

/* Progress & Loading */
.ai-progress {
    height: 0.5rem;
    border-radius: 1rem;
    background: var(--bs-gray-200);
    overflow: hidden;
}

.ai-progress-bar {
    height: 100%;
    background: var(--bs-primary);
    transition: width 0.3s ease;
}

.ai-loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--bs-gray-200);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: ai-spin 1s linear infinite;
}

/* Stats & Charts Container */
.ai-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.ai-stat-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: 0.5rem;
    text-align: center;
}

.ai-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--bs-primary);
}

.ai-stat-label {
    font-size: 0.875rem;
    color: var(--bs-gray-600);
}

/* Form Elements */
.ai-form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out;
}

.ai-form-control:focus {
    border-color: var(--bs-primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Animations */
@keyframes ai-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .ai-monitor-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ai-panel-header {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .ai-stats-container {
        grid-template-columns: 1fr;
    }
    
    .ai-provider-item {
        flex-direction: column;
        text-align: center;
    }
    
    .ai-provider-icon {
        margin: 0 0 1rem 0;
    }
}

/* AI Analysis Panel */
.ai-analysis-panel {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ai-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
}

.ai-status-badge.active {
    background: #e8f5e9;
    color: #2e7d32;
}

/* AI Provider Status */
.ai-provider-status {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}