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

body { 
    margin: 0; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow: hidden;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding: 0 30px;
    z-index: 1000;
    border-bottom: 3px solid #667eea;
}

.header h1 {
    font-size: 24px;
    color: #667eea;
    margin-right: auto;
    font-weight: 600;
}

.view-switcher {
    display: flex;
    gap: 10px;
    background: #f0f0f0;
    padding: 5px;
    border-radius: 10px;
}

.view-switcher button {
    padding: 10px 25px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.view-switcher button:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.view-switcher button.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.controls-panel {
    position: fixed;
    top: 70px;
    left: 0;
    width: 320px;
    height: calc(100vh - 70px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    padding: 25px;
    overflow-y: auto;
    z-index: 100;
}

.controls-panel::-webkit-scrollbar {
    width: 8px;
}

.controls-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.controls-panel::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.control-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

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

.control-section h3 {
    font-size: 16px;
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 600;
}

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

.input-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.checkbox-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-item label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.error-message {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
}

.roots-panel {
    position: fixed;
    top: 70px;
    right: 0;
    width: 280px;
    max-height: calc(100vh - 70px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: -2px 0 15px rgba(0,0,0,0.1);
    padding: 25px;
    overflow-y: auto;
    z-index: 100;
}

.roots-panel::-webkit-scrollbar {
    width: 8px;
}

.roots-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.roots-panel::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.roots-panel h3 {
    font-size: 16px;
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 600;
}

.root-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #444;
    border-left: 3px solid #667eea;
}

.plot-container {
    position: absolute;
    top: 70px;
    left: 320px;
    right: 280px;
    height: calc(100vh - 70px);
    display: none;
    background: white;
}

.plot-container.active {
    display: flex;
    flex-direction: column;
}

.plot-container h2 {
    text-align: center;
    margin: 15px 0;
    font-size: 18px;
    color: #667eea;
    font-weight: 600;
}

.plot-container canvas {
    flex-grow: 1;
    display: block;
    width: 100%;
    height: auto;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .roots-panel {
        display: none;
    }
    .plot-container {
        right: 0;
    }
}

@media (max-width: 768px) {
    .controls-panel {
        width: 100%;
        height: auto;
        position: relative;
    }
    .plot-container {
        left: 0;
        top: auto;
        position: relative;
        height: 500px;
    }
}