/**
 * Nav & Pilots - Styles principaux
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    overflow-x: hidden; /* Empêche le scroll horizontal */
    overflow-y: auto; /* Permet le scroll vertical */
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    font-size: 2rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
}

.search-header {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
}

#searchInput {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.stats {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.3rem;
    font-weight: 700;
    display: block;
}

.stat-label {
    opacity: 0.9;
    font-size: 0.8rem;
}

/* Auth Menu */
.auth-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-left: 2rem;
}

.auth-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
    white-space: nowrap;
}

.auth-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.auth-link.auth-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
}

.auth-link.auth-btn:hover {
    background: white;
    color: #1e3c72;
}

/* Map Container */
#map {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Drawer Panels */
.drawer {
    position: fixed;
    top: 80px;
    right: -400px;
    width: 400px;
    max-width: 90vw;
    height: calc(100vh - 80px);
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.drawer.active {
    right: 0;
}

.drawer-header {
    position: sticky;
    top: 0;
    background: #1e3c72;
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.drawer-header h2 {
    font-size: 1.3rem;
    margin: 0;
}

.close-drawer {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-content {
    padding: 1.5rem;
}

.info-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-label {
    font-weight: 600;
    color: #666;
}

.info-value {
    color: #333;
}

.runway-tag, .freq-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.runway-tag {
    background: #e3f2fd;
    color: #1976d2;
}

.freq-tag {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* METAR/TAF sections */
.metar-section, .taf-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.section-title {
    font-weight: 700;
    color: #1e3c72;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metar-raw, .taf-raw {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 1rem;
}

.weather-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.weather-item {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
}

.weather-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weather-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e3c72;
    margin-top: 0.25rem;
}

.wind-compass {
    width: 120px;
    height: 120px;
    margin: 1rem auto;
    position: relative;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    background: white;
}

.wind-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 50px;
    background: #2a5298;
    transform-origin: bottom center;
    transform: translate(-50%, -100%);
}

.wind-arrow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid #2a5298;
}

.wind-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #2a5298;
    border-radius: 50%;
    z-index: 10;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2a5298;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    color: #d32f2f;
    font-size: 0.9rem;
    padding: 0.5rem;
    background: #ffebee;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.no-data {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Search Results */
.search-results {
    position: fixed;
    top: 80px;
    left: 20px;
    width: 300px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1500;
    display: none;
    overflow-y: auto;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.result-icao {
    font-weight: 700;
    color: #1e3c72;
    font-size: 1.1rem;
}

.result-name {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.result-location {
    color: #999;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Map Controls */
.map-controls {
    position: fixed;
    top: 100px;
    left: 20px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map-btn {
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.map-btn:hover {
    background: #f5f5f5;
    transform: scale(1.05);
}

/* Marker clusters */
.marker-cluster-small {
    background-color: rgba(42, 82, 152, 0.6);
}

.marker-cluster-small div {
    background-color: rgba(42, 82, 152, 0.8);
}

.marker-cluster-medium {
    background-color: rgba(30, 60, 114, 0.6);
}

.marker-cluster-medium div {
    background-color: rgba(30, 60, 114, 0.8);
}

.marker-cluster-large {
    background-color: rgba(20, 40, 80, 0.6);
}

.marker-cluster-large div {
    background-color: rgba(20, 40, 80, 0.8);
}

.loading-overlay {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #666;
}

.loading-overlay.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .auth-menu {
        margin-left: 1rem;
    }

    .auth-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .search-header {
        display: none;
    }

    .stats {
        font-size: 0.8rem;
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.1rem;
    }

    h1 {
        font-size: 1.2rem;
    }

    .auth-menu {
        margin-left: 0.5rem;
        gap: 0.5rem;
    }

    .auth-link {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }
}
