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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

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

header {
    text-align: center;
    padding: 30px 20px;
    background: rgba(10, 10, 26, 0.8);
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

.subtitle {
    font-size: 1.1em;
    color: #a0a0a0;
    font-weight: 300;
}

.visualization-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.venturi-panel,
.analysis-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.venturi-display,
.streamlines-display,
.chart-display,
.equation-display {
    background: rgba(10, 10, 26, 0.9);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.venturi-display h3,
.streamlines-display h3,
.chart-display h3,
.equation-display h3 {
    color: #3b82f6;
    margin-bottom: 15px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.venturi-display h3::before {
    content: "🔧";
}

.streamlines-display h3::before {
    content: "〰️";
}

.chart-display h3::before {
    content: "📊";
}

.equation-display h3::before {
    content: "🧮";
}

canvas {
    width: 100%;
    height: 300px;
    background: #0a0a1a;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.venturi-info,
.streamlines-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.info-item {
    background: rgba(59, 130, 246, 0.1);
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
    font-size: 0.9em;
}

.info-item span:first-child {
    color: #a0a0a0;
    font-weight: 500;
}

.info-item span:last-child {
    color: #10b981;
    font-weight: bold;
    margin-left: 5px;
}

.equation-display {
    background: rgba(10, 10, 26, 0.9);
}

.equation-values {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.equation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(59, 130, 246, 0.05);
    padding: 10px 15px;
    border-radius: 6px;
}

.equation-label {
    color: #a0a0a0;
    font-size: 0.95em;
    font-family: 'Courier New', monospace;
}

.equation-value {
    color: #10b981;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.equation-difference {
    background: rgba(16, 185, 129, 0.1);
    padding: 10px 15px;
    border-radius: 6px;
    text-align: center;
    border-left: 3px solid #10b981;
    margin-top: 5px;
}

.equation-difference span:first-child {
    color: #a0a0a0;
    font-weight: 500;
}

.equation-difference span:last-child {
    color: #10b981;
    font-weight: bold;
    margin-left: 5px;
}

.controls-panel {
    background: rgba(10, 10, 26, 0.9);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.controls-panel h3 {
    color: #3b82f6;
    margin-bottom: 20px;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls-panel h3::before {
    content: "⚙️";
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.control-group {
    background: rgba(26, 26, 46, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.control-group h4 {
    color: #10b981;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 500;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: #b0b0b0;
    font-size: 0.9em;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 3px;
    outline: none;
    margin-bottom: 15px;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #10b981;
    transform: scale(1.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    background: #10b981;
    transform: scale(1.2);
}

.control-group select {
    width: 100%;
    padding: 10px 15px;
    background: rgba(10, 10, 26, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95em;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.control-group select:hover {
    border-color: #3b82f6;
}

.control-group select:focus {
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.checkbox-input {
    width: auto !important;
    margin-right: 10px;
    cursor: pointer;
}

.control-group label:has(.checkbox-input) {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group label:has(.checkbox-input):hover {
    color: #e0e0e0;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
}

.control-button {
    padding: 12px 30px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 120px;
}

.control-button:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.control-button.start:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
}

.control-button.pause:hover {
    background: rgba(245, 158, 11, 0.3);
    border-color: #f59e0b;
}

.control-button.reset:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

.preset-btn {
    padding: 8px 15px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    margin-right: 10px;
    margin-bottom: 10px;
}

.preset-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
    transform: translateY(-1px);
}

.formulas-section {
    background: rgba(26, 26, 46, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.formulas-section h3 {
    color: #3b82f6;
    margin-bottom: 15px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.formulas-section h3::before {
    content: "📐";
}

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

.formula-item {
    background: rgba(10, 10, 26, 0.5);
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 3px solid #10b981;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.formula-label {
    color: #a0a0a0;
    font-size: 0.85em;
    font-weight: 500;
}

.formula {
    color: #10b981;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    font-weight: 500;
}

.chart-legend {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: #a0a0a0;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.explanation {
    background: rgba(10, 10, 26, 0.9);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    line-height: 1.8;
}

.explanation h2 {
    color: #3b82f6;
    margin-bottom: 20px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.explanation h2::before {
    content: "💧";
}

.explanation h3 {
    color: #10b981;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.explanation h3::before {
    content: "🔬";
}

.explanation p {
    color: #b0b0b0;
    margin-bottom: 15px;
    font-size: 1.05em;
    line-height: 1.8;
}

.explanation strong {
    color: #e0e0e0;
    font-weight: 600;
}

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

@media (max-width: 768px) {
    .bernoulli-container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

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

    .formula-list {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .control-button {
        width: 100%;
    }

    canvas {
        height: 250px;
    }
}

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

    .subtitle {
        font-size: 0.9em;
    }

    .explanation {
        padding: 20px;
    }

    .explanation h2 {
        font-size: 1.5em;
    }

    .explanation h3 {
        font-size: 1.2em;
    }
}
