/* DriftLock Dashboard Styles */

:root {
    --color-bg: #0f1419;
    --color-bg-panel: #1a1f2e;
    --color-bg-card: #232938;
    --color-text: #e6e8eb;
    --color-text-dim: #8b92a0;
    --color-border: #2d3548;

    --color-none: #10b981;
    --color-minor: #3b82f6;
    --color-moderate: #f59e0b;
    --color-severe: #ef4444;
    --color-critical: #991b1b;

    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-secondary: #4b5563;
    --color-secondary-hover: #374151;
    --color-danger: #dc2626;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--color-bg-panel);
    border-bottom: 2px solid var(--color-border);
    padding: 1.5rem 2rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.subtitle {
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

.panel {
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.panel h2 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: var(--color-text);
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card {
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

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

.metric-label {
    font-size: 0.9rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.metric-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-dim);
    margin-top: 0.5rem;
}

/* Severity Colors */
.severity-none { color: var(--color-none); border-color: var(--color-none); }
.severity-minor { color: var(--color-minor); border-color: var(--color-minor); }
.severity-moderate { color: var(--color-moderate); border-color: var(--color-moderate); }
.severity-severe { color: var(--color-severe); border-color: var(--color-severe); }
.severity-critical { color: var(--color-critical); border-color: var(--color-critical); }

.recommendation {
    background: var(--color-bg-card);
    border-left: 4px solid var(--color-primary);
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    color: var(--color-text-dim);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--color-secondary-hover);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Threshold Grid */
.threshold-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.threshold-item {
    background: var(--color-bg-card);
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    border: 2px solid var(--color-border);
}

.threshold-label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.threshold-label.none { color: var(--color-none); }
.threshold-label.minor { color: var(--color-minor); }
.threshold-label.moderate { color: var(--color-moderate); }
.threshold-label.severe { color: var(--color-severe); }
.threshold-label.critical { color: var(--color-critical); }

.threshold-value {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--color-text);
}

/* Chart Styles */
.chart-controls {
    margin-bottom: 1rem;
    text-align: right;
}

#drift-chart {
    max-height: 300px;
    background: var(--color-bg-card);
    border-radius: 4px;
    padding: 1rem;
}

.history-stats {
    margin-top: 1rem;
    text-align: center;
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

/* Baseline Grid */
.baseline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.baseline-item {
    background: var(--color-bg-card);
    padding: 1rem;
    border-radius: 4px;
    border-left: 3px solid var(--color-primary);
}

.baseline-item strong {
    display: block;
    color: var(--color-text-dim);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.baseline-item span {
    font-size: 1.2rem;
    font-weight: bold;
}

.loading {
    text-align: center;
    color: var(--color-text-dim);
    padding: 2rem;
}

footer {
    background: var(--color-bg-panel);
    border-top: 1px solid var(--color-border);
    padding: 1rem;
    text-align: center;
    color: var(--color-text-dim);
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .status-grid,
    .form-grid,
    .threshold-grid,
    .baseline-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .metric-value {
        font-size: 2rem;
    }
}
