/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #15223b;
    --secondary-color: #0e1729;
    --accent-color: #d4a053;
    --success-color: #0d9488;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #f3f4f7;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
    --shadow-lg: 0 16px 32px rgba(17, 24, 39, 0.14);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

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

/* Header */
.header {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--primary-color);
}

.logo-image {
    height: 2.8rem;
    width: auto;
    max-width: 3.1rem;
    object-fit: contain;
    border-radius: 0.6rem;
    box-shadow: 0 8px 20px rgba(21, 34, 59, 0.18);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.logo:hover .logo-image {
    transform: translateY(-1px);
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #1f2937;
}

.btn-primary:hover {
    background-color: #bd8a3f;
    color: #111827;
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid rgba(21, 34, 59, 0.2);
}

.btn-secondary:hover {
    background-color: rgba(21, 34, 59, 0.05);
    border-color: rgba(21, 34, 59, 0.4);
}

.hero .btn-secondary {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.hero .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-success {
    background-color: var(--success-color);
    color: #ffffff;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 0.5rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #ffffff;
    box-shadow: var(--shadow);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2.5rem 0;
}

/* Hero Section */
.hero {
    position: relative;
    overflow: hidden;
    color: var(--primary-color);
    padding: 5rem 0 6rem;
    margin-bottom: 4rem;
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(21, 34, 59, 0.55), rgba(17, 24, 39, 0.60)),
                radial-gradient(circle at 12% 18%, rgba(212, 160, 83, 0.18), transparent 46%),
                radial-gradient(circle at 85% 20%, rgba(13, 148, 136, 0.10), transparent 42%);
    z-index: 1;
}

.hero .container {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 760px;
    text-align: center;
    align-items: center;
}

.hero-highlight {
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.875rem;
}

.hero h2 {
    font-size: 3rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.125rem;
    color: #ffffff;
    max-width: 36rem;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
    justify-content: center;
}

.hero-badges {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.hero-badges span {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(21, 34, 59, 0.12);
    color: var(--primary-color);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

@media (min-width: 900px) {
    .hero .container {
        justify-content: center;
    }
}

/* Sections */
.section-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-subtitle {
    color: var(--text-light);
    max-width: 42rem;
    margin-bottom: 2rem;
}

/* Grids */
.aircraft-grid,
.courses-grid,
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.features {
    margin-top: 4rem;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.75rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* Aircraft Cards */
.aircraft-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.aircraft-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 0;
    margin-bottom: 0;
}

.aircraft-card-body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.aircraft-manufacturer {
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
}

.aircraft-description {
    color: var(--text-color);
    line-height: 1.7;
}

.aircraft-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    gap: 1rem;
}

.courses-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Feature Cards */
.feature-card {
    text-align: left;
    padding: 2.25rem;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border-top: 4px solid rgba(21, 34, 59, 0.1);
}

.feature-card h3 {
    font-size: 1.375rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: white;
}

/* Training Interface */
.training-interface {
    display: grid;
    grid-template-columns: 1fr 400px;
    height: calc(100vh - 70px);
    background: var(--bg-dark);
}

.scene-container {
    position: relative;
    background: #000;
}

#renderCanvas {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}

.scene-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* Training Panel */
.training-panel {
    background: white;
    overflow-y: auto;
    padding: 2rem;
}

.panel-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-section:last-child {
    border-bottom: none;
}

.step-counter {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.step-section h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.step-section p {
    color: var(--text-light);
    line-height: 1.8;
}

.step-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.hint-box {
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0.5rem;
}

.feedback-box {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.feedback-box.success {
    background: #d1fae5;
    border-left: 4px solid var(--success-color);
}

.feedback-box.error {
    background: #fee2e2;
    border-left: 4px solid var(--error-color);
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: var(--success-color);
    transition: width 0.5s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Progress Page */
.progress-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
}

.stat-card .label {
    color: var(--text-light);
    margin-top: 0.5rem;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.progress-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.progress-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.progress-card h3 {
    margin-bottom: 0.25rem;
}

.progress-card .aircraft {
    color: var(--text-light);
    font-size: 0.875rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge.in_progress {
    background: #d8e7ff;
    color: var(--primary-color);
}

.status-badge.completed {
    background: #d1fae5;
    color: var(--success-color);
}

.status-badge.not_started {
    background: var(--bg-color);
    color: var(--text-light);
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-light);
}

/* Auth Section */
#auth-section {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Difficulty Badge */
.difficulty-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.difficulty-badge.beginner {
    background: #d1fae5;
    color: #065f46;
}

.difficulty-badge.intermediate {
    background: #fed7aa;
    color: #9a3412;
}

.difficulty-badge.advanced {
    background: #fecaca;
    color: #991b1b;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 900px) {
    .hero h2 {
        font-size: 2.35rem;
    }

    .hero .container {
        max-width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 4rem 0 4.5rem;
    }

    .hero-badges {
        justify-content: flex-start;
    }

    .hero-content {
        text-align: left;
        align-items: flex-start;
    }

    .training-interface {
        grid-template-columns: 1fr;
        grid-template-rows: 60vh auto;
    }
    
    .nav {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-image {
        height: 2.4rem;
        max-width: 2.7rem;
    }
    
    .aircraft-grid,
    .courses-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
}
