/* ============================================
   Flight Tracking Page Styles
   ============================================ */

.tracking-hero {
    background-image: url('../images/banner-image.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Removed background-attachment: fixed */
    color: var(--white);
    padding: 180px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tracking-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(2, 116, 190, 0.85), rgba(1, 90, 148, 0.85));
    z-index: 1;
}

.tracking-hero .container {
    position: relative;
    z-index: 2;
}

.tracking-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    color: var(--white);
}

.tracking-hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    position: relative;
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    color: var(--white);
}

.tracking-hero .lead {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    color: var(--white);
}

/* Search Section */
.tracking-search {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-lg);
}

.input-group-text {
    background: var(--primary-color);
    color: var(--white);
    border: none;
}

.search-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Flight List */
.flight-list-container {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px var(--shadow-lg);
    height: calc(100vh - 250px);
    overflow-y: auto;
    position: sticky;
    top: 100px;
}

.flight-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flight-card {
    background: var(--light);
    border-radius: 10px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.flight-card.main-flight {
    background: linear-gradient(135deg, rgba(2, 116, 190, 0.1) 0%, rgba(2, 116, 190, 0.05) 100%);
    border: 2px solid var(--primary-color);
    box-shadow: 0 5px 20px rgba(2, 116, 190, 0.2);
    position: relative;
}

.flight-card.main-flight::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 30px 30px 0;
    border-color: transparent var(--primary-color) transparent transparent;
}

.flight-card.blinking-flight {
    animation: redBlink 1.5s infinite;
    border-color: rgba(231, 76, 60, 0.5) !important;
}

.flight-card.blinking-flight.main-flight {
    animation: redBlinkMain 1.5s infinite;
}

@keyframes redBlink {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
        border-color: rgba(231, 76, 60, 0.3);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.4);
        border-color: rgba(231, 76, 60, 0.8);
    }
}

@keyframes redBlinkMain {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0), 0 5px 20px rgba(2, 116, 190, 0.2);
        border-color: var(--primary-color);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(231, 76, 60, 0.5), 0 5px 25px rgba(2, 116, 190, 0.3);
        border-color: rgba(231, 76, 60, 0.9);
    }
}

/* Removed main-flight-badge styles */

.flight-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.flight-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px var(--shadow-lg);
    border-color: var(--primary-color);
}

.flight-card:hover::before {
    transform: scaleY(1);
}

.flight-card.active {
    background: rgba(2, 116, 190, 0.1);
    border-color: var(--primary-color);
}

.flight-card.active::before {
    transform: scaleY(1);
}

.flight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.flight-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.flight-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-in-flight {
    background: #2ecc71;
    color: var(--white);
}

.status-scheduled {
    background: #3498db;
    color: var(--white);
}

.status-landed {
    background: #95a5a6;
    color: var(--white);
}

.status-delayed {
    background: #e74c3c;
    color: var(--white);
}

.flight-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.route-airport {
    text-align: center;
    flex: 1;
}

.airport-code {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.airport-name {
    font-size: 0.85rem;
    color: var(--text-light);
}

.route-arrow {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.flight-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

.info-item i {
    color: var(--primary-color);
    width: 20px;
}

.progress-info {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(2, 116, 190, 0.02);
    transition: background 0.3s ease;
}

.progress-info.updating {
    background: rgba(2, 116, 190, 0.08);
    animation: infoPulse 0.6s ease;
}

@keyframes infoPulse {
    0%, 100% {
        background: rgba(2, 116, 190, 0.02);
    }
    50% {
        background: rgba(2, 116, 190, 0.12);
    }
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.progress-label strong {
    color: var(--primary-color);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    font-weight: 700;
}

.progress-label strong.updating {
    animation: labelPulse 0.5s ease;
}

@keyframes labelPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        color: var(--primary-dark);
    }
}

.progress-percent {
    display: inline-block;
    min-width: 50px;
    text-align: left;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    position: relative;
}

.progress-percent.updating {
    animation: percentPulse 0.6s ease;
    color: var(--primary-dark);
    transform: scale(1.15);
}

@keyframes percentPulse {
    0% {
        transform: scale(1);
        color: var(--primary-color);
    }
    50% {
        transform: scale(1.25);
        color: var(--primary-dark);
        text-shadow: 0 0 10px rgba(2, 116, 190, 0.5);
    }
    100% {
        transform: scale(1.1);
        color: var(--primary-color);
    }
}

.remaining-time {
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--primary-color);
}

.progress-bar-container {
    background: var(--light);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .progress-bar-container {
        height: 8px;
    }
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(2, 116, 190, 0.3);
}

.progress-bar.updating {
    animation: progressGlow 0.8s ease;
}

@keyframes progressGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(2, 116, 190, 0.3);
    }
    50% {
        box-shadow: 0 2px 15px rgba(2, 116, 190, 0.6), 0 0 20px rgba(2, 116, 190, 0.4);
    }
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(2, 116, 190, 0.7), 0 0 25px rgba(2, 116, 190, 0.4);
    animation: pulse-dot 1.5s infinite;
    border: 2px solid white;
    z-index: 2;
}

.progress-bar.updating::after {
    animation: pulse-dot 0.5s infinite, dotGlow 0.8s ease;
}

@keyframes dotGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(2, 116, 190, 0.7), 0 0 25px rgba(2, 116, 190, 0.4);
        transform: translateY(-50%) scale(1);
    }
    50% {
        box-shadow: 0 0 25px rgba(2, 116, 190, 1), 0 0 40px rgba(2, 116, 190, 0.6);
        transform: translateY(-50%) scale(1.3);
    }
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
    }

    50% {
        transform: translateY(-50%) scale(1.2);
    }
}

/* Map Container */
.map-container {
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-lg);
    overflow: hidden;
    height: calc(100vh - 250px);
    position: sticky;
    top: 100px;
}

.map-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.map-header h4 {
    margin: 0;
    font-weight: 600;
}

.map-controls {
    display: flex;
    gap: 0.5rem;
}

.flight-map {
    height: calc(100% - 60px);
    width: 100%;
    position: relative;
}

.map-legend {
    background: rgba(26, 26, 26, 0.9);
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}

.legend-icon.in-flight {
    background: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
    animation: pulse-dot 1.5s infinite;
}

.legend-icon.scheduled {
    background: #3498db;
}

.legend-icon.landed {
    background: #95a5a6;
}

.legend-icon.delayed {
    background: #e74c3c;
}

/* Flight Details Modal */
.modal-content {
    border-radius: 15px;
    overflow: hidden;
}

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

.detail-card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.detail-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

.timeline {
    position: relative;
    padding: 1.5rem 0;
    margin: 1.5rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--light);
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--white);
    box-shadow: 0 0 0 3px var(--light);
}

.timeline-item.completed::before {
    background: #2ecc71;
}

.timeline-time {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.timeline-event {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Loading Animation */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Real-time indicator */
.realtime-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(46, 204, 113, 0.3);
    white-space: nowrap;
}

.realtime-indicator i.fa-circle {
    font-size: 0.6rem;
    animation: pulse-dot 1.5s infinite;
}

.realtime-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
    display: none;
    /* Using icon instead */
}

/* Live update animation */
@keyframes liveUpdate {
    0% {
        background-color: rgba(46, 204, 113, 0.05);
    }

    50% {
        background-color: rgba(46, 204, 113, 0.15);
    }

    100% {
        background-color: rgba(46, 204, 113, 0.05);
    }
}

.flight-card.updating {
    animation: liveUpdate 0.3s ease;
}

.flight-card.updating .progress-percent,
.flight-card.updating .remaining-time {
    animation: valueUpdate 0.3s ease;
}

@keyframes valueUpdate {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        color: var(--primary-dark);
    }
}

/* Enhanced progress bar with animation */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2.5s infinite;
}

.progress-bar.updating::before {
    animation: shimmer 1s infinite;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Enhanced map controls */
.map-controls .btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.map-controls .btn:hover {
    transform: scale(1.05);
}

.map-controls .btn:active {
    transform: scale(0.95);
}

.map-controls .btn i {
    transition: transform 0.3s ease;
}

.map-controls .btn:hover i {
    transform: rotate(180deg);
}

/* Flight card hover effects */
.flight-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flight-card:hover {
    transform: translateX(5px) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Status badge pulse for in-flight */
.status-in-flight {
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(46, 204, 113, 0);
    }
}

/* Responsive Design */
@media (max-width: 991.98px) {

    .flight-list-container,
    .map-container {
        height: auto;
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }

    .flight-list-container {
        max-height: 400px;
    }

    .map-container {
        height: 400px;
    }

    .flight-details-grid {
        grid-template-columns: 1fr;
    }

    .map-legend {
        flex-direction: column;
        gap: 0.75rem;
    }

    .tracking-hero {
        padding: 140px 0 80px;
        background-attachment: scroll;
    }
}

/* Airport Markers */
.airport-marker {
    background: transparent !important;
    border: none !important;
}

.marker-label {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Progress Markers on Map */
.progress-marker {
    background: transparent;
    border: none;
    text-align: center;
}

.progress-marker-label {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(2, 116, 190, 0.5);
    border: 2px solid white;
    animation: progressMarkerPulse 2s infinite;
    position: relative;
}

.progress-marker-label::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(2, 116, 190, 0.8);
    animation: markerDotPulse 1.5s infinite;
}

@keyframes progressMarkerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 3px 10px rgba(2, 116, 190, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 5px 15px rgba(2, 116, 190, 0.7);
    }
}

@keyframes markerDotPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.7;
    }
}

/* Blinking Marker Effect */
.blinking-marker {
    animation: redBlinkMarker 1.5s infinite;
    filter: drop-shadow(0 0 8px rgba(231, 76, 60, 0.8));
}

@keyframes redBlinkMarker {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(231, 76, 60, 0.8));
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
        filter: drop-shadow(0 0 15px rgba(231, 76, 60, 1));
    }
}

/* Custom Scrollbar */
.flight-list-container::-webkit-scrollbar {
    width: 8px;
}

.flight-list-container::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 10px;
}

.flight-list-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.flight-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}