@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --bg-base: #060913;
    --bg-card: rgba(15, 23, 42, 0.75);
    --border-card: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(59, 130, 246, 0.3);
    
    --primary: #3b82f6;
    --primary-glow: #60a5fa;
    --cyan: #06b6d4;
    --emerald: #10b981;
    --magenta: #ec4899;
    --purple: #8b5cf6;
    --amber: #f59e0b;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.15), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(236, 72, 153, 0.12), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08), transparent 60%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    padding: 2rem;
    overflow-x: hidden;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-card);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.title-container h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(90deg, #ffffff, var(--primary-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.title-container p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--emerald);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: var(--emerald);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--emerald);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
}

.card-hero {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.7));
}

.metric-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: #ffffff;
    font-family: var(--font-mono);
}

.metric-sub {
    font-size: 0.85rem;
    color: var(--cyan);
}

/* Gauge Cards */
.card-gauge {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gauge-title {
    align-self: flex-start;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.progress-ring-container {
    position: relative;
    width: 180px;
    height: 180px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.5s ease-in-out;
    stroke: var(--primary);
}

.gauge-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-percent {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #ffffff;
}

.gauge-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* System Node Cards */
.card-system {
    grid-column: span 4;
}

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.node-title {
    font-size: 1rem;
    font-weight: 700;
}

.node-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.node-status.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald);
}

.node-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--border-card);
    padding-bottom: 0.4rem;
}

.detail-key {
    color: var(--text-muted);
}

.detail-val {
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Log Terminal */
.card-terminal {
    grid-column: span 12;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.terminal-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-window {
    background: #020617;
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #38bdf8;
    height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.log-line {
    white-space: pre-wrap;
    word-break: break-all;
    opacity: 0.9;
}

.log-line.highlight {
    color: var(--emerald);
    font-weight: 700;
}
