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

:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-medium: #1e293b;
    --bg-light: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 100%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
}

#app-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 100%);
}

.screen.active {
    display: flex;
}

/* Main Menu */
.menu-card, .selection-card {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.selection-card {
    max-width: 900px;
}

.title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.menu-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-family: 'Orbitron', sans-serif;
    border: none;
    border-radius: 10px;
    background: var(--bg-light);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.menu-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    font-size: 1.3rem;
    padding: 20px 40px;
}

.menu-btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.menu-btn.danger {
    background: var(--danger);
}

.footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
}

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

/* Flight Selection */
.selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.airport-selector h3 {
    margin-bottom: 10px;
    color: var(--primary-light);
}

.airport-dropdown, .dropdown {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
    border: 2px solid var(--bg-light);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Roboto Mono', monospace;
}

.airport-info {
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-dark);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-height: 60px;
}

.time-selector {
    margin-bottom: 30px;
}

.time-selector h3 {
    margin-bottom: 10px;
    color: var(--primary-light);
}

.toggle-switch {
    display: flex;
    gap: 10px;
}

.toggle-btn {
    flex: 1;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid var(--bg-light);
    border-radius: 10px;
    background: var(--bg-dark);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: var(--primary);
    color: var(--text-primary);
    border-color: var(--primary-light);
}

.flight-info {
    padding: 15px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: 'Roboto Mono', monospace;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons .menu-btn {
    flex: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-medium);
    border-radius: 20px;
    padding: 40px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary-light);
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section h3 {
    margin-bottom: 10px;
    font-size: 1rem;
}

.hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.text-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 2px solid var(--bg-light);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Roboto Mono', monospace;
}

.slider {
    width: calc(100% - 60px);
    margin-right: 10px;
}

.status-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

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

.control-group h3 {
    margin-bottom: 10px;
    color: var(--secondary);
    font-size: 1rem;
}

.control-item {
    padding: 8px;
    margin-bottom: 5px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
}

.key {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    border: 1px solid var(--bg-light);
    font-weight: bold;
    color: var(--primary-light);
    min-width: 30px;
    text-align: center;
}

/* 3D Scene */
#scene-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

#scene-container.active {
    display: block;
}

/* HUD Overlay */
#hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#hud-overlay.hidden {
    display: none;
}

.hud-panel {
    position: absolute;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 15px;
    font-family: 'Roboto Mono', monospace;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.top-left {
    top: 20px;
    left: 20px;
}

.top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.top-right {
    top: 20px;
    right: 20px;
}

.bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.bottom-right {
    bottom: 20px;
    right: 20px;
    pointer-events: all;
}

.instrument {
    margin-bottom: 15px;
}

.instrument:last-child {
    margin-bottom: 0;
}

.instrument-label {
    font-size: 0.75rem;
    color: var(--secondary);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.instrument-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
}

.instrument-sublabel {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* Bars */
.speed-bar, .throttle-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--secondary));
    transition: width 0.2s ease;
}

/* Attitude Indicator */
.attitude-indicator {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(180deg, #3b82f6 0%, #0f172a 50%, #78350f 50%, #78350f 100%);
    position: relative;
    overflow: hidden;
    border: 3px solid var(--bg-light);
}

.horizon {
    position: absolute;
    width: 200%;
    height: 200%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease;
}

.aircraft-symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--text-primary);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

/* Compass */
.compass {
    width: 100%;
    height: 30px;
    background: var(--bg-dark);
    border-radius: 5px;
    margin-top: 5px;
    position: relative;
    overflow: hidden;
}

/* Flaps & Gear */
.flaps-indicator, .gear-indicator {
    padding: 8px;
    background: var(--bg-dark);
    border-radius: 5px;
    text-align: center;
    margin-top: 5px;
}

.gear-light {
    font-size: 1.1rem;
}

/* Flight Phase */
.flight-phase {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 8px;
    letter-spacing: 2px;
}

.warnings {
    margin-top: 10px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
}

.warning {
    padding: 8px 15px;
    margin: 5px;
    border-radius: 5px;
    display: inline-block;
    animation: flash 1s infinite;
}

.warning.critical {
    background: var(--danger);
}

.warning.caution {
    background: var(--secondary);
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Navigation Arrow */
.nav-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--secondary);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
    pointer-events: none;
    transition: transform 0.2s ease;
}

/* Controls Help */
.help-toggle {
    cursor: pointer;
    padding: 8px 12px;
    background: var(--primary);
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
}

.help-content {
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-dark);
    border-radius: 8px;
}

.help-content.hidden {
    display: none;
}

.help-item {
    font-size: 0.8rem;
    margin: 5px 0;
    color: var(--text-secondary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .selection-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .hud-panel {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .top-left, .top-right {
        top: 10px;
    }
    
    .top-left {
        left: 10px;
    }
    
    .top-right {
        right: 10px;
    }
    
    .instrument-value {
        font-size: 1.1rem;
    }
    
    .attitude-indicator {
        width: 80px;
        height: 80px;
    }
}

.hidden {
    display: none !important;
}