/**
 * Live Flights Map Styles
 * Custom CSS for Leaflet map visualization and flights table
 */

.live-flights-map
{
  border-radius: 15px;
}

/* Leaflet Map Controls */
.leaflet-control {
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.leaflet-control-zoom {
  background: white;
  display: none;
}

/* Fullscreen Control */
.leaflet-control-fullscreen {
  background: white;
  border-radius: 4px;
}

.leaflet-control-fullscreen-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 5px;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
  box-sizing: border-box;
}

.leaflet-control-fullscreen-button:hover {
  background: #f4f4f4;
}

.fullscreen-icon {
  display: block;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  color: #333;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

/* Fullscreen mode - ensure button stays sized */
:fullscreen .leaflet-control-fullscreen-button,
:-webkit-full-screen .leaflet-control-fullscreen-button,
:-moz-full-screen .leaflet-control-fullscreen-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 5px;
  box-sizing: border-box;
}

:fullscreen .fullscreen-icon,
:-webkit-full-screen .fullscreen-icon,
:-moz-full-screen .fullscreen-icon {
  display: block !important;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
}

/* Fullscreen mode adjustments */
:fullscreen .live-flights-map {
  border-radius: 0;
}

:-webkit-full-screen .live-flights-map {
  border-radius: 0;
}

:-moz-full-screen .live-flights-map {
  border-radius: 0;
}

/* Airplane Icon Marker */
.airplane-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.1s ease;
}

.airplane-icon:hover {
  transform: scale(0.9);
}

/* Leaflet Popup */
.leaflet-popup-content-wrapper {
  background: white;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
  margin: 0;
  padding: 0;
  font-size: 14px;
  color: #1f2937;
}

.leaflet-popup-tip-container {
  display: none;
}

.leaflet-popup-close-button {
  top: 8px;
  right: 8px;
  color: #6b7280;
  font-size: 20px;
  padding: 0;
}

/* Live Flights Table Section */
.live-flights-table-section {
  margin-top: 2rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.live-flights-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  padding-left: 0px;
}

.flights-search-wrapper {
  flex: 1;
  min-width: 250px;
  max-width: 400px;
}

.flights-search-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.flights-search-icon {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 20px;
  color: #9ca3af;
  pointer-events: none;
}

.flights-search-input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.flights-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.flights-toggle-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.flights-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.flights-toggle-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.flights-toggle-btn.flights-toggle-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.flights-toggle-btn i {
  font-size: 1rem;
}

.toggle-status {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  min-width: 2rem;
  text-align: center;
}

.flights-toggle-btn.flights-toggle-active .toggle-status {
  background: rgba(255, 255, 255, 0.3);
}

/* Table Container */
.live-flights-table-container {
  overflow-x: auto;
  overflow-y: auto;
}

.live-flights-table {
  /* table-layout: fixed; */
  width: 100%;
}

.live-flights-table th,
.live-flights-table td {
  width: 1%;
  white-space: nowrap;
}



/* Custom flight-specific components */
.flight-row {
  cursor: pointer;
}

.flight-row-selected {
  background: linear-gradient(to bottom, transparent, #e0ecf5) !important;
}

.callsign-container,
.airport-container,
.aircraft-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.flight-number,
.airport-name,
.aircraft-registration,
.ground-speed,
.flight-phase {
  font-size: 0.75rem;
  color: #6b7280;
}

.airport-code,
.aircraft-type,
.altitude {
  font-weight: 600;
  font-size: 0.875rem;
}

.alt-spd-container {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  font-size: 0.875rem;
}

.airline-cell, .network-cell {
  text-align: left;
}

.airline-logo, .network-logo {
  max-height: 36px;
  width: auto;
  display: inline-block;
}

/* Flight Details Expanded Row */
.flight-details-row {
  background-color: #e0ecf5 !important;
}

.flight-details-container {
  padding: 0rem;
  cursor: pointer;
}

.flight-details-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
}

.pilot-section {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.pilot-rank-image {
  height: 36px;
  border-radius: 0px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f3f4f6;
}

.pilot-rank-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pilot-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pilot-rank {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pilot-name {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
}

.stats-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.625rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.stat-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
}

.flight-progress-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #d1d5db;
  position: relative;
}

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

.progress-label {
  font-size: 0.625rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 400;
  position: absolute;
  top:0;
  left:auto;

}

.progress-percentage {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
}

.flight-progress-bar {
  width: 100%;
  height: 16px;
  background-color: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: .3rem;
  margin-top: .2rem;

}

.flight-progress-fill {
  height: 100%;
  background: linear-gradient(to right, #3b82f6, #1d4ed8);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.flight-remarks {
  padding-top: 1rem;
  border-top: 0px solid #d1d5db;
  font-size: 0.875rem;
  color: #374151;
}

.flight-remarks strong {
  font-weight: 600;
}

.no-flights-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: #d1d5db;
}

/* No flights row */
.no-flights-cell {
  text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .live-flights-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .flights-search-wrapper {
    max-width: 100%;
  }
  
  .flights-toggle-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .live-flights-table-container {
    max-height: 400px;
  }
  
  .flight-details-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stats-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

.uk-label-tour {
    display: inline-block;
    padding: 0 5px;
    line-height: 1.6;
    font-size: 12px;
    color: #fff;
    vertical-align: middle;
    white-space: nowrap;
    font-weight: 600;
    border-radius: 5px;
}