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

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #121826;
    --bg-tertiary: #1a2332;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --accent: #4fc3f7;
    --accent-hover: #29b6f6;
    --border: #2d3748;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

header h1 {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Canvas Sections */
.canvas-section {
    background: var(--bg-secondary);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.canvas-section h2 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

canvas {
    width: 100%;
    height: auto;
    background: var(--bg-tertiary);
    border-radius: 5px;
    border: 1px solid var(--border);
    cursor: crosshair;
}

.canvas-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
}

/* Controls Section */
.controls-section {
    background: var(--bg-secondary);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.controls-section h2 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

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

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--accent-hover);
}

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

.color-preview {
    width: 100%;
    height: 30px;
    margin-top: 10px;
    border-radius: 5px;
    border: 1px solid var(--border);
    transition: background 0.3s;
}

/* Presets Section */
.presets-section {
    background: var(--bg-secondary);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.presets-section h2 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preset-btn {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.preset-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.preset-btn.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

/* Display Section */
.display-section {
    background: var(--bg-secondary);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.display-section h2 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Animation Section */
.animation-section {
    background: var(--bg-secondary);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.animation-section h2 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.animation-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.animate-btn, .reset-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.animate-btn {
    background: var(--success);
    color: white;
}

.animate-btn:hover {
    background: #45a049;
}

.animate-btn.active {
    background: var(--warning);
}

.reset-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.reset-btn:hover {
    background: var(--border);
}

.animation-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.animation-info p {
    margin-bottom: 8px;
}

/* Theory Section */
.theory-section {
    background: var(--bg-secondary);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.theory-section h2 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.theory-content h3 {
    color: var(--accent-hover);
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
}

.theory-content .equation {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid var(--accent);
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    margin: 10px 0;
    text-align: center;
}

.theory-content p {
    color: var(--text-secondary);
    margin: 10px 0;
}

.theory-content ul {
    list-style-position: inside;
    color: var(--text-secondary);
}

.theory-content li {
    margin: 8px 0;
}

.theory-content strong {
    color: var(--text-primary);
}

/* Measurements Section */
.measurements-section {
    background: var(--bg-secondary);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.measurements-section h2 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.measurements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.measurement-item {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 5px;
    border: 1px solid var(--border);
}

.measurement-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.measurement-value {
    display: block;
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .preset-buttons {
        flex-direction: column;
    }

    .preset-btn {
        width: 100%;
    }

    .animation-controls {
        flex-direction: column;
    }

    .measurements-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.animate-btn.active {
    animation: pulse 1.5s infinite;
}
