/**
 * Monitor Dashboard-Modus Styles
 * Echtzeit-Überblick mit Ampel-Kacheln
 */

/* Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: var(--space-lg);
    padding: var(--space-lg);
    min-height: calc(100vh - 200px);
}

/* Sidebar */
.dashboard-sidebar section {
    margin-bottom: var(--space-lg);
}

.dashboard-sidebar h2,
.dashboard-sidebar h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-ink-light);
    margin-bottom: var(--space-sm);
}

/* System Info */
.info-card {
    padding: var(--space-md);
    background: var(--color-paper-dark);
    border-radius: 6px;
}

.system-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.system-location {
    font-size: 0.85rem;
    color: var(--color-ink-light);
    margin-bottom: var(--space-sm);
}

.system-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse-status 2s infinite;
}

.status-indicator.normal { background: #22C55E; }
.status-indicator.warning { background: #F59E0B; }
.status-indicator.critical { background: #EF4444; }

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Refresh Controls */
.refresh-options {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.refresh-btn {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--color-archetype-scope);
    border-radius: 4px;
    background: var(--color-archetype-scope);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
}

.refresh-btn:hover {
    filter: brightness(1.1);
}

.refresh-select {
    flex: 1;
    padding: var(--space-xs);
    border: 1px solid var(--color-ink-lighter);
    border-radius: 4px;
    font-size: 0.85rem;
}

.last-update {
    font-size: 0.75rem;
    color: var(--color-ink-light);
}

/* Alerts Section */
.alert-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #EF4444;
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.alerts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm);
    margin-bottom: var(--space-xs);
    background: white;
    border-radius: 4px;
    border-left: 3px solid;
    font-size: 0.8rem;
}

.alert-item.warning { border-color: #F59E0B; }
.alert-item.critical { border-color: #EF4444; }
.alert-item.acknowledged { opacity: 0.6; }

.alert-icon {
    font-size: 1rem;
}

.alert-content {
    flex: 1;
}

.alert-message {
    font-weight: 500;
    margin-bottom: 2px;
}

.alert-time {
    font-size: 0.7rem;
    color: var(--color-ink-light);
}

/* System Stats */
.system-stats dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xs);
}

.system-stats dt {
    font-size: 0.75rem;
    color: var(--color-ink-light);
}

.system-stats dd {
    font-weight: 600;
    margin: 0;
}

/* Main Content */
.dashboard-content {
    background: white;
    border-radius: 8px;
    padding: var(--space-lg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.dashboard-header h1 {
    font-family: var(--font-serif);
    margin: 0;
}

.view-toggle {
    display: flex;
    gap: 2px;
}

.view-btn {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--color-ink-lighter);
    background: white;
    font-size: 0.85rem;
    cursor: pointer;
}

.view-btn:first-child { border-radius: 4px 0 0 4px; }
.view-btn:last-child { border-radius: 0 4px 4px 0; }

.view-btn.active {
    background: var(--color-archetype-scope);
    border-color: var(--color-archetype-scope);
    color: white;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

/* Metric Tile */
.metric-tile {
    padding: var(--space-lg);
    border-radius: 8px;
    background: var(--color-paper);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.metric-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.metric-tile.selected {
    border-color: var(--color-archetype-scope);
}

.metric-tile.normal { border-left: 4px solid #22C55E; }
.metric-tile.warning { border-left: 4px solid #F59E0B; background: #FFFBEB; }
.metric-tile.critical { border-left: 4px solid #EF4444; background: #FEF2F2; }

.metric-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.metric-label {
    font-size: 0.85rem;
    color: var(--color-ink-light);
    font-weight: 500;
}

.metric-status-icon {
    font-size: 1.2rem;
}

.metric-status-icon.normal::after { content: '✓'; color: #22C55E; }
.metric-status-icon.warning::after { content: '⚠'; color: #F59E0B; }
.metric-status-icon.critical::after { content: '✕'; color: #EF4444; }

.metric-value-container {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.metric-unit {
    font-size: 0.9rem;
    color: var(--color-ink-light);
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--color-ink-light);
}

.trend-arrow {
    font-size: 1rem;
}

.trend-arrow.rising { color: #EF4444; }
.trend-arrow.falling { color: #22C55E; }
.trend-arrow.stable { color: var(--color-ink-light); }

/* Sparkline in tile */
.metric-sparkline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    opacity: 0.3;
}

/* Context Panel */
.dashboard-context section {
    margin-bottom: var(--space-lg);
}

.dashboard-context h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-ink-light);
    margin-bottom: var(--space-sm);
}

.context-prompt {
    padding: var(--space-md);
    background: var(--color-paper-dark);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--color-ink-light);
    font-style: italic;
}

.context-info.hidden {
    display: none;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.detail-label {
    font-weight: 600;
    font-size: 1rem;
}

.detail-status {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: white;
}

.detail-status.normal { background: #22C55E; }
.detail-status.warning { background: #F59E0B; }
.detail-status.critical { background: #EF4444; }

.metric-value-display {
    text-align: center;
    margin-bottom: var(--space-md);
}

.detail-value {
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.detail-unit {
    font-size: 1.2rem;
    color: var(--color-ink-light);
}

.metric-trend {
    text-align: center;
    margin-bottom: var(--space-md);
}

.trend-indicator {
    font-size: 1.5rem;
}

/* Thresholds */
.thresholds-section h4,
.mini-chart h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-ink-light);
    margin-bottom: var(--space-sm);
}

.threshold-bar {
    height: 20px;
    background: linear-gradient(to right,
        #EF4444 0%, #EF4444 10%,
        #F59E0B 10%, #F59E0B 20%,
        #22C55E 20%, #22C55E 80%,
        #F59E0B 80%, #F59E0B 90%,
        #EF4444 90%, #EF4444 100%
    );
    border-radius: 4px;
    position: relative;
    margin-bottom: var(--space-sm);
}

.threshold-marker {
    position: absolute;
    top: -5px;
    bottom: -5px;
    width: 3px;
    background: var(--color-ink);
    border-radius: 2px;
}

.threshold-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xs);
    font-size: 0.75rem;
}

.threshold-values dt {
    color: var(--color-ink-light);
}

.threshold-values dd {
    font-family: var(--font-mono);
    margin: 0;
}

/* Mini Chart */
.mini-chart-container {
    height: 60px;
    background: var(--color-paper-dark);
    border-radius: 4px;
    padding: var(--space-xs);
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar,
    .dashboard-context {
        display: none;
    }
}
