/* ============================================
   FLIGHT-SPECIFIC STYLES
   Specialized styles for flight information
   ============================================ */

/* Flight Input Fields */
#id_zman, #id_stat, #id_mtime, #id_term, #id_yir {
  width: 120px;
  min-width: 80px;
  box-sizing: border-box;
  text-align: center;
}

.flight-info-group {
  display: none;
}

.flight-info-group.show {
  display: block;
}

/* Flexbox layout for flightInfoContainer */
#flightInfoContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
  flex-direction: row;
  justify-content: center;
}

/* Style for the flight number input */
#flightNumber {
  padding: 5px;
  width: 120px;
  font-size: 0.9em;
}

/* Style for cells */
.cell {
  border: 1px solid #ccc;
  padding: 5px;
  min-width: 80px;
  text-align: center;
  font-size: 0.9em;
  display: inline-block;
}

/* Ensure cells and input are visible when needed */
#flightNumber,
#chloc1t,
#CHSTOL,
#chptol,
#chterm,
#chrmine {
  display: none;
}

#flightNumber.show,
#chloc1t.show,
#CHSTOL.show,
#chptol.show,
#chterm.show,
#chrmine.show {
  display: inline-block;
}

/* Label styling */
.flight-info-group label {
  display: block;
  margin-bottom: 5px;
}

/* ============================================
   FLIGHT DROPDOWN
   ============================================ */
.dropdown-container {
  display: none;
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

.dropdown-container.show {
  display: block;
}

.dropdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 5px;
}

.dropdown-item {
  padding: 0.05rem;
  font-size: clamp(1.875rem, 2.5vw, 1rem);
  color: #2d3748;
  cursor: pointer;
  border-radius: 0.375rem;
  border: 1px solid gray;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
}

.dropdown-item:hover {
  background: #C3CEC6;
  color: #ffffff;
  transform: scale(1.03) translateY(-0.125rem);
  border-color: #C3CEC6;
  box-shadow: 0 0.25rem 0.75rem rgba(195, 206, 198, 0.2);
  filter: drop-shadow(0 0 0.25rem #C3CEC6);
}

.dropdown-item:focus, 
.dropdown-item.focused {
  background: #C3CEC6;
  color: #ffffff;
  transform: scale(1.03) translateY(-0.125rem);
  border-color: #C3CEC6;
  box-shadow: 0 0.25rem 0.75rem rgba(195, 206, 198, 0.2);
  filter: drop-shadow(0 0 0.25rem #C3CEC6);
  outline: 2px solid #C3CEC6;
  outline-offset: -2px;
}

.dropdown-item:active {
  background: #d1e7ff;
  transform: translateY(0);
  box-shadow: 0 0.125rem 0.5rem rgba(255, 0, 255, 0.2);
}

/* Flight details */
.flight-date {
  font-size: 0.75rem;
  color: #666;
  display: block;
}

.flight-status {
  font-size: 0.75rem;
  color: #fff;
  background: #28a745;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  display: inline-block;
}

/* ============================================
   FLIGHT STATUS COLORS (Hebrew names preserved)
   ============================================ */

/* Landed - נחתה */
.flight-status.status-נחתה {
  background-color: #2ECC71; /* Green */
  color: #fff;
}

/* On Time - בזמן */
.flight-status.status-בזמן {
  background-color: #3498DB; /* Blue */
  color: #fff;
}

/* Delayed - עיכוב */
.flight-status.status-עיכוב {
  background-color: #F39C12; /* Orange */
  color: #fff;
}

/* Cancelled - מבוטלת */
.flight-status.status-מבוטלת {
  background-color: #E74C3C; /* Red */
  color: #fff;
}

/* Taking Off - בהמראה */
.flight-status.status-בהמראה {
  background-color: #9B59B6; /* Purple */
  color: #fff;
}

/* En Route - בדרך */
.flight-status.status-בדרך {
  background-color: #1ABC9C; /* Teal */
  color: #fff;
}

/* Registered - נרשמה */
.flight-status.status-נרשמה {
  background-color: #7F8C8D; /* Gray */
  color: #fff;
}

/* Not Final - לא-סופי */
.flight-status.status-לא-סופי {
  background-color: #E67E22; /* Amber */
  color: #fff;
}

/* Early - מוקדמה */
.flight-status.status-מוקדמה {
  background-color: #3ed9c9; /* Dark Green */
  color: #fff;
}

/* Under Review - בבדיקה */
.flight-status.status-בבדיקה {
  background-color: #95A5A6; /* Light Gray */
  color: #fff;
}

/* Unknown (fallback for missing CHRMINH) */
.flight-status.status-unknown {
  background-color: #ECF0F1; /* Very Light Gray */
  color: #333;
}

/* ============================================
   LOADING STATE
   ============================================ */
.dropdown-loading {
  padding: 1rem;
  text-align: center;
  color: #636e72;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  animation: pulse 1.5s infinite;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.dropdown-content[aria-hidden="true"] {
  display: none;
}

.dropdown-content[aria-hidden="false"] {
  display: block;
}

#flightDropdown {
  max-width: 600px;
  overflow-y: auto;
  max-height: 400px;
}

/* ============================================
   ENHANCED DROPDOWN CONTAINER
   ============================================ */
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0.625rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
  max-height: 18rem;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 0.25rem;
  animation: dropdownFadeIn 0.3s ease-out;
}

.dropdown-content.show {
  display: block;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   ENHANCED FLIGHT SECTION
   ============================================ */
.enhanced-flight-container {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 2px solid #3b82f6;
  border-radius: 15px;
  padding: 1.5rem;
  margin: 1rem 0;
}

.flight-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.flight-search-main {
  position: relative;
}

.flight-search-group {
  margin-bottom: 0;
}

.flight-search-label {
  font-weight: 700;
  color: #1e40af;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.flight-search-label i {
  margin-left: 0.5rem;
  color: #3b82f6;
}

.flight-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.flight-search-input {
  padding-right: 3rem;
  border: 2px solid #3b82f6;
  border-radius: 10px;
  font-size: 1rem;
  min-width: 300px;
}

.flight-search-input:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.flight-icon {
  position: absolute;
  right: 1rem;
  color: #3b82f6;
  font-size: 1.2rem;
  pointer-events: none;
}

.flight-help-section {
  display: flex;
  align-items: center;
}

.enhanced-help-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid #3b82f6;
  border-radius: 10px;
  text-decoration: none;
  color: #1e40af;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 100px;
  text-align: center;
}

.enhanced-help-link:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

.enhanced-help-link i {
  font-size: 1.5rem;
  color: #3b82f6;
}

.enhanced-help-link span {
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ============================================
   FLIGHT DETAILS GRID
   ============================================ */
.flight-details-grid-inline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem;
}

.flight-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flight-input-group label {
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  margin: 0;
  width: auto;
}

.flight-input-group label i {
  margin-left: 0.5rem;
  color: #3b82f6;
  width: 16px;
  text-align: center;
}

.flight-readonly-input {
  background: #f9fafb !important;
  border-color: #d1d5db;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1f2937;
}

.flight-status-input {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5) !important;
  border-color: #10b981 !important;
  color: #065f46 !important;
  font-weight: 600 !important;
}

.flight-detail-inline label i {
  color: #3b82f6;
  font-size: 0.8rem;
}

.flight-inline-input {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  font-size: 0.85rem;
  text-align: center;
  color: #1f2937;
  font-weight: 500;
  min-width: 80px;
  width: auto;
}

.flight-status-inline {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #10b981;
  color: #065f46;
  font-weight: 600;
  min-width: 100px;
}

.flight-detail-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.flight-detail-card:hover {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.status-card {
  grid-column: 1 / -1;
}

.status-card::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

.flight-detail-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.flight-detail-header i {
  color: #3b82f6;
  font-size: 1rem;
  width: 16px;
  text-align: center;
}

.status-card .flight-detail-header i {
  color: #10b981;
}

.flight-detail-value {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  font-size: 0.9rem;
  text-align: center;
  color: #1f2937;
  font-weight: 500;
}

.flight-status-value {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #10b981;
  color: #065f46;
  font-weight: 600;
}

.enhanced-dropdown {
  top: calc(100% + 5px);
  border: 2px solid #3b82f6;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.2);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .flight-search-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .flight-search-input {
    min-width: 100%;
  }
  
  .enhanced-help-link {
    align-self: center;
    justify-self: center;
  }
  
  .flight-details-grid-inline {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .status-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .flight-details-grid-inline {
    grid-template-columns: 1fr;
  }
  
  .status-card {
    grid-column: 1;
  }
}