:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success: #22c55e;
    --error: #ef4444;
    --input-bg: #f1f5f9;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

h2 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.main-container {
    flex: 1;
    display: flex;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow: hidden;
}

/* Panels */
.control-panel {
    width: 350px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.graph-panel {
    flex: 1;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Layouts */
.section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 0.5rem;
}

.section:last-child {
    border-bottom: none;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.row {
    display: flex;
    gap: 1rem;
}

.col {
    flex: 1;
}

input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-bg);
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: all 0.2s;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    font-size: 0.9rem;
}

button:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    margin-top: 0.5rem;
}

.btn-outline:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

/* Table */
.table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--input-bg);
    position: sticky;
    top: 0;
    font-weight: 600;
    color: var(--text-secondary);
}

.table-input {
    width: 80px;
    padding: 0.25rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.correct {
    background-color: rgba(34, 197, 94, 0.2);
    border-color: var(--success) !important;
    color: var(--success);
}

.incorrect {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: var(--error) !important;
    color: var(--error);
}

/* Info Display */
#equation-display {
    font-family: 'Courier New', monospace;
    text-align: center;
    font-size: 1.1rem;
    background: var(--input-bg);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-weight: bold;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    display: none;
    z-index: 100;
}

canvas {
    cursor: crosshair;
}

.coordinates-display {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: monospace;
    font-size: 0.9rem;
    pointer-events: none;
}