/* Enzyme Kinetics Visualization Styles */

* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.enzyme-kinetics-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, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

main {
    padding: 30px;
}

/* Visualization Layout */
.visualization-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
}

.panel-header h3 {
    font-size: 1.3em;
    font-weight: 600;
}

.panel-header p {
    font-size: 0.9em;
    opacity: 0.9;
    margin-top: 5px;
}

.mm-plot-panel,
.lb-plot-panel,
.mechanism-panel,
.coordinate-panel {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

canvas {
    display: block;
    background: white;
    width: 100%;
}

/* Legend */
.mm-legend,
.mechanism-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: white;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.legend-color.normal { background: #3b82f6; }
.legend-color.competitive { background: #ef4444; }
.legend-color.noncompetitive { background: #f59e0b; }
.legend-color.uncompetitive { background: #8b5cf6; }

.molecule {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.molecule.enzyme { background: #3b82f6; }
.molecule.substrate { background: #22c55e; }
.molecule.complex { background: #fbbf24; }
.molecule.product { background: #ef4444; }

/* Info Panels */
.mm-info,
.lb-info,
.coordinate-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: white;
    justify-content: center;
}

.info-item {
    font-size: 0.9em;
    color: #333;
}

.info-item span:first-child {
    font-weight: 600;
    color: #667eea;
}

/* Controls Panel */
.controls-panel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.controls-panel h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

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

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

.control-group h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.control-group label {
    display: block;
    margin-bottom: 12px;
    color: #333;
    font-size: 0.95em;
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e0e7ff;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 5px;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    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: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group input[type="radio"] {
    margin-right: 8px;
    accent-color: #667eea;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.control-button {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.control-button.start {
    background: #22c55e;
}

.control-button.start:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.control-button.pause {
    background: #f59e0b;
}

.control-button.pause:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.control-button.reset {
    background: #ef4444;
}

.control-button.reset:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.control-button.active {
    background: #8b5cf6;
}

.control-button.active:hover {
    background: #7c3aed;
}

/* Formulas Section */
.formulas-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.formulas-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.formula-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.formula-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.formula-label {
    font-weight: 600;
    color: #667eea;
    min-width: 150px;
    font-size: 0.95em;
}

.formula {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #333;
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
}

/* Explanation Section */
.explanation {
    background: #f8f9fa;
    padding: 30px;
    margin-top: 20px;
    border-radius: 10px 10px 0 0;
}

.explanation h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.explanation h3 {
    color: #764ba2;
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.4em;
}

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

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

.explanation li {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    color: #333;
    line-height: 1.7;
}

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

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

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

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    main {
        padding: 20px;
    }

    .mm-legend,
    .mechanism-legend {
        flex-direction: column;
        align-items: flex-start;
    }

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

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.enzyme-kinetics-container > * {
    animation: fadeIn 0.6s ease-out;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .enzyme-kinetics-container {
        box-shadow: none;
        border-radius: 0;
    }

    .controls-panel {
        display: none;
    }

    canvas {
        page-break-inside: avoid;
    }
}
