@keyframes rotate-waypoint {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.next-waypoint-marker {
  animation: rotate-waypoint 2s linear infinite;
  filter: drop-shadow(0 0 8px rgba(255, 165, 0, 0.8));
}
    /* Photo Map Markers */
.plane-marker {
  font-size: 24px;
  cursor: pointer;
}

.photo-popup {
  max-width: 300px;
}

.photo-popup img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.photo-popup h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.photo-popup .info {
  font-size: 0.85rem;
  color: #666;
  margin: 0.3rem 0;
}

.photo-popup .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.photo-popup .tag {
  background: #667eea;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
}
/* Aircraft Label Hover Effect */
.leaflet-aircraft-icon .aircraft-tag {
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.leaflet-aircraft-icon:hover .aircraft-tag {
  background-color: rgba(0, 0, 0, 0.8) !important;
}

/* Aircraft Panel Modern Styling */
#aircraftPanel {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#aircraftPanel button {
  transition: all 0.2s ease;
}
/* Photo Map Toggle */
#photoMapToggle {
  position: fixed;
  left: 10px;
  top: 100px;
  background: rgba(102, 126, 234, 0.95);
  color: #fff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 99996;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

#photoMapToggle:hover {
  background: rgba(118, 75, 162, 0.95);
}

#photoMapToggle.active {
  background: rgba(118, 75, 162, 0.95);
}
    /* 側邊照片面板 */
#photoSidebar {
  position: fixed;
  right: -320px;
  top: 0;
  width: 300px;
  height: 100%;
  background: rgba(22, 27, 34, 0.95);
  box-shadow: -2px 0 10px rgba(0,0,0,0.5);
  transition: right 0.3s ease;
  z-index: 99997;
  overflow-y: auto;
  padding: 10px;
}

#photoSidebar.open {
  right: 0;
}

#photoToggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(22, 27, 34, 0.95);
  color: #fff;
  border: none;
  padding: 20px 10px;
  cursor: pointer;
  z-index: 99998;
  border-radius: 6px 0 0 6px;
  font-size: 18px;
  box-shadow: -2px 0 8px rgba(0,0,0,0.4);
}

#photoToggle:hover {
  background: rgba(35, 134, 54, 0.95);
}

.photo-item {
  margin-bottom: 15px;
  background: #0d1117;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.photo-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
}

.photo-item img:hover {
  transform: scale(1.05);
}

.photo-item .caption {
  padding: 8px;
  font-size: 12px;
  color: #e6edf3;
}
/* 新的 Discord 按鈕容器 */
.social-buttons {
  position: fixed;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 10px;
  z-index: 99997; /* z-index 保持不變 */
}

/* 按鈕的通用樣式 (未來可擴充) */
.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

/* Discord 按鈕的專屬顏色 */
.discord-btn {
  background: #5865F2;
  color: white;
}
    .github-ribbon {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 150px;
  height: 150px;
  overflow: hidden;
  z-index: 99998;
  pointer-events: none;
}
.github-ribbon a {
  position: absolute;
  bottom: 35px;
  left: -40px;
  transform: rotate(45deg);
  width: 200px;
  background: #c0392b;
  color: white;
  text-align: center;
  padding: 8px 0;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  pointer-events: auto;
  transition: background 0.3s ease;
}
.github-ribbon a:hover {
  background: #a93226;
}
    html,body,#map { height:100%; margin:0; padding:0; }
    .label {
      font-family: Inter, "Noto Sans TC", Arial, sans-serif;
      font-size: 12px;
      padding: 2px 6px;
      border-radius: 6px;
      background: rgba(0,0,0,0.8);
      color: #fff;
      box-shadow: 0 1px 3px rgba(0,0,0,0.5);
      white-space: nowrap;
      margin-left: 6px;
    }
    .label.emergency {
      background: rgba(139, 0, 0, 0.95);
      animation: pulse 1s ease-in-out infinite;
    }
    @keyframes pulse {
      0%, 100% { box-shadow: 0 1px 3px rgba(0,0,0,0.5); }
      50% { box-shadow: 0 0 15px rgba(255,0,0,0.8); }
    }
    .legend {
      position: absolute;
      left: 10px;
      top: 10px;
      background: rgba(146, 146, 146, 0.9);
      padding:8px 10px;
      border-radius:6px;
      font-size:12px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    }
    .altitude-legend {
      position: absolute;
      left: 10px;
      bottom: 10px;
      background: rgba(146, 146, 146, 0.9);
      padding:8px 10px;
      border-radius:6px;
      font-size:11px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.25);
      min-width: 140px;
    }
    .altitude-legend-item {
      display: flex;
      align-items: center;
      margin: 2px 0;
    }
    .altitude-color-box {
      width: 12px;
      height: 12px;
      margin-right: 6px;
      border-radius: 2px;
    }
    .waypoint-tooltip {
      font-size: 11px !important;
      padding: 3px 6px !important;
      background: rgba(0, 0, 0, 0.85) !important;
      border: 1px solid #ff6600 !important;
      border-radius: 4px !important;
      box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
      font-weight: bold;
      color: #fff !important;
    }
    .waypoint-tooltip::before {
      border-top-color: rgba(0, 0, 0, 0.85) !important;
    }
    .waypoint-marker {
      background: rgba(255, 102, 0, 0.9);
      border: 3px solid #fff;
      border-radius: 50%;
      box-shadow: 0 2px 8px rgba(0,0,0,0.4);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
      color: #fff;
      font-size: 10px;
      text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    }
    .waypoint-passed {
      background: rgba(100, 100, 100, 0.7) !important;
      border-color: #666 !important;
    }
    .waypoint-active {
      background: rgba(0, 255, 0, 0.9) !important;
      border-color: #0f0 !important;
      animation: pulse-active 1.5s ease-in-out infinite;
    }
    @keyframes pulse-active {
      0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(0,255,0,0.4); }
      50% { transform: scale(1.2); box-shadow: 0 2px 15px rgba(0,255,0,0.8); }
    }
    .route-arrow {
      font-size: 16px;
      color: #ff6600;
      text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    }