:root {
    --bg-color: #f0f4f8;
    --panel-bg: #ffffff;
    --text-main: #2d3436;
    --accent: #0984e3;
    --secondary: #00cec9;
    --border: #dfe6e9;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    background: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

nav {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #e1f5fe;
    color: var(--accent);
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
}

.tab-btn.active {
    background: var(--accent);
    color: white;
}

.tab-content {
    display: none;
    width: 100%;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.tab-content.active {
    display: flex;
}

h1 {
    margin-top: 0;
    color: var(--accent);
}

.container {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
}

.panel {
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.side-panel {
    flex: 1;
    min-width: 250px;
    max-width: 320px;
}

.main-panel {
    flex: 2;
    min-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.control-group label {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 5px;
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.outputs p {
    font-size: 1.1em;
    margin: 10px 0;
    padding: 10px;
    background: var(--bg-color);
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
}

.outputs span {
    font-weight: bold;
    color: var(--accent);
}

.results-hidden {
    display: none !important;
}

.endpoint-hint {
    color: #ff7675;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 20px;
}

canvas {
    background: linear-gradient(180deg, #e1f5fe 0%, #b3e5fc 100%);
    border-radius: 12px;
    border: 2px solid var(--accent);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 0 10px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    font-size: 0.85em;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.pos {
    background: #ff4d4d;
}

.neg {
    background: #4d79ff;
}

@media (max-width: 1100px) {
    .container {
        flex-direction: column;
        align-items: center;
    }

    .side-panel,
    .main-panel {
        width: 100%;
        max-width: none;
    }
}