/* ============================================================
   CAIRNOVA · Night Sky Intelligence · nsi.css
   Upload to: /public_html/nsi/nsi.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Root ── */
#nsi-root {
  background: #0a1828;
  color: #F4F1EA;
  font-family: 'DM Sans', sans-serif;
  border-radius: 0;
  overflow: hidden;
  width: 100%;
}

/* ── Header ── */
.nsi-header {
  padding: 2rem 2.5rem 0;
  border-bottom: 1px solid rgba(201,148,58,0.2);
}

.nsi-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #C9943A;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.nsi-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 26px;
  font-weight: 400;
  color: #F4F1EA;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.nsi-title em { color: #C9943A; font-style: italic; }

/* ── Tabs ── */
.nsi-tabs { display: flex; }

.nsi-tab {
  padding: 0.75rem 1.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244,241,234,0.45);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.nsi-tab:hover { color: rgba(244,241,234,0.75); }
.nsi-tab.active { color: #C9943A; border-bottom: 2px solid #C9943A; }

/* ── Body ── */
.nsi-body { padding: 2rem 2.5rem; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Shared cards ── */
.nsi-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,148,58,0.18);
  border-radius: 0;
  padding: 1.25rem;
}

.nsi-card.highlight {
  border-color: rgba(201,148,58,0.4);
  background: rgba(201,148,58,0.06);
}

.nsi-card.highlight .nsi-card-value { color: #C9943A; }

.nsi-card-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244,241,234,0.45);
  margin-bottom: 0.4rem;
}

.nsi-card-value {
  font-family: 'Libre Baskerville', serif;
  font-size: 22px;
  color: #F4F1EA;
  margin-bottom: 0.2rem;
}

.nsi-card-sub { font-size: 12px; color: rgba(244,241,234,0.45); }

.nsi-section-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244,241,234,0.4);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nsi-green-tip {
  background: rgba(76,159,112,0.07);
  border: 1px solid rgba(76,159,112,0.2);
  border-radius: 0;
  padding: 0.9rem 1rem;
}

.nsi-green-tip-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4C9F70;
  margin-bottom: 0.45rem;
}

.nsi-green-tip-body {
  font-size: 12px;
  color: rgba(244,241,234,0.6);
  line-height: 1.7;
}

/* ── Overview tab ── */
.ov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ov-conditions {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ov-cond {
  text-align: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 0;
  padding: 0.9rem 0.5rem;
}

.ov-cond-icon { font-size: 20px; margin-bottom: 0.4rem; }
.ov-cond-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(244,241,234,0.4); margin-bottom: 0.25rem; }
.ov-cond-val { font-size: 14px; font-weight: 500; color: #F4F1EA; }

.ov-locations {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 0.75rem;
}

.ov-loc {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 0;
  padding: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.ov-loc:hover { border-color: rgba(201,148,58,0.35); background: rgba(201,148,58,0.05); }
.ov-loc-name { font-size: 13px; font-weight: 500; color: #F4F1EA; margin-bottom: 0.2rem; }
.ov-loc-bortle { font-size: 11px; color: #C9943A; margin-bottom: 0.3rem; }
.ov-loc-meta { font-size: 11px; color: rgba(244,241,234,0.4); }
.ov-loc-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* ── Stars tab ── */
.star-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

#starCanvas {
  width: 100%;
  height: 280px;
  background: #060e1a;
  border-radius: 0;
  border: 1px solid rgba(201,148,58,0.2);
  cursor: crosshair;
  display: block;
}

.star-info-panel { display: flex; flex-direction: column; gap: 0.75rem; }

.constellation-list { display: flex; flex-direction: column; gap: 0.5rem; }

.constellation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.2s;
  font-size: 13px;
}

.constellation-item:hover { border-color: rgba(201,148,58,0.3); }
.constellation-item.active { border-color: rgba(201,148,58,0.5); background: rgba(201,148,58,0.06); }
.ci-name { color: #F4F1EA; font-weight: 500; }
.ci-time { font-size: 11px; color: rgba(244,241,234,0.45); }

.ci-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 0;
  background: rgba(201,148,58,0.15);
  color: #C9943A;
  border: 1px solid rgba(201,148,58,0.25);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.star-objects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.star-obj {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 0;
  padding: 0.7rem;
}

.star-obj-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(244,241,234,0.4); margin-bottom: 0.2rem; }
.star-obj-val { font-size: 13px; font-weight: 500; color: #F4F1EA; }
.star-obj-sub { font-size: 11px; color: rgba(244,241,234,0.4); }

/* ── Planets tab ── */
.planet-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.planet-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0;
  padding: 1.1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.planet-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.planet-body { flex: 1; min-width: 0; }
.planet-name { font-size: 14px; font-weight: 500; color: #F4F1EA; margin-bottom: 0.2rem; }
.planet-data { font-size: 11px; color: rgba(244,241,234,0.5); line-height: 1.6; }

.planet-vis {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vis-good { background: rgba(76,159,112,0.15); color: #4C9F70; border: 1px solid rgba(76,159,112,0.3); }
.vis-fair { background: rgba(201,148,58,0.12); color: #C9943A; border: 1px solid rgba(201,148,58,0.25); }
.vis-poor { background: rgba(180,75,75,0.12); color: #B44B4B; border: 1px solid rgba(180,75,75,0.25); }

.planet-tip-box {
  background: rgba(78,89,104,0.25);
  border: 1px solid rgba(78,89,104,0.4);
  border-radius: 0;
  padding: 1.1rem 1.25rem;
}

.planet-tip-box h4 {
  font-family: 'Libre Baskerville', serif;
  font-size: 14px;
  font-weight: 400;
  color: #F4F1EA;
  margin-bottom: 0.6rem;
}

.planet-tip-box p { font-size: 12px; color: rgba(244,241,234,0.55); line-height: 1.7; }

/* ── Moon tab ── */
.moon-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }

#moonWrap {
  width: 300px !important;
  height: 300px !important;
  max-width: 300px !important;
  flex-shrink: 0;
  margin: 0 auto;
  display: block;
  position: relative;
}

#moonCanvas {
  display: block !important;
  border-radius: 50% !important;
  cursor: grab;
  width: 300px !important;
  height: 300px !important;
  max-width: 300px !important;
  max-height: 300px !important;
}

#moonCanvas:active { cursor: grabbing; }

#moonCanvas {
  display: block !important;
  border-radius: 50% !important;
  cursor: grab;
  width: 300px !important;
  height: 300px !important;
  max-width: 300px !important;
  max-height: 300px !important;
}
#moonCanvas:active { cursor: grabbing; }

.moon-drag-hint {
  font-size: 11px;
  color: rgba(244,241,234,0.28);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin-top: 0.75rem;
}

.moon-phase-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  justify-content: center;
}

.moon-ctrl-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244,241,234,0.35);
  white-space: nowrap;
}

#moonPhaseSlider {
  flex: 1;
  max-width: 160px;
  height: 2px;
  background: rgba(201,148,58,0.25);
  border-radius: 0;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

#moonPhaseSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #C9943A;
  cursor: pointer;
  border: none;
}

#moonPhaseSlider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #C9943A;
  border: none;
  cursor: pointer;
}

.moon-panel { display: flex; flex-direction: column; gap: 1rem; }

.moon-phase-name {
  font-family: 'Libre Baskerville', serif;
  font-size: 22px;
  font-weight: 400;
  color: #F4F1EA;
}

.moon-phase-meta { font-size: 13px; color: rgba(244,241,234,0.5); margin-top: 0.2rem; }

.moon-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

.moon-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 0;
  padding: 0.75rem;
}

.moon-stat-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(244,241,234,0.4); margin-bottom: 0.3rem; }
.moon-stat-value { font-size: 15px; font-weight: 500; color: #F4F1EA; }

.moon-next-phases { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 0; padding: 0.9rem; }

.moon-next-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 0.25rem 0;
}

.moon-next-label { color: rgba(244,241,234,0.5); }
.moon-next-date { color: #F4F1EA; }
.moon-next-date.highlight { color: #4C9F70; }

.moon-phases-strip { margin-top: 0.5rem; }
.moon-strip-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(244,241,234,0.3); margin-bottom: 0.7rem; }

.phases-row { display: flex; gap: 0.35rem; }

.phase-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.25rem;
  border-radius: 0;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: border-color 0.2s;
}

.phase-pill:hover { border-color: rgba(201,148,58,0.3); }
.phase-pill.current { border-color: rgba(201,148,58,0.5); background: rgba(201,148,58,0.07); }
.phase-pill-label { font-size: 9px; color: rgba(244,241,234,0.38); text-align: center; line-height: 1.3; }

/* ── Responsive ── */
@media (max-width: 680px) {
  .nsi-header { padding: 1.5rem 1.25rem 0; }
  .nsi-body { padding: 1.5rem 1.25rem; }
  .nsi-tab { padding: 0.65rem 0.9rem; font-size: 11px; }
  .ov-grid { grid-template-columns: 1fr; }
  .ov-conditions { grid-template-columns: repeat(2,1fr); }
  .ov-locations { grid-template-columns: repeat(2,1fr); }
  .star-layout { grid-template-columns: 1fr; }
  .planet-grid { grid-template-columns: 1fr; }
  .moon-layout { grid-template-columns: 1fr; }
  #moonWrap {
  width: 300px !important;
  height: 300px !important;
  max-width: 300px !important;
  flex-shrink: 0;
  margin: 0 auto;
  display: block;
  position: relative;
}

#moonCanvas {
  display: block !important;
  border-radius: 50% !important;
  cursor: grab;
  width: 300px !important;
  height: 300px !important;
  max-width: 300px !important;
  max-height: 300px !important;
}

#moonCanvas:active { cursor: grabbing; }
}

/* Planet icon canvases */
.planet-icon-canvas {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
}

/* Tonight's Moon button - sharp corners */
#moonTonightBtn {
  border-radius: 0 !important;
}

/* Phase pills - sharp */
.phase-pill {
  border-radius: 0 !important;
}

/* Constellation items - sharp */
.constellation-item {
  border-radius: 0 !important;
}

/* All badges - sharp */
.ci-badge,
.planet-vis,
.vis-good,
.vis-fair,
.vis-poor {
  border-radius: 0 !important;
}

/* Star map canvas - sharp */
#starCanvas {
  border-radius: 0 !important;
}

/* Overview location cards - sharp */
.ov-loc {
  border-radius: 0 !important;
}

/* Overview condition cards - sharp */
.ov-cond {
  border-radius: 0 !important;
}

/* Moon wrap - keep circular for moon itself */
#moonWrap {
  border-radius: 0 !important;
  overflow: visible !important;
}

/* ── LOCATION CARDS ENHANCED ─────────────────────────────── */
.ov-loc {
  transition: border-color 0.2s, background 0.2s;
}
.ov-loc:hover {
  border-color: rgba(201,148,58,0.5) !important;
  background: rgba(201,148,58,0.05) !important;
}
.ov-loc.selected {
  border-color: #C9943A !important;
  background: rgba(201,148,58,0.08) !important;
}
.ov-loc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}
.ov-loc-best {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4C9F70;
  border: 1px solid #4C9F70;
  padding: 2px 6px;
  font-family: 'DM Sans', sans-serif;
}
.ov-bortle-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
  height: 3px;
  background: rgba(255,255,255,0.08);
  position: relative;
}
.ov-bortle-fill {
  height: 100%;
  transition: width 0.3s;
}
.ov-bortle-label {
  font-size: 9px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.05em;
  white-space: nowrap;
  position: absolute;
  right: 0;
  top: -10px;
}
.ov-loc-cloud {
  font-size: 11px;
  color: #C9943A;
  margin-top: 0.3rem;
  font-family: 'DM Sans', sans-serif;
}

/* ── SELECTED LOCATION INDICATOR ────────────────────────── */
#ov-location-name {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.2rem;
}

/* Gap below locations grid */
.ov-locations {
  margin-bottom: 2rem !important;
}

/* Location conditions heading */
#ov-location-name {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ── TIER LEGEND ─────────────────────────────────────────── */
.ov-tier-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 2px solid #C9943A;
}
.ov-tier-legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-family: 'DM Sans', sans-serif;
}
.ov-tier-legend-item strong {
  color: rgba(255,255,255,0.75);
}
.ov-tier-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* ── LOCATION CARD ADDITIONS ────────────────────────────── */
.ov-loc-region {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 0.4rem;
  font-family: 'DM Sans', sans-serif;
}
.ov-loc-tier {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid;
  padding: 2px 7px;
  margin-top: 0.5rem;
  font-family: 'DM Sans', sans-serif;
}
.ov-loc-tier-desc {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  margin: 0.25rem 0 0.4rem;
  font-family: 'DM Sans', sans-serif;
  font-style: italic;
}
.ov-loc-note {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-top: 0.35rem;
  font-family: 'DM Sans', sans-serif;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 0.35rem;
}
