/* ===== Airfoil Wind Tunnel ===== */

body {
    background: #0a0a14;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    position: relative;
    z-index: 1;
    max-width: 1500px;
    margin: 0 auto;
    padding: 1rem;
}

.back-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #e94560;
    text-decoration: none;
    font-size: 1rem;
    z-index: 10;
}

header {
    text-align: center;
    padding: 1rem 0 0.5rem;
}

header h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #e94560, #ff6b81, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: #888;
    font-size: 0.95rem;
    margin-top: 0.3rem;
}

#main-layout {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    align-items: flex-start;
}

#airfoil-canvas {
    flex: 1;
    background: #0a1628;
    border: 2px solid #2a2a4a;
    border-radius: 8px;
    min-height: 600px;
}

#controls {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 85vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#controls h2 {
    font-size: 0.95rem;
    color: #e94560;
    border-bottom: 1px solid #2a2a4a;
    padding-bottom: 0.4rem;
    margin-top: 0.3rem;
}

.control-group {
    background: rgba(26, 26, 46, 0.7);
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 0.5rem;
}

.control-group label {
    display: block;
    font-size: 0.78rem;
    color: #aaa;
    margin-bottom: 0.25rem;
}

.control-group input[type="number"] {
    width: 100%;
    background: #0f0f1a;
    color: #e0e0e0;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 0.35rem;
    font-size: 0.85rem;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: #e94560;
}

.control-group span {
    display: block;
    text-align: right;
    font-size: 0.78rem;
    color: #e94560;
    font-weight: bold;
    margin-top: 0.2rem;
}

hr {
    border: none;
    border-top: 1px solid #2a2a4a;
    margin: 0.2rem 0;
}

button {
    background: linear-gradient(135deg, #e94560, #ff6b81);
    color: white;
    border: none;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover:not(:disabled) {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

button#stop-btn {
    background: #666;
}

button#stop-btn:hover:not(:disabled) {
    background: #888;
    box-shadow: none;
}

button#reset-btn {
    background: #444;
}

button#reset-btn:hover {
    background: #666;
    box-shadow: none;
}

/* Readout */
.readout {
    background: rgba(15, 15, 26, 0.9);
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 0.6rem;
}

.readout h3 {
    font-size: 0.85rem;
    color: #e94560;
    margin-bottom: 0.3rem;
}

.readout-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid #1a1a2e;
}

.readout-row span:first-child {
    color: #888;
}

.readout-row span:last-child {
    color: #ffd700;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.lift { color: #44ff44 !important; }
.drag { color: #ff4444 !important; }
.lift-label { color: #44ff44 !important; }
.drag-label { color: #ff4444 !important; }

.info-box {
    background: rgba(26, 26, 46, 0.7);
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 0.6rem;
    font-size: 0.75rem;
    color: #888;
    line-height: 1.5;
}

.info-box h3 {
    color: #bbb;
    margin-bottom: 0.3rem;
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    #main-layout {
        flex-direction: column;
    }
    #controls {
        width: 100%;
        max-height: none;
        overflow-y: visible;
    }
    #airfoil-canvas {
        min-height: 350px;
        max-height: 50vh;
    }
    header h1 {
        font-size: 1.3rem;
    }
    header p {
        font-size: 0.8rem;
    }

    /* Collapsible control sections on mobile */
    #controls h2 {
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
    }

    #controls h2::before {
        content: '▼ ';
        font-size: 0.7rem;
        transition: transform 0.2s;
    }

    #controls h2.collapsed::before {
        content: '▶ ';
    }

    .collapsible-section {
        transition: max-height 0.3s ease, opacity 0.3s ease;
        overflow: hidden;
        max-height: 1000px;
        opacity: 1;
    }

    .collapsible-section.collapsed {
        max-height: 0 !important;
        opacity: 0;
        padding: 0;
        margin: 0;
    }
}
