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

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f97316;
    --border-color: #374151;
    --glow-blue: rgba(59, 130, 246, 0.3);
    --glow-cyan: rgba(6, 182, 212, 0.3);
}

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

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

header h1 {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

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

.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

.canvas-container {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#fluidCanvas {
    display: block;
    width: 100%;
    height: 700px;
    cursor: crosshair;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(180deg, rgba(10, 14, 26, 0.95) 0%, transparent 100%);
    pointer-events: none;
}

.stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

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

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
}

.stat-value {
    color: var(--accent-cyan);
    font-weight: 700;
    font-size: 1.1em;
    min-width: 40px;
}

.interaction-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85em;
    background: rgba(31, 41, 55, 0.8);
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-flex;
}

.hint-icon {
    font-size: 1.2em;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 700px;
    overflow-y: auto;
    padding-right: 10px;
}

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

.controls-panel::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.controls-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.controls-panel::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

.control-section {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.control-section h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-section h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    border-radius: 2px;
}

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

.control-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.value-display {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.95em;
    min-width: 50px;
    text-align: right;
}

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

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--glow-blue);
    transition: transform 0.2s, box-shadow 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px var(--glow-cyan);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--glow-blue);
    transition: transform 0.2s, box-shadow 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px var(--glow-cyan);
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.preset-btn {
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px var(--glow-blue);
    transform: translateY(-2px);
}

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

.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-label:hover,
.radio-label:hover {
    background: var(--bg-tertiary);
}

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

.checkbox-label span,
.radio-label span {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.secondary-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.3);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.action-btn {
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-btn.reset {
    background: linear-gradient(135deg, var(--accent-red) 0%, #dc2626 100%);
    color: white;
}

.action-btn.reset:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.action-btn.pause {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #ea580c 100%);
    color: white;
}

.action-btn.pause:hover {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.5);
    transform: translateY(-2px);
}

.action-btn.step {
    background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
    color: white;
}

.action-btn.step:hover {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.info-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.info-content {
    font-size: 0.85em;
    color: var(--text-secondary);
    line-height: 1.7;
}

.info-content p {
    margin-bottom: 12px;
}

.info-content h4 {
    color: var(--text-primary);
    font-size: 1em;
    margin: 15px 0 10px 0;
    font-weight: 600;
}

.info-content ul {
    list-style: none;
    padding-left: 0;
}

.info-content li {
    padding-left: 20px;
    margin-bottom: 8px;
    position: relative;
}

.info-content li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    font-weight: bold;
}

.info-content strong {
    color: var(--accent-blue);
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        max-height: none;
    }

    #fluidCanvas {
        height: 500px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.9em;
    }

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

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .stats {
        font-size: 0.85em;
    }
}
