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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #30363d;
}

header h1 {
    font-size: 2rem;
    color: #58a6ff;
    margin-bottom: 8px;
}

.subtitle {
    color: #8b949e;
    font-size: 1.1rem;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (max-width: 1024px) {
    .main-content {
        gap: 20px;
    }
}

.simulation-panel, .results-panel {
    background: #161b22;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #30363d;
}

.simulation-panel h2, .results-panel h2 {
    color: #58a6ff;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.simulation-layout {
    display: flex;
    gap: 20px;
}

.simulation-controls {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.simulation-visuals {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (max-width: 900px) {
    .simulation-layout {
        flex-direction: column;
    }

    .simulation-controls {
        flex: none;
    }
}

.simulation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.run-info {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
}

#timer {
    color: #f0883e;
    font-weight: bold;
}

.hidden {
    display: none;
}

.canvas-container {
    background: #0d1117;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
}

#sim-canvas {
    border-radius: 4px;
    max-width: 100%;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

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

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

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

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 0.85rem;
    color: #8b949e;
}

.control-group input {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 8px 12px;
    color: #c9d1d9;
    font-size: 1rem;
}

.control-group input:focus {
    outline: none;
    border-color: #58a6ff;
}

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

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

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

.btn-primary {
    background: #1f6feb;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #388bfd;
}

.btn-success {
    background: #238636;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #2ea043;
}

.btn-secondary {
    background: #6e7681;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #8b949e;
}

.btn-warning {
    background: #9e6a03;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #bb8009;
}

.status {
    padding: 12px 15px;
    background: #0d1117;
    border-radius: 6px;
    border-left: 4px solid #58a6ff;
    font-size: 0.95rem;
}

.stats-table {
    margin-bottom: 20px;
}

.stats-table h3 {
    color: #58a6ff;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.stats-table th, .stats-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #30363d;
}

.stats-table th {
    background: #0d1117;
    color: #8b949e;
    font-weight: 500;
}

.stats-table tr:hover {
    background: rgba(88, 166, 255, 0.05);
}

.charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.chart-container {
    background: #0d1117;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.chart-container canvas {
    max-width: 100%;
}

.interpretation {
    margin-top: 20px;
    padding: 15px;
    background: #0d1117;
    border-radius: 8px;
}

.interpretation h3 {
    color: #58a6ff;
    margin-bottom: 10px;
}

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

.interpretation li {
    padding: 8px 0;
    border-bottom: 1px solid #30363d;
}

.interpretation li:last-child {
    border-bottom: none;
}

.interpretation .positive {
    color: #3fb950;
    margin-top: 10px;
    font-weight: 500;
}

.interpretation .neutral {
    color: #8b949e;
    margin-top: 10px;
}

.interpretation .seed-info {
    color: #8b949e;
    margin-top: 10px;
    font-size: 0.9rem;
}
