/* === AstroZoom Styles === */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-deep: #0a0e1a;
  --bg-panel: rgba(15, 20, 40, 0.92);
  --accent: #f0c040;
  --accent-soft: #f5d870;
  --text: #e8e4f0;
  --text-dim: #9090b0;
  --blue: #4080d0;
  --purple: #7050b0;
  --warm-glow: rgba(255, 180, 80, 0.06);
  --panel-border: rgba(240, 192, 64, 0.15);
  --radius: 12px;
  --font-body: 'Outfit', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#app-container {
  width: 100%; height: 100%;
  position: relative;
}

/* === Canvas === */
#universe-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  cursor: grab;
}
#universe-canvas:active { cursor: grabbing; }

/* === Header === */
#header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.95) 0%, rgba(10, 14, 26, 0.7) 70%, transparent 100%);
  pointer-events: none;
}
#header > * { pointer-events: auto; }

.header-left {
  display: flex; align-items: center; gap: 8px;
}
.logo { font-size: 24px; }
.title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #ff9040);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle {
  font-size: 11px; color: var(--text-dim);
  background: rgba(112, 80, 176, 0.3);
  padding: 2px 8px; border-radius: 10px;
  font-weight: 500;
}

.header-center { flex: 1; display: flex; justify-content: center; }
.scale-badge {
  background: rgba(240, 192, 64, 0.1);
  border: 1px solid rgba(240, 192, 64, 0.25);
  padding: 4px 16px; border-radius: 20px;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  color: var(--accent-soft);
  white-space: nowrap;
  min-width: 140px; text-align: center;
}

.header-right { display: flex; gap: 6px; }
.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  width: 36px; height: 36px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover {
  background: rgba(240, 192, 64, 0.15);
  border-color: rgba(240, 192, 64, 0.3);
}

/* === Tab Bar === */
#tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  gap: 2px;
  padding: 6px 8px 10px;
  background: linear-gradient(0deg, rgba(10, 14, 26, 0.95) 0%, rgba(10, 14, 26, 0.7) 70%, transparent 100%);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#tab-bar::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}
.tab:hover {
  background: rgba(240, 192, 64, 0.08);
  color: var(--text);
}
.tab.active {
  background: linear-gradient(135deg, rgba(240, 192, 64, 0.2), rgba(112, 80, 176, 0.2));
  border-color: rgba(240, 192, 64, 0.3);
  color: var(--accent-soft);
  font-weight: 600;
}

/* === Navigation Arrows === */
.nav-arrow {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  z-index: 50;
  background: rgba(15, 20, 40, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 8px;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  transition: all 0.25s;
  color: var(--text-dim);
}
.nav-arrow:hover {
  background: rgba(240, 192, 64, 0.12);
  border-color: rgba(240, 192, 64, 0.4);
  color: var(--accent-soft);
}
.nav-left { left: 8px; }
.nav-right { right: 8px; }
.arrow-icon {
  font-size: 28px; font-weight: 300;
  font-family: var(--font-display);
  line-height: 1;
}
.arrow-label {
  font-size: 9px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === Info Panel === */
#info-panel {
  position: fixed;
  top: 60px; right: 12px;
  width: 340px; max-height: calc(100vh - 130px);
  z-index: 200;
  background: var(--bg-panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow-y: auto;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.info-header {
  display: flex; justify-content: space-between;
  align-items: center;
  padding: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.info-header h2 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--accent-soft);
}
.close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none; color: var(--text-dim);
  width: 28px; height: 28px; border-radius: 6px;
  cursor: pointer; font-size: 14px;
  transition: all 0.2s;
}
.close-btn:hover {
  background: rgba(255, 80, 80, 0.2);
  color: #ff8080;
}

#info-image-container {
  padding: 0 16px;
}
#info-image-container img {
  width: 100%; border-radius: 8px;
  margin-top: 12px;
}

#info-stats {
  padding: 12px 16px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 8px 10px; border-radius: 8px;
}
.stat-label {
  font-size: 10px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
  color: var(--text);
}

#info-description {
  padding: 12px 16px 16px;
  font-size: 13px; line-height: 1.6;
  color: var(--text-dim);
}

/* === Credits & Help Panels === */
#credits-panel, #help-panel {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.credits-content, .help-content {
  background: var(--bg-panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px; width: 90%;
  text-align: center;
}
.credits-content h2, .help-content h2 {
  font-family: var(--font-display);
  font-size: 22px; margin-bottom: 16px;
  color: var(--accent-soft);
}
.credit-main {
  font-size: 18px; margin-bottom: 6px;
}
.credit-main strong {
  color: var(--accent);
}
.credit-org {
  font-size: 14px; color: var(--text-dim);
  margin-bottom: 16px;
}
.credit-org strong { color: var(--blue); }
.credits-content hr, .help-content hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 16px 0;
}
.credit-note {
  font-size: 12px; color: var(--text-dim);
  margin-bottom: 6px;
}
.credit-tech {
  font-size: 11px; color: var(--purple);
  margin-top: 8px;
}

.btn-close-panel {
  margin-top: 20px;
  background: linear-gradient(135deg, var(--accent), #ff9040);
  border: none; color: #1a1a2e;
  padding: 10px 32px; border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-close-panel:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(240, 192, 64, 0.3);
}

.help-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
  font-size: 14px; color: var(--text-dim);
  text-align: left;
}
.help-item span:first-child {
  min-width: 50px; text-align: center;
  font-size: 16px;
}

/* === Loading Screen === */
#loading-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 500;
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s;
}
#loading-screen.fade-out {
  opacity: 0; pointer-events: none;
}
.loader { text-align: center; }
.loader-ring {
  width: 50px; height: 50px;
  border: 3px solid rgba(240, 192, 64, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text {
  font-family: var(--font-display);
  font-size: 16px; color: var(--text-dim);
}

/* === Utility === */
.hidden { display: none !important; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(240, 192, 64, 0.2);
  border-radius: 4px;
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
  .title { font-size: 16px; }
  .subtitle { display: none; }
  .scale-badge { font-size: 12px; min-width: 100px; padding: 3px 10px; }
  .icon-btn { width: 32px; height: 32px; font-size: 14px; }
  
  .tab { font-size: 11px; padding: 5px 8px; }
  
  .nav-arrow { padding: 8px 5px; }
  .arrow-icon { font-size: 22px; }
  .arrow-label { font-size: 8px; }
  
  #info-panel {
    top: auto; bottom: 60px;
    right: 8px; left: 8px;
    width: auto; max-height: 55vh;
  }
}

@media (max-width: 480px) {
  .header-center { display: none; }
  .logo { font-size: 20px; }
  .title { font-size: 14px; }
}
