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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.pascal-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

main {
    padding: 30px;
}

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

.simulation-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#hydraulicCanvas {
    width: 100%;
    height: 450px;
    border-radius: 10px;
    background: linear-gradient(180deg, #e8f4f8 0%, #d4e9f2 100%);
    display: block;
}

.simulation-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.info-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-item span:first-child {
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

.info-item span:last-child {
    font-size: 1.2em;
    font-weight: 700;
    color: #3498db;
}

.info-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.formula-section {
    margin-bottom: 25px;
}

.formula-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.formula-display {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.formula-main {
    font-size: 1.5em;
    font-weight: 600;
    color: #e74c3c;
    text-align: center;
    margin-bottom: 10px;
}

.formula-sub {
    font-size: 1.1em;
    color: #34495e;
    text-align: center;
    margin-bottom: 5px;
}

.calculations-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.calc-list {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
}

.calc-item:last-child {
    border-bottom: none;
}

.calc-label {
    font-weight: 600;
    color: #2c3e50;
}

.calc-value {
    font-weight: 700;
    color: #3498db;
}

.controls-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.controls-panel h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

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

.control-group {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.control-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

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

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

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
}

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

.control-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
}

.control-button.apply {
    background: #27ae60;
    color: white;
}

.control-button.apply:hover {
    background: #229954;
    transform: translateY(-2px);
}

.control-button.pause {
    background: #f39c12;
    color: white;
}

.control-button.pause:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

.control-button.reset {
    background: #e74c3c;
    color: white;
}

.control-button.reset:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.explanation {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.explanation h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 2em;
}

.explanation h3 {
    color: #34495e;
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.explanation p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

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

.application-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.application-item h4 {
    color: #3498db;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.application-item p {
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.advantages-list, .limitations-list {
    list-style: none;
    padding: 0;
}

.advantages-list li {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
    color: #555;
}

.limitations-list li {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    color: #555;
}

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

    .simulation-info {
        grid-template-columns: 1fr;
    }

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

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

    header .subtitle {
        font-size: 0.9em;
    }

    main {
        padding: 15px;
    }

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

    .control-button {
        width: 100%;
    }
}
