/* ============================================================
   ETH Animation — Shared Theme
   ============================================================
   Base styles, sidebar layout, controls, buttons, sliders,
   toggles, scrollbar. Shared across all animations.
   ============================================================ */
@import url('tokens.css');

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0a0e1a;
    color: #e0e4f0;
    overflow: hidden;
    height: 100vh;
    user-select: none;
}

/* --- Layout: Sidebar + Canvas --- */
#app {
    display: flex;
    height: 100vh;
}

/* --- Sidebar --- */
#sidebar {
    width: 310px;
    min-width: 310px;
    background: #111827;
    border-right: 1px solid #1e293b;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#sidebar::-webkit-scrollbar { width: 5px; }
#sidebar::-webkit-scrollbar-track { background: #111827; }
#sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* --- Title --- */
.title-block { text-align: center; padding: 6px 0 2px; }
.title-block h1 {
    font-size: 18px;
    font-weight: 700;
    color: #93c5fd;
    letter-spacing: 0.5px;
}
.title-block .subtitle {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 2px;
}

/* --- Sections --- */
.section {
    background: #1e293b;
    border-radius: 8px;
    padding: 10px 12px;
}
.section h3 {
    font-size: 11px;
    font-weight: 700;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #475569;
}

/* --- Function inputs --- */
.field-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.field-row label {
    font-size: 14px;
    font-weight: 700;
    color: #60a5fa;
    min-width: 32px;
    font-family: 'Cambria Math', 'Times New Roman', serif;
}
.field-row input[type="text"] {
    flex: 1;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 5px 8px;
    color: #e2e8f0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.field-row input[type="text"]:focus { border-color: #60a5fa; }
.field-row input[type="text"].error { border-color: #ef4444; }

#error-msg {
    color: #ef4444;
    font-size: 10px;
    min-height: 14px;
    margin-top: 2px;
    font-family: monospace;
}

/* --- Buttons --- */
.btn-row { display: flex; gap: 6px; margin-top: 4px; }

button {
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
button.primary { background: #2563eb; color: white; }
button.primary:hover { background: #3b82f6; }
button.secondary { background: #334155; color: #e2e8f0; }
button.secondary:hover { background: #475569; }
button.success { background: #059669; color: white; }
button.success:hover { background: #10b981; }
button.warning { background: #d97706; color: white; }
button.warning:hover { background: #f59e0b; }

/* --- Select / Dropdown --- */
select {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 5px 8px;
    color: #e2e8f0;
    font-size: 12px;
    cursor: pointer;
    outline: none;
}
select:focus { border-color: #60a5fa; }

/* --- Checkboxes --- */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 0;
}
.toggle-row input[type="checkbox"] {
    accent-color: #60a5fa;
    width: 14px;
    height: 14px;
    cursor: pointer;
}
.toggle-row label {
    font-size: 12px;
    cursor: pointer;
}
.toggle-row .badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: auto;
    font-weight: 600;
}
.badge-div { background: #7c3aed33; color: #a78bfa; }
.badge-rot { background: #2563eb33; color: #60a5fa; }
.badge-mag { background: #059669; color: #34d399; }

/* --- Sliders --- */
.slider-row { margin-bottom: 8px; }
.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 3px;
}
.slider-header .val {
    color: #60a5fa;
    font-weight: 700;
    font-family: 'Consolas', monospace;
    min-width: 36px;
    text-align: right;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #334155;
    border-radius: 2px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #60a5fa;
    cursor: pointer;
    border: 2px solid #1e293b;
}

/* --- Canvas area (shared layout) --- */
#canvas-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #0a0e1a;
}

/* --- Help text --- */
.help-text {
    font-size: 10px;
    color: #64748b;
    line-height: 1.7;
}
.help-text kbd {
    background: #334155;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 9px;
    font-family: monospace;
    color: #94a3b8;
}
