/* AI Knowledge Base - Live Intelligence Dashboard Styles */

/* === GENERAL LIVE COMPONENTS === */
.live-section {
    background: var(--md-default-bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid var(--md-default-fg-color--lightest);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--md-default-fg-color--light);
    font-size: 1.1rem;
}

.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
    padding-bottom: 0.5rem;
}

.live-header h3 {
    margin: 0;
    color: var(--md-primary-fg-color);
}

.refresh-indicator {
    font-size: 0.85rem;
    color: var(--md-default-fg-color--light);
}

/* === STATUS BOARD === */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-card {
    background: var(--md-code-bg-color);
    border-radius: 6px;
    padding: 1rem;
    border-left: 4px solid var(--md-default-fg-color--lightest);
    transition: all 0.3s ease;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.status-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
}

.status-icon {
    font-size: 1.5rem;
    margin-right: 0.8rem;
}

.status-info {
    flex: 1;
}

.provider-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.status-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.status-message {
    font-size: 0.85rem;
    color: var(--md-default-fg-color--light);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.status-updated {
    font-size: 0.75rem;
    color: var(--md-default-fg-color--lighter);
}

.status-summary {
    display: flex;
    justify-content: space-around;
    background: var(--md-code-bg-color);
    border-radius: 6px;
    padding: 1rem;
}

.summary-item {
    text-align: center;
}

.summary-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--md-primary-fg-color);
}

.summary-label {
    font-size: 0.8rem;
    color: var(--md-default-fg-color--light);
}

/* === ACTIVITY FEED === */
.activity-header, .pricing-header, .news-header, .sustainability-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.activity-count, .pricing-status, .news-count, .sustainability-summary {
    font-size: 0.9rem;
    color: var(--md-default-fg-color--light);
}

.activity-feed, .news-feed {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 6px;
}

.activity-item, .news-item {
    display: flex;
    padding: 0.8rem;
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
    transition: background 0.2s ease;
}

.activity-item:hover, .news-item:hover {
    background: var(--md-code-bg-color);
}

.activity-item:last-child, .news-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 1.2rem;
    margin-right: 0.8rem;
    width: 24px;
    text-align: center;
}

.activity-content, .news-content {
    flex: 1;
}

.activity-title, .news-title {
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.activity-title a, .news-title a {
    color: var(--md-default-fg-color);
    text-decoration: none;
}

.activity-title a:hover, .news-title a:hover {
    color: var(--md-primary-fg-color);
    text-decoration: underline;
}

.activity-meta, .news-meta {
    font-size: 0.8rem;
    color: var(--md-default-fg-color--light);
    display: flex;
    gap: 1rem;
}

.activity-provider, .news-source {
    font-weight: 500;
    text-transform: uppercase;
}

/* === PRICING ALERTS === */
.pricing-grid, .sustainability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.pricing-card, .sustainability-card {
    background: var(--md-code-bg-color);
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid var(--md-default-fg-color--lightest);
    transition: all 0.3s ease;
}

.pricing-card.has-changes {
    border-left: 4px solid #FF9800;
    background: rgba(255, 152, 0, 0.05);
}

.pricing-card:hover, .sustainability-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pricing-provider, .sustainability-provider {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--md-primary-fg-color);
}

.pricing-status, .sustainability-commitment {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.pricing-card .pricing-status {
    background: var(--md-default-bg-color);
}

.pricing-card.has-changes .pricing-status {
    background: rgba(255, 152, 0, 0.1);
    color: #F57C00;
}

.pricing-message, .sustainability-details {
    font-size: 0.85rem;
    color: var(--md-default-fg-color--light);
    margin-bottom: 0.5rem;
}

.pricing-updated {
    font-size: 0.75rem;
    color: var(--md-default-fg-color--lighter);
}

/* === ALERTS AND STATUS INDICATORS === */
.alert {
    color: #F57C00;
    font-weight: 500;
}

.stable {
    color: #4CAF50;
    font-weight: 500;
}

.status-operational {
    color: #4CAF50;
}

.status-degraded {
    color: #FF9800;
}

.status-down {
    color: #F44336;
}

.status-unknown {
    color: #9E9E9E;
}

/* === LIVE INDICATORS === */
.live-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    color: #4CAF50;
    margin-left: 0.5rem;
}

.live-indicator::before {
    content: "●";
    margin-right: 0.3rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* === DASHBOARD CONTROLS === */
.dashboard-controls {
    background: var(--md-code-bg-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.refresh-button {
    background: var(--md-primary-fg-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.refresh-button:hover {
    background: var(--md-accent-fg-color);
}

.last-refresh {
    font-size: 0.85rem;
    color: var(--md-default-fg-color--light);
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .status-grid, .pricing-grid, .sustainability-grid {
        grid-template-columns: 1fr;
    }
    
    .status-summary {
        flex-direction: column;
        gap: 1rem;
    }
    
    .dashboard-controls {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .activity-meta, .news-meta {
        flex-direction: column;
        gap: 0.3rem;
    }
}

/* === DARK MODE SUPPORT === */
[data-md-color-scheme="slate"] .live-section {
    background: var(--md-default-bg-color);
    border-color: var(--md-default-fg-color--lightest);
}

[data-md-color-scheme="slate"] .status-card,
[data-md-color-scheme="slate"] .pricing-card,
[data-md-color-scheme="slate"] .sustainability-card {
    background: var(--md-code-bg-color);
    border-color: var(--md-default-fg-color--lightest);
}

[data-md-color-scheme="slate"] .activity-feed,
[data-md-color-scheme="slate"] .news-feed {
    border-color: var(--md-default-fg-color--lightest);
}

/* === ANIMATIONS === */
.widget-slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-card-operational {
    border-left-color: #4CAF50;
}

.status-card-degraded {
    border-left-color: #FF9800;
}

.status-card-down {
    border-left-color: #F44336;
}

.status-card-unknown {
    border-left-color: #9E9E9E;
}