/* Global Styles */
:root {
    --primary-color: #0a4a7c;
    --secondary-color: #e74c3c;
    --accent-color: #2ecc71;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --shadow: 0 4px 10px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Header Styles */
header {
    background: black;
    color: white;
    text-align: center;
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

header h1 {
    font-size: 2.5rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.aircraft-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.airplane {
    position: absolute;
    width: 60px;
    height: 40px;
    background-image: url('airplane-icon.png');
    background-size: contain;
    background-repeat: no-repeat;
    animation: fly 15s linear infinite;
    opacity: 0.7;
    transform: rotate(90deg);
}

@keyframes fly {
    0% {
        left: -5%;
        top: 40%;
        transform: rotate(90deg);
    }
    45% {
        left: 35%;
        top: 40%;
        transform: rotate(90deg);
    }
    50% {
        left: 40%;
        top: 40%;
        transform: rotate(75deg);
    }
    60% {
        left: 45%;
        top: 25%;
        transform: rotate(60deg);
    }
    65% {
        left: 50%;
        top: 10%;
        transform: rotate(90deg);
    }
    100% {
        left: 105%;
        top: 10%;
        transform: rotate(90deg);
    }
}

@keyframes flyUp {
    0% {
        left: -5%;
        top: 40%;
        transform: rotate(90deg);
    }
    45% {
        left: 35%;
        top: 40%;
        transform: rotate(90deg);
    }
    50% {
        left: 40%;
        top: 40%;
        transform: rotate(60deg);
    }
    60% {
        left: 45%;
        top: 20%;
        transform: rotate(45deg);
    }
    65% {
        left: 50%;
        top: 10%;
        transform: rotate(90deg);
    }
    100% {
        left: 105%;
        top: 10%;
        transform: rotate(90deg);
    }
}

@keyframes flyDown {
    0% {
        left: -5%;
        top: 40%;
        transform: rotate(90deg);
    }
    45% {
        left: 35%;
        top: 40%;
        transform: rotate(90deg);
    }
    50% {
        left: 40%;
        top: 40%;
        transform: rotate(120deg);
    }
    60% {
        left: 45%;
        top: 60%;
        transform: rotate(135deg);
    }
    65% {
        left: 50%;
        top: 70%;
        transform: rotate(90deg);
    }
    100% {
        left: 105%;
        top: 70%;
        transform: rotate(90deg);
    }
}

/* Tab Styles */
.tab-container {
    max-width: 1200px;
    margin: 2rem auto;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
}

.tabs {
    display: flex;
    flex-direction: column;
    background-color: black;
    overflow-y: auto;
    width: 250px;
    min-width: 250px;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 1.2rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    color: white;
    border-left: 4px solid var(--accent-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.1);
}

.tab-content {
    padding: 2rem;
    flex: 1;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-pane h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tab-pane p {
    color: #666;
    margin-bottom: 2rem;
}

.coming-soon {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background-color: rgba(10, 74, 124, 0.05);
    border: 2px dashed var(--primary-color);
}

.coming-soon h3 {
    font-size: 2rem;
    color: var(--primary-color);
    letter-spacing: 2px;
    cursor: pointer;
}

.coming-soon a {
    text-decoration: none;
}

/* Test Container Styles */
.test-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
    text-align: center;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin: 0.5rem;
}

button:hover {
    background-color: #0c5d9c;
}

input[type="text"] {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    max-width: 400px;
    margin: 1rem auto;
    font-size: 1rem;
}

/* Memory Test Styles */
#memory-sequence {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 5px;
    margin: 2rem 0;
    color: var(--primary-color);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#memory-test-instructions {
    text-align: center;
    margin-bottom: 2rem;
}

#memory-test-instructions ul {
    margin: 1rem auto;
    padding-left: 2rem;
}

#memory-test-instructions p {
    margin-bottom: 0.5rem;
}

/* Spatial Test Styles */
.instruments {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.instrument {
    width: 150px;
    text-align: center;
}

.instrument-inner {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #333;
    margin: 0 auto 0.5rem;
    position: relative;
    overflow: hidden;
    background-color: #222;
}

.horizon {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #5e9cd3 50%, #8a7358 50%);
    transform-origin: center;
}

.compass {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="none" stroke="white" stroke-width="1"/><text x="50" y="20" text-anchor="middle" fill="white" font-size="10">N</text><text x="50" y="85" text-anchor="middle" fill="white" font-size="10">S</text><text x="85" y="52" text-anchor="middle" fill="white" font-size="10">E</text><text x="15" y="52" text-anchor="middle" fill="white" font-size="10">W</text></svg>');
    background-size: contain;
}

.heading-marker {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 15px;
    background-color: red;
    transform: translateX(-50%);
}

.options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.option {
    width: 120px;
    height: 120px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.aircraft-icon {
    width: 80px;
    height: 80px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%230a4a7c"><path d="M21,16V14L13,9V3.5A1.5,1.5,0,0,0,11.5,2h0A1.5,1.5,0,0,0,10,3.5V9L2,14v2l8-2.5V19l-2,1.5V22l3.5-1h1L15,22V20.5L13,19V13.5Z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform-origin: center;
}

.spatial-game-instructions {
    background-color: #f0f8ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0 2rem 0;
    text-align: left;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.instruction-section {
    margin-bottom: 1.5rem;
}

.instruction-section:last-child {
    margin-bottom: 0;
}

.instruction-section h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.instruction-section ul, 
.instruction-section ol {
    margin-left: 1.5rem;
}

.instruction-section li {
    margin-bottom: 0.3rem;
}

.instruction-section ol {
    counter-reset: item;
}

.instruction-section ol li {
    position: relative;
}

/* Multitasking Test Styles */
.multitask-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.task {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    width: calc(33.333% - 1rem);
    min-width: 250px;
}

.task h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.level-indicator {
    height: 20px;
    background-color: #eee;
    border-radius: 10px;
    position: relative;
    margin-bottom: 1rem;
}

.level-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: left 0.2s ease;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.radio-message {
    min-height: 60px;
    background-color: #222;
    color: #4ced4c;
    border-radius: 4px;
    padding: 0.75rem;
    font-family: monospace;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radio-response {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.response-btn {
    padding: 0.5rem;
    font-size: 0.9rem;
}

.fuel-gauge {
    height: 20px;
    background-color: #eee;
    border-radius: 10px;
    position: relative;
    margin-bottom: 1rem;
    overflow: hidden;
}

.fuel-level {
    height: 100%;
    background-color: var(--accent-color);
    width: 100%;
    transition: width 0.5s ease;
}

.multitask-stats {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-around;
    box-shadow: var(--shadow);
}

/* Flight Test Styles */
.flight-simulation {
    position: relative;
    margin-bottom: 2rem;
}

#flight-canvas {
    width: 100%;
    height: 300px;
    background-color: #c7e6ff;
    border-radius: 8px;
}

.flight-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flight-instruments {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.instrument {
    text-align: center;
    width: 120px;
}

.gauge {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #333;
    margin: 0 auto;
    position: relative;
    background-color: #222;
    overflow: hidden;
}

/* Results Section */
.results-overview {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: center;
}

.results-chart-container {
    height: 300px;
    margin-bottom: 2rem;
}

.results-summary {
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.flight-metrics {
    margin: 1.5rem 0;
}

.metric {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.metric span {
    width: 150px;
    text-align: right;
    margin-right: 1rem;
}

.progress-bar {
    flex-grow: 1;
    height: 12px;
    background-color: #eee;
    border-radius: 6px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--accent-color);
    transition: width 1s ease;
}

/* Footer Styles */
footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .tab-container {
        flex-direction: column;
    }
    
    .tabs {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .tab-btn {
        white-space: nowrap;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .tab-btn.active {
        border-left: none;
        border-bottom: 3px solid var(--accent-color);
    }
    
    .tab-content {
        padding: 1.5rem;
    }
    
    .task {
        width: 100%;
    }
    
    .instruments {
        flex-direction: column;
        align-items: center;
    }
    
    .flight-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .options {
        flex-direction: column;
        align-items: center;
    }
    
    .spatial-game-instructions {
        padding: 1rem;
    }
}