/* Add Google font for NASA-like look */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&display=swap');

html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

body {
  font-family: system-ui, sans-serif;
  text-align: center;
  background: #000d24;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  margin: 0;
}

/* ================================================
   NAVIGATION BAR
   ================================================ */

.nav-bar {
  background-color: #00112b;
  padding: 0.7rem 1rem;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 1px solid #0a3872;
  z-index: 500;
}

.title {
  color: white;
  font-weight: 500;
  margin-right: 1rem;
}

#status-indicator {
  font-size: 0.8rem;
  animation: blink 1s infinite;
  margin-left: 10px;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

.back-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.back-link:hover {
  color: #3498db;
}

/* ================================================
   INFO HEADER
   ================================================ */

.info-header {
  background-color: rgba(0, 13, 36, 0.95);
  color: #fff;
  padding: 0.5rem 0;
  border-bottom: 1px solid #0e4686;
  flex-shrink: 0;
  width: 100%;
  z-index: 500;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.info-header h1 {
  margin: 0.2rem 0 0.5rem;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 500;
}

.orbital-data {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  font-family: 'Roboto Mono', monospace, system-ui;
}

.data-group {
  padding: 0 0.8rem;
  min-width: 90px;
  text-align: center;
}

.data-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #7fb1ff;
  letter-spacing: 0.05rem;
}

.data-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 0 10px rgba(72, 169, 255, 0.4);
}

/* Location display - special styling */
.location-group {
  min-width: 140px;
  max-width: 200px;
}

.location-value {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================================
   LEAFLET MAP CONTAINER
   ================================================ */

#map-container {
  flex: 1;
  width: 100%;
  z-index: 1;
}

/* Leaflet overrides for dark theme */
.leaflet-container {
  background: #000d24;
  font-family: 'Roboto Mono', monospace;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
}

.leaflet-control-zoom a {
  background-color: rgba(0, 17, 43, 0.9) !important;
  color: #7fb1ff !important;
  border: 1px solid #1e5799 !important;
}

.leaflet-control-zoom a:hover {
  background-color: rgba(10, 56, 114, 0.9) !important;
  color: #fff !important;
}

.leaflet-control-attribution {
  background: rgba(0, 13, 36, 0.8) !important;
  color: #7fb1ff !important;
  font-size: 10px !important;
}

.leaflet-control-attribution a {
  color: #48a9ff !important;
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
  background: rgba(0, 17, 43, 0.95);
  color: #fff;
  border: 1px solid #1e5799;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 60, 120, 0.4);
}

.leaflet-popup-content {
  margin: 12px 16px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.leaflet-popup-tip {
  background: rgba(0, 17, 43, 0.95);
  border: 1px solid #1e5799;
}

.leaflet-popup-close-button {
  color: #7fb1ff !important;
}

.leaflet-popup-close-button:hover {
  color: #ff6b35 !important;
}

/* ================================================
   ISS MARKER STYLING
   ================================================ */

.iss-marker {
  background: transparent;
}

.iss-marker-inner {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 0, 0.8);
  box-shadow: 0 0 20px rgba(255, 255, 0, 0.6), 0 0 40px rgba(255, 255, 0, 0.3);
  animation: iss-pulse 2s ease-in-out infinite;
}

.iss-marker-inner img {
  width: 35px;
  height: 35px;
  filter: brightness(1.3) drop-shadow(0 0 3px rgba(255, 255, 255, 0.8));
}

@keyframes iss-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.6), 0 0 40px rgba(255, 255, 0, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.8), 0 0 60px rgba(255, 255, 0, 0.4);
    transform: scale(1.05);
  }
}

/* Orbit path styling */
.orbit-path-line {
  filter: drop-shadow(0 0 3px #ff9500);
}

/* ================================================
   CREW PANEL STYLES
   ================================================ */

.crew-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a3872 0%, #00112b 100%);
  border: 2px solid #1e5799;
  color: #7fb1ff;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 60, 120, 0.5), 0 0 15px rgba(72, 169, 255, 0.3);
  transition: all 0.3s ease;
}

.crew-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 60, 120, 0.7), 0 0 20px rgba(72, 169, 255, 0.5);
  color: #fff;
}

.crew-toggle .crew-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff6b35;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto Mono', monospace;
}

.crew-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 350px;
  height: 100vh;
  background: linear-gradient(180deg, rgba(0, 17, 43, 0.98) 0%, rgba(0, 13, 36, 0.98) 100%);
  border-left: 1px solid #0e4686;
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
}

.crew-panel.open {
  right: 0;
}

.crew-panel-header {
  padding: 1rem 1.2rem;
  background: rgba(10, 56, 114, 0.5);
  border-bottom: 1px solid #0e4686;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crew-panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.crew-panel-header h2 i {
  color: #7fb1ff;
}

.crew-close {
  background: transparent;
  border: none;
  color: #7fb1ff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem;
  transition: color 0.2s ease;
}

.crew-close:hover {
  color: #ff6b35;
}

.crew-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.crew-loading {
  text-align: center;
  color: #7fb1ff;
  padding: 2rem;
  font-family: 'Roboto Mono', monospace;
}

.crew-loading i {
  margin-right: 0.5rem;
}

.crew-member {
  background: rgba(14, 70, 134, 0.2);
  border: 1px solid rgba(30, 87, 153, 0.5);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.8rem;
  transition: all 0.2s ease;
}

.crew-member:hover {
  background: rgba(14, 70, 134, 0.35);
  border-color: #1e5799;
  transform: translateX(-3px);
}

.crew-member-header {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.crew-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a3872 0%, #1e5799 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7fb1ff;
  font-size: 1.2rem;
  border: 2px solid #1e5799;
  flex-shrink: 0;
  overflow: hidden;
}

.crew-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crew-member-info {
  flex: 1;
  min-width: 0;
}

.crew-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  margin: 0 0 0.15rem 0;
  line-height: 1.2;
}

.crew-position {
  font-size: 0.75rem;
  color: #48a9ff;
  margin-bottom: 0.3rem;
}

.crew-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.crew-country {
  font-size: 0.7rem;
  color: #a0c4ff;
}

.crew-agency {
  font-size: 0.65rem;
  color: #7fb1ff;
  background: rgba(30, 87, 153, 0.4);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: 'Roboto Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.03rem;
}

.crew-details {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(30, 87, 153, 0.3);
}

.crew-details:empty {
  display: none;
}

.crew-stat {
  font-size: 0.72rem;
  color: #7fb1ff;
  margin-bottom: 0.3rem;
  font-family: 'Roboto Mono', monospace;
}

.crew-stat i {
  width: 14px;
  margin-right: 0.4rem;
  color: #48a9ff;
}

.crew-social {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.6rem;
}

.crew-social a {
  color: #7fb1ff;
  font-size: 0.9rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.crew-social a:hover {
  color: #48a9ff;
  transform: scale(1.15);
}

.crew-panel-footer {
  padding: 0.8rem 1.2rem;
  background: rgba(10, 56, 114, 0.3);
  border-top: 1px solid #0e4686;
  font-size: 0.7rem;
  color: #7fb1ff;
  font-family: 'Roboto Mono', monospace;
  text-align: center;
}

.crew-error {
  text-align: center;
  color: #ff6b6b;
  padding: 2rem 1rem;
}

.crew-error i {
  font-size: 2rem;
  margin-bottom: 0.8rem;
  display: block;
}

.crew-error p {
  margin: 0;
  font-size: 0.85rem;
}

.crew-section-divider {
  font-size: 0.7rem;
  color: #7fb1ff;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  font-family: 'Roboto Mono', monospace;
  padding: 0.8rem 0 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(30, 87, 153, 0.3);
}

.crew-list::-webkit-scrollbar {
  width: 6px;
}

.crew-list::-webkit-scrollbar-track {
  background: rgba(0, 13, 36, 0.5);
}

.crew-list::-webkit-scrollbar-thumb {
  background: #1e5799;
  border-radius: 3px;
}

.crew-list::-webkit-scrollbar-thumb:hover {
  background: #2d7bd9;
}

/* ================================================
   LIVE FEED PANEL STYLES
   ================================================ */

.livefeed-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b0000 0%, #4a0000 100%);
  border: 2px solid #cc3333;
  color: #ffaaaa;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(139, 0, 0, 0.5), 0 0 15px rgba(255, 100, 100, 0.3);
  transition: all 0.3s ease;
}

.livefeed-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(139, 0, 0, 0.7), 0 0 20px rgba(255, 100, 100, 0.5);
  color: #fff;
}

.livefeed-panel {
  position: fixed;
  top: 0;
  left: -420px;
  width: 400px;
  height: 100vh;
  background: linear-gradient(180deg, rgba(0, 17, 43, 0.98) 0%, rgba(0, 13, 36, 0.98) 100%);
  border-right: 1px solid #0e4686;
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
}

.livefeed-panel.open {
  left: 0;
}

.livefeed-panel-header {
  padding: 1rem 1.2rem;
  background: rgba(139, 0, 0, 0.3);
  border-bottom: 1px solid #0e4686;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.livefeed-panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.livefeed-panel-header h2 i {
  color: #ff6b6b;
}

.livefeed-close {
  background: transparent;
  border: none;
  color: #7fb1ff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem;
  transition: color 0.2s ease;
}

.livefeed-close:hover {
  color: #ff6b35;
}

.livefeed-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow: hidden;
}

.livefeed-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #1e5799;
}

.livefeed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.livefeed-info {
  margin-top: 1rem;
  padding: 0.8rem;
  background: rgba(14, 70, 134, 0.2);
  border-radius: 6px;
  border: 1px solid rgba(30, 87, 153, 0.3);
}

.livefeed-info p {
  margin: 0;
  font-size: 0.75rem;
  color: #7fb1ff;
  line-height: 1.5;
}

.livefeed-info i {
  color: #48a9ff;
  margin-right: 0.4rem;
}

.livefeed-links {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.livefeed-links-label {
  color: #7fb1ff;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.livefeed-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, rgba(14, 70, 134, 0.4) 0%, rgba(10, 56, 114, 0.4) 100%);
  border-radius: 6px;
  border: 1px solid rgba(30, 87, 153, 0.5);
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

.livefeed-link-btn:hover {
  background: linear-gradient(135deg, rgba(14, 70, 134, 0.6) 0%, rgba(10, 56, 114, 0.6) 100%);
  border-color: #1e5799;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 60, 120, 0.3);
}

.livefeed-link-btn i {
  font-size: 1rem;
  color: #48a9ff;
}

.livefeed-link-btn:hover i {
  color: #7fb1ff;
}

.livefeed-panel-footer {
  padding: 0.8rem 1.2rem;
  background: rgba(10, 56, 114, 0.3);
  border-top: 1px solid #0e4686;
  text-align: center;
}

.livefeed-panel-footer a {
  color: #7fb1ff;
  text-decoration: none;
  font-size: 0.8rem;
  font-family: 'Roboto Mono', monospace;
  transition: color 0.2s ease;
}

.livefeed-panel-footer a:hover {
  color: #48a9ff;
}

.livefeed-panel-footer a i {
  margin-right: 0.4rem;
}

/* ================================================
   MOBILE RESPONSIVE
   ================================================ */

@media screen and (max-width: 768px) {
  .orbital-data {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .data-group {
    padding: 0.2rem 0.4rem;
    min-width: 70px;
  }

  .info-header h1 {
    font-size: 0.9rem;
  }

  .location-group {
    width: 100%;
    min-width: auto;
    max-width: none;
  }

  .crew-panel {
    width: 100%;
    right: -100%;
  }

  .crew-toggle {
    bottom: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
  }

  .livefeed-panel {
    width: 100%;
    left: -100%;
  }

  .livefeed-toggle {
    bottom: 15px;
    left: 15px;
    width: 50px;
    height: 50px;
  }
}
