/* =============================================
   Superposição de Ondas — Estilo Sóbrio Acadêmico
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=STIX+Two+Text:ital@0;1&display=swap');

:root {
    --bg: #fafafa;
    --fg: #1a1a1a;
    --border: #cccccc;
    --accent: #1a5276;
    --accent-light: #2980b9;
    --control-bg: #f0f0f0;
    --control-border: #b0b0b0;
    --canvas-bg: #ffffff;
    --tab-active: #1a1a1a;
    --tab-inactive: #888888;
    --slider-track: #cccccc;
    --slider-thumb: #1a1a1a;
    --font-body: 'Inter', sans-serif;
    --font-math: 'STIX Two Text', serif;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
}

/* ---- Header ---- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.app-header h1 {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.3px;
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 0;
}

.tab-btn {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-bottom: none;
    background: transparent;
    color: var(--tab-inactive);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    position: relative;
}

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

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

.tab-btn.active {
    color: var(--tab-active);
    background: var(--canvas-bg);
    border-bottom: 2px solid var(--canvas-bg);
    margin-bottom: -1px;
    z-index: 1;
}

.tab-btn:hover:not(.active) {
    color: var(--fg);
    background: var(--control-bg);
}

/* ---- Main Content ---- */
.main-content {
    display: flex;
    height: calc(100vh - 53px);
    border-top: 1px solid var(--border);
}

/* ---- Canvas Area ---- */
.canvas-area {
    flex: 1;
    position: relative;
    background: var(--canvas-bg);
    overflow: hidden;
}

.canvas-area canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.visualization {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.visualization.active {
    display: block;
}

/* ---- Controls Panel ---- */
.controls-panel {
    width: 280px;
    min-width: 280px;
    border-left: 1px solid var(--border);
    background: var(--bg);
    overflow-y: auto;
    padding: 16px;
    display: none;
}

.controls-panel.active {
    display: block;
}

.control-section {
    margin-bottom: 20px;
}

.control-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--tab-inactive);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.control-group {
    margin-bottom: 14px;
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.control-label span:first-child {
    font-family: var(--font-math);
    font-size: 14px;
    font-style: italic;
}

.control-label .value-display {
    font-size: 12px;
    font-weight: 500;
    color: var(--tab-inactive);
    font-family: var(--font-body);
    min-width: 40px;
    text-align: right;
}

/* ---- Sliders ---- */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--slider-track);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--slider-thumb);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--slider-thumb);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

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

.btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--control-bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s, border-color 0.2s;
}

.btn:hover {
    background: var(--border);
    border-color: var(--tab-inactive);
}

.btn.primary {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.btn.primary:hover {
    background: #333;
}

/* ---- Preset Buttons ---- */
.preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.preset-btn {
    padding: 4px 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--tab-inactive);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}

.preset-btn:hover {
    color: var(--fg);
    border-color: var(--fg);
}

/* ---- Info Text ---- */
.info-text {
    font-size: 11px;
    color: var(--tab-inactive);
    line-height: 1.4;
    margin-top: 8px;
    font-style: italic;
}

/* ---- Scrollbar ---- */
.controls-panel::-webkit-scrollbar {
    width: 4px;
}

.controls-panel::-webkit-scrollbar-track {
    background: transparent;
}

.controls-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}
