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

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

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    position: relative;
}

.github-link {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 12px;
    opacity: 0.8;
}

.github-link a {
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
}

.github-link a:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: translateY(-1px);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.main-content {
    display: flex;
    gap: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.control-panel {
    width: 450px;
    padding: 25px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    max-height: 120vh;
    overflow-y: auto;
}

.visualization-panel {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

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

.section h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1em;
    font-weight: 600;
}

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

.equation-group label {
    display: inline-block;
    width: 60px;
    font-weight: 500;
    color: #495057;
}

.equation-group input[type="text"] {
    width: calc(100% - 70px);
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.equation-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.equation-group textarea {
    width: calc(100% - 70px);
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.3s ease;
}

.equation-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.setting-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-group label {
    font-weight: 500;
    color: #495057;
    min-width: 100px;
}

.setting-group input[type="range"] {
    flex: 1;
    margin: 0 10px;
}

.setting-group input[type="number"] {
    padding: 4px 8px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    width: 70px;
}

.setting-group input[type="color"] {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.setting-group input[type="checkbox"] {
    transform: scale(1.2);
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

.equation-display {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.equation-title {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

#latex-equations {
    font-size: 18px;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.equation-display.hidden {
    display: none;
}

.canvas-container {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

#flow-field-canvas {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: crosshair;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.particle-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 150px;
}

.control-btn {
    padding: 8px 16px;
    font-size: 12px;
    background: #6c757d;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.control-btn:hover {
    background: #5a6268;
}

.control-btn:active {
    transform: translateY(1px);
}

.particle-info {
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    color: #495057;
}

.canvas-info {
    margin-top: 15px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #495057;
    min-height: 20px;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100%;
        max-height: none;
    }
    
    #flow-field-canvas {
        width: 100%;
        max-width: 600px;
        height: auto;
    }
}

/* Scrollbar styling for control panel */
.control-panel::-webkit-scrollbar {
    width: 6px;
}

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

.control-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
