/* =========================================================================
   Site public de suivi de vol - style sombre "espace", propre et moderne.
   ========================================================================= */

:root {
  --accent-color: #00d4ff;
  --bg-void: #05060a;
  --bg-panel: rgba(18, 22, 32, 0.55);
  --text-primary: #f2f5f8;
  --text-secondary: #8b96a5;
  --font-main: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow-x: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* ---------- En-tete ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  flex-shrink: 0;
  z-index: 2;
}

.brand {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.3px;
}

.connection-status {
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.connection-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.connection-status.online {
  color: #4ade80;
}
.connection-status.online::before {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.connection-status.offline {
  color: #f87171;
}
.connection-status.offline::before {
  background: #f87171;
}

/* ---------- Zone principale : panneau gauche / globe / panneau droit ---------- */
.stage {
  flex: none;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr minmax(200px, 320px);
  align-items: center;
  padding: 0 24px 32px;
  gap: 16px;
}

.info-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 26px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  backdrop-filter: blur(14px);
}

.info-left { align-items: flex-start; }
.info-right { align-items: flex-end; text-align: right; }

.info-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.info-right .info-block {
  align-items: flex-end;
}

.info-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.info-value {
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.info-value.big {
  font-size: 1.8rem;
  font-weight: 800;
}

.info-value.small {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.info-value.route {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  color: var(--accent-color);
}

.route .arrow {
  color: var(--text-secondary);
  font-size: 1rem;
}

.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: rgba(255, 255, 255, 0.07);
  width: fit-content;
}

.phase-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.progress-track {
  position: relative;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  margin-top: 4px;
}

.progress-fill {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-color) 55%, white), var(--accent-color));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Zone du globe ---------- */
.globe-stage {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#globeCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#globeCanvas:active {
  cursor: grabbing;
}

.no-flight-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  gap: 4px;
}

.no-flight-overlay p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.no-flight-overlay p.subtle {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.no-flight-overlay.hidden {
  display: none;
}

/* ---------- Carte "Regarder en direct sur TikTok" ---------- */
.tiktok-section {
  display: flex;
  justify-content: center;
  padding: 28px 24px 48px;
}

.tiktok-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 640px;
  padding: 22px 28px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  transition: border-color 0.3s ease;
}

.tiktok-card.live {
  border-color: rgba(248, 113, 113, 0.5);
}

.tiktok-card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tiktok-title {
  font-size: 1rem;
  font-weight: 700;
}

.tiktok-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.tiktok-card.live .tiktok-status {
  color: #f87171;
  font-weight: 600;
}

.tiktok-button {
  flex-shrink: 0;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--accent-color);
  color: #05060a;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.tiktok-button:hover {
  transform: scale(1.04);
  opacity: 0.92;
}

/* ---------- Adaptation mobile : panneaux au-dessus/en-dessous du globe ---------- */
@media (max-width: 900px) {
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .info-panel {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
  .info-left, .info-right {
    align-items: flex-start;
    text-align: left;
  }
  .info-right .info-block {
    align-items: flex-start;
  }
  .tiktok-card {
    flex-direction: column;
    text-align: center;
  }
}
