/* Flight Tracking Page Styles - Integrated with gfenno.com Design System */

.flight-tracking-hero {
    background: var(--gradient-cool-space);
    padding: 5rem 0 3rem 0;
    text-align: center;
}

.flight-tracking-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.flight-tracking-hero .section-title {
    color: #ffffff;
    margin-bottom: 1rem;
}

.flight-tracking-hero .section-subtitle {
    color: #ffffff;
    font-size: 1.125rem;
    opacity: 0.9;
}

/* Year Selector Section */
.year-selector-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    max-width: 300px;
    margin: 0 auto;
}

.year-selector label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.year-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-family);
    min-width: 120px;
    transition: all 0.2s;
}

.year-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Flight Map Section */
.flight-map-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.flight-map-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.flight-map-header .section-title {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    margin-left: auto;
    margin-right: auto;
}

.flight-map-header .section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-left: auto;
    margin-right: auto;
}

.flight-map-container {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #e6f3ff;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

#flight-tracking-map {
    width: 100%;
    height: 100%;
    cursor: grab;
    overflow: hidden;
}

#flight-tracking-map:active {
    cursor: grabbing;
}

/* Smooth scrolling for the map */
.flight-tracking-map svg {
    transition: transform 0.1s ease-out;
}

/* Optional instructions for horizontal scrolling */
.flight-map-container::before {
    content: "Use ← → buttons or Shift+Scroll to pan";
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10;
    pointer-events: none;
}

/* Ensure countries are styled properly across all world copies */
.flight-tracking-map .country {
    fill: #f8f9fa;
    stroke: #dee2e6;
    stroke-width: 0.5px;
    opacity: 0.8;
}

.flight-tracking-map .country:hover {
    fill: #e9ecef;
}

.flight-map-container .map-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.flight-map-container .control-btn {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    font-family: var(--font-family);
}

.flight-map-container .control-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.flight-map-container .control-btn i {
    font-size: 1rem;
}

/* Flight Details Section */
.flight-details-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.flight-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.flight-details-header:hover {
    background-color: var(--bg-secondary);
}

.flight-details-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.flight-details {
    background: var(--bg-primary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    padding: 2rem;
    transition: all 0.3s ease;
}

.flight-details.collapsed {
    max-height: 0;
    padding: 0 2rem;
    opacity: 0;
    overflow: hidden;
}

.collapse-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collapse-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
}

.collapse-btn i {
    transition: transform 0.2s;
}

.collapse-btn[aria-expanded="false"] i {
    transform: rotate(180deg);
}

/* Flight Stats */
.flight-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Flight List */
.flight-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flight-route-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
}

.flight-route-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.flight-route-flags {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.flight-route-flag {
    width: 32px;
    height: 20px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.flight-route-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.flight-route-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.flight-route-details {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.flight-route-distance {
    font-weight: 500;
    color: var(--primary-color);
}

.flight-route-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Year Summary Section */
.year-summary-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.year-summary-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.summary-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.2s;
}

.summary-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-card-year {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.summary-card-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-stat {
    text-align: center;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.summary-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.summary-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.summary-card-countries {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.summary-countries-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.summary-countries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.summary-country-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
}

.summary-country-flag {
    width: 16px;
    height: 10px;
    border-radius: 2px;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
}

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

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

.loading-overlay p {
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

/* Map Styles */
.flight-tracking-map .country {
    fill: #f1f5f9;
    stroke: #cbd5e1;
    stroke-width: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.flight-tracking-map .country:hover {
    fill: #e2e8f0;
}

.flight-tracking-map .flight-path {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 1.2px; /* thinner default */
    stroke-linecap: round;
    stroke-dasharray: none;
    opacity: 0.6; /* subtle by default; highlight raises opacity */
    transition: stroke-width 0.15s ease, opacity 0.15s ease;
}

.flight-tracking-map .airport-marker {
    fill: var(--primary-color);
    stroke: white;
    stroke-width: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

.flight-tracking-map .airport-marker:hover {
    fill: var(--primary-hover);
}

.flight-tracking-map .airport-label {
    fill: var(--text-secondary);
    font-size: 9px; /* smaller, subtler */
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
    font-family: var(--font-family);
}

/* Airport marker groups */
.flight-tracking-map .airport-marker-group {
    transition: all 0.2s;
}

.flight-tracking-map .airport-marker-group circle {
    transition: all 0.2s;
}

.flight-tracking-map .airport-marker-group text {
    transition: all 0.2s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .flight-tracking-hero {
        padding: 3rem 0 2rem 0;
    }

    .flight-tracking-hero .section-title {
        font-size: 2rem;
    }

    .flight-tracking-hero .section-subtitle {
        font-size: 1rem;
    }

    .year-selector-section,
    .flight-map-section,
    .flight-details-section,
    .year-summary-section {
        padding: 1.5rem;
    }

    .flight-map-container {
        height: 400px;
    }

    .flight-stats {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .flight-details-header {
        padding: 1rem;
    }

    .flight-details {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .year-selector {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .flight-map-container .map-controls {
        top: 0.5rem;
        right: 0.5rem;
    }

    .flight-map-container .control-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}
