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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0a0e1a;
    color: #e0e6f0;
    overflow: hidden;
    height: 100vh;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    padding: 8px 20px;
    background: linear-gradient(135deg, #0d1525 0%, #1a2744 100%);
    border-bottom: 1px solid #2a3a5c;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

header h1 {
    font-size: 1.2rem;
    color: #7db8f0;
    white-space: nowrap;
}

.subtitle {
    font-size: 0.75rem;
    color: #6a7a9a;
}

#main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Controls Panel */
#controls {
    width: 280px;
    min-width: 280px;
    background: #0f1628;
    border-right: 1px solid #2a3a5c;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-group {
    background: #151d33;
    border: 1px solid #2a3a5c;
    border-radius: 8px;
    padding: 12px;
}

.control-group h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #5a8abf;
    margin-bottom: 10px;
}

/* Wind Compass */
#wind-compass {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-width: 160px;
    margin: 0 auto 12px;
}

.wind-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #2a3a5c;
    border-radius: 8px;
    background: #1a2440;
    color: #8ab4d8;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wind-btn:hover {
    background: #253a5c;
    border-color: #4a8ad8;
}

.wind-btn.active {
    background: #1a4a7a;
    border-color: #4a9af0;
    color: #fff;
    box-shadow: 0 0 12px rgba(74, 154, 240, 0.3);
}

.compass-center {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a7ab0;
    font-size: 1.5rem;
}

/* Sliders */
input[type="range"] {
    width: 100%;
    margin: 6px 0;
    -webkit-appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-track {
    height: 4px;
    background: #2a3a5c;
    border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #4a9af0;
    border-radius: 50%;
    margin-top: -6px;
    cursor: pointer;
}

label {
    font-size: 0.8rem;
    color: #8a9abc;
}

/* Buttons */
.action-btn {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #2a3a5c;
    border-radius: 6px;
    background: #1a2440;
    color: #8ab4d8;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
}

.action-btn:hover {
    background: #253a5c;
    border-color: #4a8ad8;
}

.action-btn.primary {
    background: #1a4a2a;
    border-color: #2a8a4a;
    color: #6ada8a;
}

.action-btn.primary:hover {
    background: #2a5a3a;
    border-color: #4aba6a;
}

.action-btn.danger {
    color: #d88a8a;
    border-color: #5c2a2a;
}

.action-btn.danger:hover {
    background: #3a1a1a;
    border-color: #8a4a4a;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    font-size: 0.8rem;
}

.checkbox-label input[type="checkbox"] {
    accent-color: #4a9af0;
}

/* Info Panel */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid #1a2440;
}

.info-row span:last-child {
    color: #7db8f0;
    font-weight: 600;
}

/* Turbine & Hole Lists */
#turbine-list, #hole-list {
    max-height: 120px;
    overflow-y: auto;
    margin-top: 6px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    margin: 2px 0;
    background: #1a2440;
    border-radius: 4px;
    font-size: 0.75rem;
}

.list-item .voltage {
    color: #6ada8a;
    font-weight: 600;
}

/* Canvas */
#canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#sim-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.tooltip {
    position: absolute;
    background: rgba(15, 22, 40, 0.95);
    border: 1px solid #4a8ad8;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
}

.tooltip.hidden {
    display: none;
}

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

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

::-webkit-scrollbar-thumb {
    background: #2a3a5c;
    border-radius: 3px;
}

/* Hole drag hint */
.hole-hint {
    font-size: 0.7rem;
    color: #6a7a9a;
    font-style: italic;
    margin-top: 4px;
}

/* Wall orientation toggle */
.wall-orient-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.orient-btn {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #2a3a5c;
    border-radius: 6px;
    background: #1a2440;
    color: #8ab4d8;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.orient-btn:hover {
    background: #253a5c;
    border-color: #4a8ad8;
}

.orient-btn.active {
    background: #1a4a7a;
    border-color: #4a9af0;
    color: #fff;
}

.wind-speed-control {
    margin-top: 4px;
}

/* Mode toggle */
.mode-toggle {
    display: flex;
    gap: 4px;
}

.mode-btn {
    flex: 1;
    padding: 8px 8px;
    border: 1px solid #2a3a5c;
    border-radius: 6px;
    background: #1a2440;
    color: #8ab4d8;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: #253a5c;
    border-color: #4a8ad8;
}

.mode-btn.active {
    background: #1a4a7a;
    border-color: #4a9af0;
    color: #fff;
    box-shadow: 0 0 10px rgba(74, 154, 240, 0.25);
}

#wall-section.hidden-section {
    display: none;
}
