/* ═══════════════════════════════════════════
   Birth Sky — birth-sky.css  v1.0
   https://extracalc.com
═══════════════════════════════════════════ */
#bs-app {
  --bg:       #020810;
  --bg2:      #070f22;
  --bg3:      #0b1630;
  --border:   rgba(80,120,240,0.18);
  --border2:  rgba(80,120,240,0.30);
  --text:     rgba(210,228,255,0.92);
  --text2:    rgba(140,170,220,0.65);
  --text3:    rgba(90,120,180,0.45);
  --accent:   #4a8fff;
  --accent2:  #1a3a99;
  --green:    #4dca70;
  --red:      #e05c3a;
  --gold:     #ffd166;
  --font:     -apple-system, 'Inter', 'Segoe UI', sans-serif;

  font-family: var(--font);
  background:  var(--bg);
  color:       var(--text);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 700px;
  width: 100%;
  box-shadow: 0 8px 48px rgba(0,0,50,0.6);
}

/* ── Topbar ── */
#bs-topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  flex-shrink: 0;
}
#bs-topbar-inner {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
}
.bs-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  flex-shrink: 0;
  white-space: nowrap;
  margin-bottom: 2px;
}
.bs-logo span { color: var(--accent); }

.bs-field-wrap { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 180px; }
.bs-field-wrap.bs-wide { flex: 2.5; min-width: 260px; }
.bs-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text2); }
.bs-row { display: flex; gap: 6px; }
.bs-hint { font-size: 11px; color: var(--text2); min-height: 14px; margin-top: 2px; }

#bs-app input[type="text"],
#bs-app input[type="datetime-local"] {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
#bs-app input:focus { border-color: var(--accent); }
#bs-app input::placeholder { color: var(--text3); }

.bs-btn-accent, .bs-btn-ghost, .bs-btn-primary {
  border-radius: 8px; border: none; cursor: pointer;
  font-family: var(--font); font-weight: 600;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.bs-btn-accent {
  background: var(--accent); color: #fff;
  font-size: 13px; padding: 8px 14px;
}
.bs-btn-accent:hover { opacity: 0.85; }
.bs-btn-ghost {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border) !important;
  color: var(--text2); font-size: 12px; padding: 8px 10px;
}
.bs-btn-ghost:hover { border-color: var(--accent) !important; color: var(--text); }
.bs-btn-primary {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff; font-size: 14px; padding: 9px 22px;
  box-shadow: 0 2px 16px rgba(74,143,255,0.25);
  align-self: flex-end;
}
.bs-btn-primary:hover { opacity: 0.88; }

/* ── Main 3-col ── */
#bs-main {
  display: grid;
  grid-template-columns: 260px 1fr 240px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 900px) {
  #bs-main { grid-template-columns: 1fr; }
}

.bs-col-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text3);
  padding: 12px 14px 6px;
  border-bottom: 1px solid var(--border);
}

/* ── Globe column ── */
#bs-globe-col {
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  background: var(--bg2);
}
#bs-globe-wrap {
  flex: 1; position: relative;
  cursor: grab; min-height: 280px;
}
#bs-globe-wrap:active { cursor: grabbing; }
#bs-globe-wrap canvas { display: block; }
#bs-globe-hint {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text3); pointer-events: none; white-space: nowrap;
}
#bs-globe-info {
  font-size: 11px; color: var(--text2); padding: 10px 14px;
  border-top: 1px solid var(--border); line-height: 1.7;
  min-height: 58px;
}

/* ── Sky Map column ── */
#bs-map-col {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
#bs-export-root {
  flex: 1; position: relative; min-height: 300px;
  display: flex; align-items: center; justify-content: center;
}
#bs-sky-canvas { display: none; width: 100%; height: 100%; }
#bs-sky-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; height: 100%; width: 100%;
  position: absolute; top:0; left:0;
}
.bs-ph-icon { font-size: 48px; opacity: 0.25; }
.bs-ph-text { font-size: 14px; color: var(--text3); text-align: center; line-height: 1.6; }

/* ── Data column ── */
#bs-data-col {
  background: var(--bg2);
  display: flex; flex-direction: column;
  overflow-y: auto; scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.bs-section {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}
.bs-section-head {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--text3); margin-bottom: 10px;
}

/* Body list */
.bs-body-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 9px;
}
.bs-body-row:last-child { margin-bottom: 0; }
.bs-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bs-body-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3; }
.bs-body-coord { font-size: 10px; color: var(--text2); margin-top: 1px; }
.bs-vis {
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  border-radius: 99px; flex-shrink: 0; margin-left: auto;
}
.bs-vis.up   { background: rgba(40,180,80,0.12);  color: var(--green); }
.bs-vis.down { background: rgba(200,80,60,0.12);  color: var(--red); }

/* Facts */
.bs-fact {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px solid rgba(80,120,220,0.08);
  font-size: 11px; color: var(--text2);
}
.bs-fact:last-child { border-bottom: none; }
.bs-fact b { color: var(--text); font-size: 11px; font-weight: 600; }

/* Download */
.bs-dl-btn {
  display: block; width: 100%; border: none; border-radius: 8px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 9px; cursor: pointer; margin-bottom: 8px;
  transition: opacity 0.15s;
}
.bs-dl-btn:hover { opacity: 0.85; }
.bs-dl-png { background: #1a4a88; color: #c8e0ff; }
.bs-dl-pdf { background: #4a1a10; color: #ffc8b0; }
.bs-dl-note { font-size: 10px; color: var(--text3); text-align: center; }

/* Fun fact */
.bs-funfact-wrap { background: rgba(255,210,80,0.04); }
#bs-funfact { font-size: 12px; color: var(--text2); line-height: 1.7; }

/* ── Footer ── */
#bs-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 10px 20px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--text3);
  flex-shrink: 0;
}
#bs-footer a {
  color: var(--accent); text-decoration: none; font-weight: 600;
  transition: opacity 0.15s;
}
#bs-footer a:hover { opacity: 0.75; }
.bs-ft-sep { opacity: 0.4; }

/* ── Tooltip ── */
#bs-tooltip {
  position: fixed; z-index: 9999;
  background: rgba(6,12,28,0.96);
  border: 1px solid var(--border2);
  border-radius: 8px; padding: 8px 12px;
  font-size: 12px; color: var(--text);
  pointer-events: none; display: none;
  line-height: 1.6;
  backdrop-filter: blur(10px);
  max-width: 200px;
}

/* Loading spinner overlay */
#bs-loading {
  display: none; position: absolute; inset: 0;
  background: rgba(2,8,16,0.75);
  align-items: center; justify-content: center;
  z-index: 50; border-radius: 16px;
  font-size: 14px; color: var(--text2);
  flex-direction: column; gap: 12px;
}
#bs-loading.show { display: flex; }
.bs-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(74,143,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: bs-spin 0.8s linear infinite;
}
@keyframes bs-spin { to { transform: rotate(360deg); } }
