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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    padding: 20px;
}

.chromatography-container {
    max-width: 1600px;
    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: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.05rem;
    opacity: 0.9;
}

main {
    padding: 30px;
}

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

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

.column-panel h3,
.chromatogram-panel h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

canvas {
    width: 100%;
    border-radius: 10px;
    background: #1a1a1a;
    margin-bottom: 15px;
}

#columnCanvas {
    height: 500px;
}

#chromatogramCanvas {
    height: 350px;
}

.column-info,
.peak-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #1e3c72;
}

.info-item,
.peak-item {
    font-size: 0.9rem;
    color: #2c3e50;
}

.info-item span:first-child,
.peak-item span:first-child {
    font-weight: 600;
    color: #1e3c72;
}

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

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

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

.control-group {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
}

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

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1e3c72;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1e3c72;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #2c3e50;
    background: white;
    cursor: pointer;
}

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

.control-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.control-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.control-button.inject:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

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

.control-button.pause:hover:not(:disabled) {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
}

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

.control-button.reset:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.calculated-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.calculated-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

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

.calc-item {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calc-item span:first-child {
    color: #1e3c72;
}

.formulas-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.formulas-section h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

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

.formula-item {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.formula-label {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}

.formula {
    font-family: 'Courier New', monospace;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
}

.explanation {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
}

.explanation h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.explanation h3 {
    color: #34495e;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

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

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

.explanation li {
    color: #555;
    line-height: 1.8;
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
    font-size: 1rem;
}

.explanation li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #1e3c72;
    font-weight: bold;
}

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

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

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

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

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

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

    .subtitle {
        font-size: 0.9rem;
    }

    .column-info,
    .peak-info {
        grid-template-columns: 1fr;
    }

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

    .explanation {
        padding: 20px;
    }

    .explanation h2 {
        font-size: 1.4rem;
    }
}
