/* transit-overlay.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a1a;
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: #1a1a2e;
  color: white;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-btn {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
  flex-shrink: 0;
}
.back-btn:hover { color: white; }

header h1 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  font-size: 0.82rem;
}

.header-auth-email {
  color: rgba(255,255,255,0.7);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-auth a, .header-auth button {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.header-auth a:hover, .header-auth button:hover { background: rgba(255,255,255,0.22); }

/* ── Layout ── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Sticky form ── */
.form-sticky {
}

/* ── Card ── */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 8px rgba(0,0,0,0.04);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin-bottom: 1.25rem;
  font-weight: 600;
}

/* ── Form ── */
.form-row {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row-main { grid-template-columns: auto auto; }

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: #444;
  margin-bottom: 0.35rem;
}

.field label .tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 400;
  color: #aaa;
  background: #f2f2f2;
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  margin-left: 0.35rem;
}

input[type="date"],
input[type="time"],
select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d5d5d5;
  border-radius: 5px;
  font-size: 0.9rem;
  color: #1a1a1a;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: auto;
  -webkit-appearance: auto;
}

/* Chart selector */
#chartSelect {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

input:focus, select:focus {
  outline: none;
  border-color: #4a6fa5;
  box-shadow: 0 0 0 3px rgba(74,111,165,0.14);
}

input::placeholder { color: #bbb; }

.form-actions {
  margin-top: 0.5rem;
  min-height: 1.4em;
}

#nowBtn {
  margin-top: 0.5rem;
  background: #e49836;
  color: white;
  border: none;
  padding: 0.55rem 0.55rem;
  border-radius: 5px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
#nowBtn:hover { background: #c8821e; }

/* ── City autocomplete ── */
.city-autocomplete { position: relative; }

.city-autocomplete input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d5d5d5;
  border-radius: 5px;
  font-size: 0.9rem;
  color: #1a1a1a;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.city-autocomplete input[type="text"]:focus {
  outline: none;
  border-color: #4a6fa5;
  box-shadow: 0 0 0 3px rgba(74,111,165,0.14);
}

#cityDropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #d5d5d5;
  border-top: none;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}

#cityDropdown .city-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}
#cityDropdown .city-item:last-child { border-bottom: none; }
#cityDropdown .city-item:hover,
#cityDropdown .city-item.active { background: #f0f4fa; }
#cityDropdown .city-main { font-size: 0.88rem; font-weight: 500; color: #1a1a1a; }
#cityDropdown .city-sub  { font-size: 0.75rem; color: #888; margin-top: 0.1rem; }

#cityInfo {
  font-size: 0.75rem;
  color: #4a6fa5;
  margin-top: 0.3rem;
  min-height: 1em;
}

/* ── Status ── */
#status {
  display: none;
  font-size: 0.84rem;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
}
#status.loading { color: #555; }
#status.error   { color: #a52020; background: #fff3f3; border: 1px solid #f0c0c0; }

/* ── 3-Bodygraph grid ── */
.overlay-graphs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.overlay-graph-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 8px rgba(0,0,0,0.04);
  padding: 1rem 0.75rem 0.75rem;
}

.overlay-graph-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  font-weight: 600;
  margin-bottom: 0.65rem;
  text-align: center;
}

#bg-chart svg,
#bg-transit svg,
#bg-together svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Combined planet table ── */
.planet-table-card { padding: 1.25rem 1.75rem; }

.planet-table-wrap { overflow-x: auto; }

#combinedPlanetTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

#combinedPlanetTable thead th {
  padding: 0.35rem 0.6rem;
  border-bottom: 2px solid #e8e8e8;
  white-space: nowrap;
  text-align: center;
}

#combinedPlanetTable tbody tr:nth-child(even) { background: #fafafa; }
#combinedPlanetTable tbody tr:hover           { background: #f0f4fa; }

#combinedPlanetTable td {
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
  white-space: nowrap;
}

.pt-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 3px;
  padding: 0.15rem 0.45rem;
  letter-spacing: 0.04em;
}
.pt-badge-p { background: #1a1a2e; color: #fff; }
.pt-badge-d { background: #8b0000; color: #fff; }
.pt-badge-t { background: #1565c0; color: #fff; }

.pt-col-planet { text-align: left; min-width: 110px; }
.pt-col-p,
.pt-col-d,
.pt-col-t { text-align: center; min-width: 56px; }

#combinedPlanetTable { font-size: 0.84rem; }

.pt-planet { display: flex; align-items: center; gap: 0.55rem; }
.pt-sym    { width: 1.3rem; height: 1.3rem; color: #555; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.pt-sym svg { display: block; }
.pt-name   { color: #333; font-weight: 500; white-space: nowrap; }

.ov-gate { font-family: 'SF Mono', 'Consolas', 'Menlo', monospace; font-size: 0.88rem; font-weight: 600; }
.ov-gate-dot { color: #bbb; margin: 0 0.05rem; }
.ov-retro    { font-size: 0.72rem; color: #999; margin-left: 0.1rem; }

.ed-mark     { font-size: 0.7rem; font-weight: 700; margin-left: 0.15rem; }
.ed-exalted  { color: #2e7d32; }
.ed-detriment { color: #c75000; }

.pt-col-p .ov-gate { color: #1a1a2e; }
.pt-col-d .ov-gate { color: #8b0000; }
.pt-col-t .ov-gate { color: #1565c0; }

/* ── Channels ── */
.channels-card { padding: 1.25rem 1.75rem; }

.channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  border-radius: 3px;
  padding: 0.05rem 0.2rem;
  font-size: 0.82rem;
  color: #666;
  transition: background 0.12s, color 0.12s;
}
.channel-chip:hover { background: #eef2fa; color: #4a6fa5; }
.channel-sep { color: #ccc; margin: 0 0.1rem; }

.center-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Lock Overlay ── */
#lockOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(240,242,245,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-card {
  background: white;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  max-width: 420px;
  width: 90%;
}
.lock-icon  { font-size: 2.5rem; margin-bottom: 1rem; }
.lock-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: #1a1a2e; }
.lock-body  { font-size: 0.88rem; color: #555; margin-bottom: 1.5rem; line-height: 1.6; }
.lock-btn-sub {
  display: inline-block;
  background: #2e7d32;
  color: white;
  padding: 0.65rem 1.75rem;
  border-radius: 5px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.lock-hint { margin-top: 0.85rem; font-size: 0.82rem; color: #aaa; }

/* ── Responsive ── */
@media (max-width: 900px) {
  header { padding: 0.9rem 1.25rem; }
  .header-auth-email { display: none; }
  .form-row-main { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .overlay-graphs {
    grid-template-columns: 1fr;
  }
  .overlay-graph-col {
    max-width: 280px;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  header { padding: 0.7rem 1rem; }
  main { padding: 1.25rem 1rem; }
  .card { padding: 1.25rem; }
  .form-row-main { grid-template-columns: 1fr; }

  .form-sticky {
    position: sticky;
    top: 52px;
    z-index: 40;
    border-radius: 0;
    margin: 0 -1rem;
    padding: 0.6rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.14);
  }

  /* Minimal sticky form on mobile: hide title, labels, cityInfo, form-actions */
  .form-sticky .card-title { display: none; }
  .form-sticky .field > label { display: none; }
  .form-sticky .form-row { margin-bottom: 0; }
  #cityInfo { display: none; }
  #status   { display: none; }

  /* Planet table: hide names and retrograde badges, remove min-width */
  .pt-name      { display: none; }
  .ov-retro     { display: none; }
  .pt-col-planet { min-width: 0; }
}

/* ── Transit-Zeitachse Range-Buttons ────────────────────────────────────────── */
.tl-range-btns {
  display: flex;
  gap: 0.25rem;
}

.tl-range-btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  color: #555;
  transition: background 0.15s, color 0.15s;
}

.tl-range-btn:hover {
  background: #f0f0f0;
}

.tl-range-btn.active {
  background: #333;
  color: white;
  border-color: #333;
}
