/* FLIGHT MODULE STYLES - FlightRadar Theme */

/* Small loader for search */
.loader-sm {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 12px;
    height: 12px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 5px;
}

/* Suggestions Dropdown (Airport Search) */
.input-group {
    position: relative;
    /* Ensure absolute children position relative to this */
}

.suggestions-dropdown {
    background: #0f172a;
    /* Solid dark background for visibility */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 8px;
    /* Slight spacing from input */
    top: 100%;
    /* Push below dropdown */
    max-height: 250px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    z-index: 9999;
    /* Ensure on top of everything */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    /* Strong shadow */
    animation: fadeIn 0.2s ease-out;
}

.suggestion-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-divider);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.suggestion-item:hover {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--primary-color);
    padding-left: 13px;
}

/* Flight Board Table */
.flight-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    /* Dark Blue/Slate */
    margin-top: 20px;
}

.map-container-responsive {
    width: 100%;
    height: 600px;
    /* Default desktop height */
    border-radius: 12px;
    margin-top: 20px;
    z-index: 1;
}

.flight-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.flight-table th {
    text-align: left;
    padding: 16px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.flight-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-divider);
    color: var(--text-primary);
    vertical-align: middle;
}

.flight-row {
    transition: background 0.15s;
    cursor: pointer;
}

.flight-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Specific Columns */
.flight-time {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--accent-amber);
    /* Yellow time like flight boards */
    font-size: 15px;
}

.flight-number {
    font-weight: 600;
    color: white;
}

.airline-logo-placeholder {
    display: inline-block;
    background: #333;
    color: #fff;
    font-size: 10px;
    padding: 3px 5px;
    border-radius: 3px;
    margin-right: 6px;
    font-weight: bold;
}

.flight-dest {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Status Badges */
.flight-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-green {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-scheduled {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-delayed {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-gray {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.flight-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-divider);
}

.modal-header h2 {
    font-size: 18px;
    color: white;
    margin: 0;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* Flight Route Display in Modal */
.flight-route-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.route-city {
    text-align: center;
}

.text-xl {
    font-size: 28px;
}

.font-bold {
    font-weight: 700;
    color: white;
}

.text-accent {
    color: var(--accent-amber);
    font-family: monospace;
    margin-top: 5px;
}

.route-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    flex: 1;
    padding: 0 20px;
}

.route-arrow i {
    font-size: 18px;
    margin-bottom: 5px;
    transform: rotate(90deg);
}

/* Plane icon */

.duration-line {
    height: 2px;
    width: 100%;
    background: var(--border-color);
    position: relative;
}

/* Info Grid */
.flight-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.info-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-divider);
}

.info-card .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.info-card .value {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.icon-btn-sm {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
}

/* Switch Chips */
.chip {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    margin-left: 5px;
}

background: var(--primary-color);
color: white;
border-color: var(--primary-color);
box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */

@media (max-width: 768px) {

    /* 1. Adjust Map Height */
    #flight-global-map {
        height: 400px !important;
        /* Override inline style class defaults */
    }

    /* 2. Modal Improvements */
    .flight-modal {
        width: 100%;
        height: 100%;
        /* Full screen on mobile */
        max-height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }

    .modal-overlay {
        padding: 0;
        /* Remove padding to allow full screen */
        align-items: flex-end;
        /* Sheet-like behavior or just full */
    }

    .modal-body {
        padding: 16px;
    }

    .flight-route-display {
        flex-direction: row;
        /* Keep row but tighter */
        padding: 15px 10px;
    }

    .text-xl {
        font-size: 20px;
        /* Smaller city codes */
    }

    /* 3. Header & Chips */
    .glass-panel {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .flight-type-switch {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .chip {
        flex: 1;
        text-align: center;
        padding: 8px;
        /* Larger touch target */
    }

    /* 4. Flight List Grid */
    .flight-table th,
    .flight-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .flight-time {
        font-size: 13px;
    }
}