/* ============================================================
   ASTROZOOM - Cosmic Scale Explorer Styles
   Indian Synergy of Astronomy & Astrophysics Clubs (ISAAC)
   ============================================================ */

:root {
  --bg-deep: #030810;
  --bg-panel: rgba(8, 15, 30, 0.92);
  --bg-card: rgba(15, 25, 50, 0.85);
  --accent-primary: #4fc3f7;
  --accent-secondary: #7c4dff;
  --accent-glow: rgba(79, 195, 247, 0.3);
  --text-primary: #e8eaf6;
  --text-secondary: #90a4ae;
  --text-dim: #546e7a;
  --border-subtle: rgba(79, 195, 247, 0.15);
  --border-active: rgba(79, 195, 247, 0.5);
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

#app { width: 100%; height: 100%; position: relative; overflow: hidden; }

/* Canvas */
#mainCanvas {
  position: fixed; top: 0; left: 0; z-index: 10;
  cursor: grab; touch-action: none;
}
#mainCanvas:active { cursor: grabbing; }

/* Stars */
.stars-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.stars-bg canvas { width: 100%; height: 100%; }

/* Header */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: linear-gradient(180deg, rgba(3,8,16,0.95) 0%, rgba(3,8,16,0.7) 70%, transparent 100%);
  padding: 10px 16px 20px; pointer-events: none;
}
.header-content { display: flex; align-items: center; justify-content: space-between; pointer-events: auto; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.logo-text { font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: 2px; color: var(--text-primary); }
.logo-subtitle { font-family: var(--font-body); font-size: 9px; color: var(--text-secondary); letter-spacing: 1px; margin-top: 1px; }
.header-controls { display: flex; align-items: center; gap: 8px; }
.btn-icon {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-subtle);
  background: var(--bg-panel); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s ease; font-size: 14px;
}
.btn-icon:hover { border-color: var(--accent-primary); color: var(--accent-primary); box-shadow: 0 0 15px var(--accent-glow); }

/* Tabs */
.tabs-container {
  position: fixed; top: 56px; left: 0; right: 0; z-index: 90;
  background: linear-gradient(180deg, rgba(3,8,16,0.9) 0%, transparent 100%);
  padding: 0 8px 14px; pointer-events: none;
}
.tabs-scroll {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  -ms-overflow-style: none; padding: 4px 0; pointer-events: auto;
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border-subtle); background: var(--bg-panel);
  color: var(--text-secondary); font-family: var(--font-body);
  font-size: 11px; font-weight: 500; cursor: pointer;
  transition: all 0.3s ease; white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
}
.tab-btn i { font-size: 10px; }
.tab-btn:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.tab-btn.active {
  background: linear-gradient(135deg, rgba(79,195,247,0.2), rgba(124,77,255,0.2));
  border-color: var(--accent-primary); color: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-glow);
}
.tab-count { font-size: 9px; background: rgba(79,195,247,0.15); padding: 1px 5px; border-radius: 8px; color: var(--accent-primary); }

/* Scale Bar */
.scale-bar {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none;
}
.scale-bar-line {
  width: 120px; height: 2px; background: var(--accent-primary); position: relative;
  box-shadow: 0 0 10px var(--accent-glow);
}
.scale-bar-line::before, .scale-bar-line::after {
  content: ''; position: absolute; top: -4px; width: 2px; height: 10px; background: var(--accent-primary);
}
.scale-bar-line::before { left: 0; }
.scale-bar-line::after { right: 0; }
.scale-bar-text { font-family: var(--font-mono); font-size: 11px; color: var(--accent-primary); text-shadow: 0 0 10px var(--accent-glow); }

/* Zoom */
.zoom-indicator {
  position: fixed; right: 16px; top: 50%; transform: translateY(-50%);
  z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.zoom-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-subtle);
  background: var(--bg-panel); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; transition: all 0.3s ease;
}
.zoom-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); box-shadow: 0 0 15px var(--accent-glow); }
.zoom-track { width: 4px; height: 150px; background: rgba(79,195,247,0.1); border-radius: 2px; position: relative; }
.zoom-thumb {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-primary); left: 50%; transform: translateX(-50%);
  box-shadow: 0 0 10px var(--accent-glow); transition: top 0.2s ease;
}
.zoom-level-text { font-family: var(--font-mono); font-size: 8px; color: var(--text-dim); text-align: center; max-width: 60px; word-break: break-all; }

/* Nav */
.nav-arrows {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 80; display: flex; align-items: center; gap: 12px;
}
.nav-btn {
  display: flex; align-items: center; gap: 6px; padding: 10px 18px;
  border-radius: 25px; border: 1px solid var(--border-subtle);
  background: var(--bg-panel); color: var(--text-secondary);
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.3s ease; backdrop-filter: blur(10px);
}
.nav-btn:hover:not(:disabled) { border-color: var(--accent-primary); color: var(--accent-primary); box-shadow: 0 0 20px var(--accent-glow); }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.nav-btn i { font-size: 14px; }
.nav-current {
  font-family: var(--font-display); font-size: 11px; color: var(--accent-primary);
  max-width: 150px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 6px 12px; background: var(--bg-panel); border-radius: 15px;
  border: 1px solid var(--border-subtle); backdrop-filter: blur(10px);
}

/* Info Panel */
.info-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(5px);
  display: none; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease;
}
.info-overlay.visible { display: flex; opacity: 1; }
.info-panel {
  width: 90%; max-width: 520px; max-height: 80vh;
  background: var(--bg-panel); border: 1px solid var(--border-subtle);
  border-radius: 20px; overflow: hidden;
  transform: translateY(20px); transition: transform 0.3s ease; backdrop-filter: blur(20px);
}
.info-overlay.visible .info-panel { transform: translateY(0); }
.info-panel-header {
  padding: 20px 20px 16px;
  background: linear-gradient(135deg, rgba(79,195,247,0.1), rgba(124,77,255,0.1));
  border-bottom: 1px solid var(--border-subtle);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.info-panel-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text-primary); letter-spacing: 1px; }
.info-panel-category { font-size: 11px; color: var(--accent-primary); margin-top: 4px; }
.info-close {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-subtle);
  background: transparent; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; transition: all 0.3s ease; flex-shrink: 0;
}
.info-close:hover { border-color: #ef5350; color: #ef5350; }
.info-panel-body { padding: 16px 20px 20px; overflow-y: auto; max-height: calc(80vh - 80px); }
.info-image-container {
  width: 100%; height: 200px; border-radius: 12px; overflow: hidden;
  margin-bottom: 16px; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center;
}
.info-image-container img { width: 100%; height: 100%; object-fit: cover; }
.info-description { font-size: 13px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 16px; }
.info-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.info-detail-item { padding: 10px; background: rgba(0,0,0,0.2); border-radius: 10px; border: 1px solid rgba(79,195,247,0.08); }
.info-detail-label { font-size: 9px; text-transform: uppercase; color: var(--text-dim); letter-spacing: 1px; margin-bottom: 3px; }
.info-detail-value { font-size: 12px; color: var(--text-primary); font-weight: 500; }
.info-full-text { font-size: 13px; line-height: 1.7; color: var(--text-secondary); padding: 14px; background: rgba(0,0,0,0.15); border-radius: 10px; border-left: 3px solid var(--accent-primary); }
.info-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.info-tab {
  flex: 1; padding: 8px; border-radius: 10px; border: 1px solid var(--border-subtle);
  background: transparent; color: var(--text-secondary); font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all 0.3s ease; text-align: center;
}
.info-tab.active { background: rgba(79,195,247,0.15); border-color: var(--accent-primary); color: var(--accent-primary); }

/* Credits */
.credits-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 300;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
  display: none; justify-content: center; align-items: center;
}
.credits-overlay.visible { display: flex; }
.credits-panel {
  width: 90%; max-width: 440px; background: var(--bg-panel);
  border: 1px solid var(--border-subtle); border-radius: 20px; padding: 30px; text-align: center;
}
.credits-title { font-family: var(--font-display); font-size: 20px; color: var(--accent-primary); margin-bottom: 20px; }
.credits-item { margin-bottom: 14px; }
.credits-role { font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: var(--text-dim); margin-bottom: 4px; }
.credits-name { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.credits-org { font-family: var(--font-display); font-size: 12px; color: var(--accent-secondary); letter-spacing: 1px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.credits-note { font-size: 10px; color: var(--text-dim); margin-top: 12px; line-height: 1.5; }
.credits-close {
  margin-top: 20px; padding: 8px 24px; border-radius: 20px; border: 1px solid var(--border-subtle);
  background: transparent; color: var(--text-secondary); cursor: pointer; transition: all 0.3s ease; font-size: 12px;
}
.credits-close:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* Loading */
.loading-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;
  background: var(--bg-deep); display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.8s ease;
}
.loading-screen.hidden { opacity: 0; pointer-events: none; }
.loading-logo {
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 8px; letter-spacing: 3px;
}
.loading-sub { font-size: 11px; color: var(--text-secondary); letter-spacing: 2px; margin-bottom: 30px; }
.loading-bar { width: 200px; height: 2px; background: rgba(79,195,247,0.1); border-radius: 1px; overflow: hidden; }
.loading-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); transition: width 0.3s ease; border-radius: 1px; }
.loading-text { margin-top: 12px; font-size: 10px; color: var(--text-dim); letter-spacing: 1px; }

/* Search */
.search-container { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 95; width: 90%; max-width: 400px; display: none; }
.search-container.visible { display: block; }
.search-input {
  width: 100%; padding: 10px 16px 10px 40px; border-radius: 25px;
  border: 1px solid var(--border-subtle); background: var(--bg-panel);
  color: var(--text-primary); font-family: var(--font-body); font-size: 13px; outline: none;
  backdrop-filter: blur(10px);
}
.search-input:focus { border-color: var(--accent-primary); box-shadow: 0 0 20px var(--accent-glow); }
.search-icon { position: absolute; left: 14px; top: 12px; color: var(--text-dim); font-size: 14px; z-index: 1; }
.search-results {
  margin-top: 6px; background: var(--bg-panel); border: 1px solid var(--border-subtle);
  border-radius: 15px; max-height: 300px; overflow-y: auto; backdrop-filter: blur(10px);
}
.search-result-item { padding: 10px 16px; cursor: pointer; transition: background 0.2s ease; border-bottom: 1px solid rgba(79,195,247,0.05); }
.search-result-item:hover { background: rgba(79,195,247,0.08); }
.search-result-item:last-child { border-bottom: none; }
.search-result-name { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.search-result-cat { font-size: 10px; color: var(--text-dim); }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(79,195,247,0.2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(79,195,247,0.4); }

/* Responsive */
@media (max-width: 768px) {
  .logo-text { font-size: 12px; letter-spacing: 1px; }
  .logo-subtitle { font-size: 8px; }
  .tab-btn { font-size: 10px; padding: 5px 10px; }
  .zoom-indicator { right: 8px; }
  .zoom-track { height: 100px; }
  .nav-btn { padding: 8px 14px; font-size: 11px; }
  .nav-current { font-size: 10px; max-width: 100px; }
  .info-panel { width: 95%; }
  .info-details-grid { grid-template-columns: 1fr; }
  .scale-bar { bottom: 70px; }
}

@media (max-width: 380px) {
  .logo-text { font-size: 10px; }
  .header-controls .btn-icon { width: 32px; height: 32px; font-size: 12px; }
  .nav-btn { padding: 6px 10px; font-size: 10px; }
  .nav-btn span { display: none; }
}
