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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    color: #e0e6ed;
    min-height: 100vh;
    overflow-x: hidden;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    font-weight: 300;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    color: #8b9bb4;
    font-weight: 300;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

.canvas-container {
    position: relative;
    background: #0d1117;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid #21262d;
}

#simulation {
    display: block;
    width: 100%;
    height: 700px;
    cursor: crosshair;
}

.overlay-info {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #21262d;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-item .label {
    color: #8b9bb4;
    font-size: 0.85em;
    font-weight: 500;
}

.info-item .value {
    color: #58a6ff;
    font-weight: 600;
    font-size: 0.9em;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-section {
    background: #0d1117;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #21262d;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.control-section h3 {
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 15px;
    color: #e0e6ed;
    border-bottom: 2px solid #21262d;
    padding-bottom: 10px;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.preset-btn {
    padding: 12px 16px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e0e6ed;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: #21262d;
    border-color: #58a6ff;
}

.preset-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    font-weight: 600;
}

.control-group {
    margin-bottom: 15px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: #8b9bb4;
}

.control-group label span:first-child {
    flex: 1;
    min-width: 80px;
}

.control-group input[type="range"] {
    flex: 1;
    height: 6px;
    background: #21262d;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.control-group .value {
    min-width: 50px;
    text-align: right;
    color: #58a6ff;
    font-weight: 600;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9em;
    color: #e0e6ed;
}

.toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
}

.interaction-info {
    background: #161b22;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #21262d;
}

.interaction-info p {
    font-size: 0.85em;
    color: #8b9bb4;
    line-height: 1.6;
    margin-bottom: 6px;
}

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

.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.action-btn {
    padding: 12px 16px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e0e6ed;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #21262d;
    border-color: #58a6ff;
}

.action-btn:active {
    transform: scale(0.98);
}

.info-section p {
    font-size: 0.9em;
    color: #8b9bb4;
    line-height: 1.6;
    margin-bottom: 10px;
}

.info-section strong {
    color: #e0e6ed;
}

.info-section ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.info-section li {
    font-size: 0.85em;
    color: #8b9bb4;
    line-height: 1.5;
    margin-bottom: 5px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #21262d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #30363d;
}

/* Responsive design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .controls {
        order: 2;
    }

    .canvas-container {
        order: 1;
    }

    #simulation {
        height: 500px;
    }
}

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

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

    .action-buttons {
        grid-template-columns: 1fr;
    }

    #simulation {
        height: 400px;
    }
}
