/* styles.css - AstroRidge 3D: Solar/Lunar Ephemeris, Mountain Skyline & Diamond-Peak Solver */
:root {
  --bg-dark: #050814;
  --panel-bg: rgba(11, 16, 30, 0.96);
  --panel-border: rgba(255, 255, 255, 0.10);
  --card-bg: rgba(20, 29, 50, 0.76);
  --accent-gold: #fbbf24;
  --accent-cyan: #00e5ff;
  --accent-orange: #f97316;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Meiryo", sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 58px;
  background: rgba(5, 8, 20, 0.98);
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 12px;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
}

.brand-title {
  font-weight: 800;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-pro {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  color: var(--accent-gold);
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
  min-width: 190px;
  max-width: 520px;
}

.select-box, .search-input, .date-input {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-box option {
  background: #0f172a;
  color: #fff;
}

.search-input {
  flex: 1;
}

.btn {
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.btn-cyan {
  background: rgba(0, 229, 255, 0.14);
  border-color: rgba(0, 229, 255, 0.45);
  color: #7df9ff;
}

/* Workspace */
.workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 360px;
  flex-shrink: 0;
  background: var(--panel-bg);
  border-right: 1px solid var(--panel-border);
  padding: 13px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 11px;
  z-index: 800;
}

@media (max-width: 960px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }
  .topbar {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .workspace {
    flex-direction: column;
    overflow: visible;
  }
  .sidebar {
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }
  .right-split {
    overflow: visible;
  }
  .map-pane {
    height: 300px;
    min-height: 300px;
    flex: none;
  }
  #map {
    min-height: 300px;
  }
  .panorama-pane {
    min-height: 320px;
    flex: none;
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #cbd5e1;
}

.val-badge {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-gold);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-gold);
  cursor: pointer;
}

.sun-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.stat-pill {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 7px 9px;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
}

.stat-val {
  font-size: 14px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
  margin-top: 2px;
}

.stat-sub {
  font-size: 10px;
  color: #94a3b8;
}

.alignments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
}

.align-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent-gold);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.align-item.moon {
  border-left-color: #38bdf8;
}

.align-item:hover {
  background: rgba(251, 191, 36, 0.14);
}

.align-date {
  font-size: 13px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
}

.align-badge {
  font-size: 10.5px;
  color: var(--accent-gold);
  margin-top: 2px;
}

.align-item.moon .align-badge {
  color: #7dd3fc;
}

/* Right Main Split: Map + Panorama */
.right-split {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.map-pane {
  flex: 1;
  position: relative;
  border-bottom: 1px solid var(--panel-border);
}

#map {
  width: 100%;
  height: 100%;
  background: #070b14;
}

#map .leaflet-tile-pane {
  filter: invert(92%) hue-rotate(185deg) brightness(80%) contrast(96%) saturate(75%);
}

.map-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 600;
  max-width: calc(100% - 60px);
  background: rgba(10, 15, 28, 0.88);
  border: 1px solid var(--panel-border);
  padding: 5px 11px;
  border-radius: 10px;
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.map-legend > span {
  white-space: nowrap;
}

.pin-obs {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0284c7;
  border: 2.5px solid #fff;
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.85);
}

.pin-target {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ea580c;
  border: 2.5px solid #fff;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.85);
}

.panorama-pane {
  flex: 1.15;
  position: relative;
  background: #050814;
  display: flex;
  flex-direction: column;
}

.pano-toolbar {
  min-height: 38px;
  height: auto;
  background: rgba(10, 15, 28, 0.96);
  border-bottom: 1px solid var(--panel-border);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
}

.canvas-wrap {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 240px;
}

#panoCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.status-toast {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-gold);
  color: #fef08a;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: none;
}

.status-toast.visible {
  display: block;
}

/* A4 Print-Ready PDF Sheet */
.print-sheet {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    height: auto !important;
    width: auto !important;
    overflow: visible !important;
  }
  .topbar, .workspace, .comm-modal-backdrop {
    display: none !important;
  }
  .print-sheet {
    display: block !important;
    padding: 16px;
    font-family: 'Inter', "Hiragino Sans", sans-serif;
  }
  .print-sheet img {
    width: 100%;
    height: auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
  }
}
