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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

/* Variant navigation bar */
.variant-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #1f2937;
    border-bottom: 2px solid #374151;
}

.variant-nav a {
    color: #9ca3af;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.variant-nav a:hover {
    color: white;
    background: #374151;
}

.variant-nav a.active {
    color: white;
    background: #3b82f6;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.simulation-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#networkCanvas {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    max-width: 100%;
}

.metrics-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.metric label {
    font-weight: 600;
    color: #555;
}

.metric span {
    font-weight: bold;
    color: #2563eb;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#playPause {
    background: #10b981;
    color: white;
}

#playPause:hover {
    background: #059669;
}

#playPause.paused {
    background: #f59e0b;
}

#reset {
    background: #6b7280;
    color: white;
}

#reset:hover {
    background: #4b5563;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-container label {
    font-weight: 600;
    color: #555;
}

#speed {
    width: 120px;
}

#speedValue {
    font-weight: bold;
    color: #2563eb;
    min-width: 30px;
}

.explanation, .links, .network-parameters {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.network-parameters h2 {
    color: #1f2937;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.parameter-group {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.parameter-group h3 {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.parameter-control {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.parameter-control label {
    min-width: 140px;
    font-weight: 600;
    color: #555;
}

.parameter-control input[type="range"] {
    flex: 1;
    max-width: 200px;
}

.parameter-control input[type="number"] {
    width: 80px;
    padding: 0.25rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

.parameter-control span {
    min-width: 80px;
    font-weight: bold;
    color: #2563eb;
}

.radio-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.radio-group input[type="radio"] {
    margin-right: 0.25rem;
}

.radio-group label {
    min-width: auto;
    font-weight: normal;
}

.parameter-info {
    background: #e5e7eb;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #374151;
}

.parameter-actions {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

#resetParameters {
    background: #6b7280;
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#resetParameters:hover {
    background: #4b5563;
}

/* Preset buttons */
.preset-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.preset-btn {
    background: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.preset-btn:hover {
    background: #2563eb;
}

/* Keyboard controls help */
.controls-help {
    color: #6b7280;
    font-size: 0.85rem;
}

.controls-help kbd {
    background: #e5e7eb;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.8rem;
    border: 1px solid #d1d5db;
}

/* Checkbox styling */
.parameter-control input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Benchmark results */
.benchmark-results {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.benchmark-results h4 {
    margin: 0 0 0.75rem 0;
    color: #1f2937;
    font-size: 1rem;
}

.benchmark-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.benchmark-table th,
.benchmark-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.benchmark-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #374151;
}

.benchmark-table .status-pass {
    color: #10b981;
    font-weight: 600;
}

.benchmark-table .status-fail {
    color: #ef4444;
    font-weight: 600;
}

.benchmark-table .status-warn {
    color: #f59e0b;
    font-weight: 600;
}

.benchmark-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.explanation h2, .links h2 {
    color: #1f2937;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.explanation ul {
    list-style-type: none;
}

.explanation li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.explanation strong {
    color: #374151;
}

.links p {
    margin-bottom: 1rem;
}

.links a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #3b82f6;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.links a:hover {
    background: #2563eb;
}

/* Credits footer */
.credits {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.credits h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #374151;
}

.credits p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
    color: #555;
    font-size: 0.95rem;
}

.credits p:last-child {
    margin-bottom: 0;
}

.credits a {
    color: #3b82f6;
    text-decoration: none;
}

.credits a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    #networkCanvas {
        width: 100%;
        height: auto;
    }
    
    .metrics-panel {
        grid-template-columns: 1fr;
    }
}