@font-face {
  font-family: 'DejaVu Sans Mono';
  src: url('fonts/DejaVuSansMono.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'DejaVu Sans Mono';
  src: url('fonts/DejaVuSansMono-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 20px;
  background-color: #0F140E;
  color: #ffffff;
  /* Application de la nouvelle police avec les anciennes en solution de repli */
  font-family: 'DejaVu Sans Mono', 'Courier New', Courier, monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

h1 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 2rem;
  font-size: 1.8rem;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.app-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.radar-section {
  width: 100%;
  max-width: 550px;
  aspect-ratio: 1 / 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: auto;
}
.radar-section img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: opacity 1s ease-in-out;
}

.flights-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.section-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b9d3b3;
  margin-bottom: 10px;
  border-bottom: 1px dashed #333;
  padding-bottom: 5px;
}

.flight-group {
  display: none;
}

/* =========================================
   SYSTEME DE GRILLES
   ========================================= */
.grid-1 {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 899px) {
  .grid-2 {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* =========================================
   COMPOSANTS STANDARDS (CARTES)
   ========================================= */

/* 1. TICKET (1 à 2 vols) */
.ticket {
  background-color: #141c13;
  border: 1px solid #2a3a28;
  border-left: 5px solid #b9d3b3;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.ticket .main {
  flex: 1 1 300px;
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.ticket .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #222e20;
  padding-bottom: 8px;
}
.ticket .callsign { font-size: 1.3rem; font-weight: bold; color: #ffffff; letter-spacing: 1px; }
.ticket .airline { font-size: 0.85rem; color: #b9d3b3; text-transform: uppercase; }
.ticket .route { font-size: 1rem; color: #e0e0e0; font-weight: bold; margin: 5px 0; display: flex; align-items: center; gap: 8px; }
.ticket .details { display: flex; gap: 20px; font-size: 0.8rem; color: #88a082; flex-wrap: wrap; }
.ticket .details div span { display: block; color: #ffffff; font-size: 0.9rem; margin-top: 2px; }
.ticket .photo { width: 200px; min-height: 100px; background-color: #0b0f0a; border-left: 1px dashed #2a3a28; overflow: hidden; position: relative; }
.ticket .photo img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 899px) { .ticket .photo { width: 100%; min-height: 120px; } }

/* 2. CARD (3 à 4 vols) */
.card {
  background-color: #141c13;
  border: 1px solid #2a3a28;
  border-left: 5px solid #b9d3b3;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.card .main { padding: 8px 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.card .header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #222e20; padding-bottom: 4px; }
.card .callsign { font-size: 1rem; font-weight: bold; color: #ffffff; }
.card .airline { font-size: 0.75rem; color: #b9d3b3; text-transform: uppercase; }
.card .route { font-size: 0.85rem; color: #e0e0e0; font-weight: bold; margin: 2px 0; }
.card .details { display: flex; gap: 10px; font-size: 0.7rem; color: #88a082; flex-wrap: wrap; }
.card .details div span { display: block; color: #ffffff; font-size: 0.75rem; margin-top: 2px; }
.card .photo { width: 100%; height: 100px; background-color: #0b0f0a; border-top: 1px dashed #2a3a28; overflow: hidden; position: relative; }
.card .photo img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* 3. MINI-CARD (Parking ou >4 vols) */
.mini-card {
  background-color: #141c13;
  border: 1px solid #2a3a28;
  border-left: 4px solid #b9d3b3;
  border-radius: 6px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
  position: relative;
}
.mini-card .main { flex: 1; padding: 12px 15px; display: flex; flex-direction: column; justify-content: center; gap: 5px; min-width: 0; }
.mini-card .header { display: flex; flex-direction: row; justify-content: space-between; align-items: center; border-bottom: 1px solid #222e20; padding-bottom: 4px; }
.mini-card .callsign { font-size: 0.95rem; font-weight: bold; color: #ffffff; letter-spacing: 0.5px; }
.mini-card .airline { color: #b9d3b3; font-size: 0.75rem; text-transform: uppercase; text-align: right; }
.mini-card .details { color: #88a082; font-size: 0.75rem; }
.mini-card .route { color: #e0e0e0; font-size: 0.65rem; }
.mini-card .photo { width: 105px; background-color: #0b0f0a; border-left: 1px dashed #2a3a28; overflow: hidden; flex-shrink: 0; position: relative; }
.mini-card .photo img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* 4. NANO-CARD (Vols sans infos / Taxi) */
.nano-card {
  background-color: #111810;
  border: 1px solid #223220;
  border-radius: 6px;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  width: 100%;
}
.nano-card .callsign { font-weight: bold; color: #b9d3b3; font-size: 0.95rem; }
.nano-card .secondary { color: #666; margin-left: 10px; font-size: 0.75rem; }
.nano-card .route { font-size: 0.75rem; color: #b9d3b3; margin-top: 4px; }
.nano-card .info { color: #88a082; display: flex; gap: 15px; font-size: 0.8rem; }

/* =========================================
   PANEL MIXTE
   ========================================= */
.panel-container { display: grid; gap: 5px; grid-template-rows: repeat(4, auto); grid-auto-flow: column; }
@media (max-width: 899px) { .panel-container { grid-template-columns: repeat(1, 1fr); } }
.panel-item { background-color: #0b0f0a; border: 1px solid #1f2d1e; border-radius: 4px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; }
.panel-item .time-block { display: flex; flex-direction: column; min-width: 68px; }
.panel-item .time { font-weight: bold; color: #b9d3b3; }
.panel-item .sub-status { font-size: 0.7rem; color: #aaa; margin-top: 2px; }
.panel-item .flight-info { flex: 1; margin-left: 10px; }
.panel-item .dest { color: #88a082; font-size: 0.75rem; margin-top: 2px; }

.no-flights-msg { display: none; color: #666; font-style: italic; font-size: 0.9rem; text-align: center; padding: 20px 0; }

/* =========================================
   LIGHTBOX
   ========================================= */
.lightbox {
  visibility: hidden;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.active {
  visibility: visible;
  opacity: 1;
}
.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  transition: color 0.2s;
}
.lightbox-close:hover {
  color: #b9d3b3;
}
/* Indiquer que les images sont cliquables */
.ticket .photo img, .card .photo img, .mini-card .photo img {
  cursor: pointer;
}

@media (min-width: 900px) {
  .app-container { flex-direction: row; align-items: center; justify-content: center; }
  .radar-section { flex: 0 0 40%; justify-content: center; align-items: center; margin: auto; }
  .flights-section { flex: 1; }
}