/* =========================================
   1. FONTS IMPORT (CRITICAL FIX)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #05070a;
    --sidebar: #0d1117;
    --accent: #3b82f6; /* Blue */
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.03);
    --text-muted: #64748b;
}

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

body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg); 
    color: white; 
    height: 100vh; 
    overflow: hidden; 
}

/* =========================================
   2. CUSTOM SCROLLBARS (VISUAL FIX)
   ========================================= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* =========================================
   3. LAYOUT
   ========================================= */
.app-wrapper { display: flex; height: 100vh; }

/* Sidebar */
.sidebar { 
    width: 300px; 
    background: var(--sidebar); 
    border-right: 1px solid var(--border); 
    padding: 2rem; 
    display: flex; 
    flex-direction: column; 
    gap: 2.5rem; 
    flex-shrink: 0; /* Prevents sidebar from shrinking */
}

.brand { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-weight: 800; 
    color: var(--accent); 
    font-size: 1.2rem; 
}

/* Meter / Gauge */
.meter-section { 
    padding: 1.5rem; 
    text-align: center; 
    border-radius: 20px; 
    background: rgba(255, 255, 255, 0.02);
}

.meter-label { 
    font-size: 0.6rem; 
    letter-spacing: 2px; 
    color: var(--text-muted); 
    font-weight: 800; 
    display: block; 
    margin-bottom: 1rem; 
    text-transform: uppercase;
}

.gauge-wrapper { position: relative; width: 140px; height: 140px; margin: 0 auto; }

svg { transform: rotate(-90deg); width: 100%; height: 100%; }
circle { fill: none; stroke-width: 8; stroke-linecap: round; }

.gauge-bg { stroke: #1e293b; }
.gauge-fill { 
    stroke: var(--accent); 
    stroke-dasharray: 283; /* Matches JS Calculation (2*PI*45) */
    stroke-dashoffset: 283; 
    transition: stroke-dashoffset 1.0s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s ease;
}

.gauge-value { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    font-size: 1.8rem; 
    font-weight: 800; 
    font-family: 'JetBrains Mono', monospace; 
}

/* Main Content Area */
.content { 
    flex: 1; 
    padding: 3rem; 
    overflow-y: hidden; /* Let the terminal handle scroll */
    display: flex; 
    flex-direction: column; 
    gap: 1.5rem; 
}

.glass { 
    background: var(--glass); 
    border: 1px solid var(--border); 
    backdrop-filter: blur(10px); 
    border-radius: 16px; 
}

/* Input Section */
.input-panel { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

textarea { 
    background: transparent; 
    border: none; 
    color: white; 
    width: 100%; 
    height: 80px; 
    resize: none; 
    outline: none; 
    font-size: 1.1rem; 
    font-family: 'Inter', sans-serif;
}
textarea::placeholder { color: #475569; }

button { 
    align-self: flex-end;
    background: var(--accent); 
    color: white; 
    border: none; 
    padding: 12px 24px; 
    border-radius: 8px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    display: flex;
    align-items: center;
    gap: 8px;
}
button:hover { background: #2563eb; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
button:disabled { background: #1e293b; color: #64748b; cursor: not-allowed; transform: none; box-shadow: none; }

/* Terminal Output */
.terminal-container { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    background: #020405; 
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    min-height: 0; /* Critical for flexbox scrolling */
}

.terminal-header { 
    padding: 10px 20px; 
    background: rgba(255,255,255,0.03); 
    display: flex; 
    justify-content: space-between; 
    font-family: 'JetBrains Mono', monospace; 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    border-bottom: 1px solid var(--border);
}

#outputContent { 
    padding: 2rem; 
    font-family: 'JetBrains Mono', monospace; 
    line-height: 1.6; 
    white-space: pre-wrap; 
    font-size: 0.9rem; 
    overflow-y: auto; 
    color: #e2e8f0; 
    flex: 1;
}

/* Utilities */
.mono { font-family: 'JetBrains Mono', monospace; }

/* Loader Animation */
.loader { 
    border: 2px solid rgba(255,255,255,0.1); 
    border-top: 2px solid white; 
    border-radius: 50%; 
    width: 20px; 
    height: 20px; 
    animation: spin 0.8s linear infinite; 
    display: none; 
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-wrapper { flex-direction: column; height: auto; min-height: 100vh; }
    .sidebar { width: 100%; height: auto; padding: 1.5rem; border-right: none; border-bottom: 1px solid var(--border); }
    .content { padding: 1.5rem; height: auto; }
    body { overflow-y: auto; }
}