/* === Astro Guide — Dark Cosmic Theme === */

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

:root {
  --bg-body: #0a0a1a;
  --bg-card: #13132b;
  --bg-card-hover: #1a1a3a;
  --bg-nav: rgba(10, 10, 30, 0.95);
  --border: #2a2a5a;
  --border-glow: #c9a84c44;
  --text: #e0e0f0;
  --text-muted: #8888aa;
  --gold: #c9a84c;
  --gold-dim: #8a7a3a;
  --green: #4caf7a;
  --red: #e05050;
  --orange: #d08030;
  --blue: #5080d0;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: #dfc060; text-decoration: underline; }

/* === Navbar === */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.5rem;
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold) !important;
  letter-spacing: 1px;
  text-decoration: none !important;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--gold);
}

.nav-logout {
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 0.7;
}

.nav-logout:hover {
  color: var(--red) !important;
  opacity: 1;
}

/* === Container === */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* === Cards === */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--border-glow);
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--gold);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.card-grid .card {
  margin-bottom: 0;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* === Rashi Chart Grid === */

.rashi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  max-width: 480px;
  margin: 1.5rem auto;
  background: var(--border);
  border: 2px solid var(--gold-dim);
  border-radius: var(--radius);
  overflow: hidden;
}

.grid-cell {
  background: var(--bg-card);
  padding: 0.4rem 0.25rem;
  text-align: center;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.grid-cell:hover {
  background: var(--bg-card-hover);
}

.cell-label {
  font-size: 0.75rem;
  color: var(--gold-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.cell-rashi {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.planet-tag {
  font-size: 0.7rem;
  background: rgba(201, 168, 76, 0.12);
  color: var(--text);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.planet-tag.retro {
  background: rgba(224, 80, 80, 0.15);
  color: var(--red);
}

.tag-benefic {
  background: rgba(76, 175, 122, 0.15) !important;
}

.tag-malefic {
  background: rgba(208, 128, 48, 0.12) !important;
}

.grid-center {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  margin: auto;
}

.center-lagna {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

.center-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* === Tables === */

.detail-table, .info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.detail-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--gold-dim);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.detail-table td, .info-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(42, 42, 90, 0.5);
}

.detail-table tr:last-child td, .info-table tr:last-child td {
  border-bottom: none;
}

.detail-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.info-table td:first-child {
  color: var(--text-muted);
  width: 40%;
  font-weight: 500;
}

.table-scroll {
  overflow-x: auto;
}

/* === Factor rows (Muhurta/Nifty) === */

.factor-name {
  font-weight: 600;
  color: var(--text);
}

.factor-points {
  font-weight: 700;
  text-align: center;
  width: 3rem;
}

.factor-value {
  color: var(--gold);
  font-weight: 500;
}

.factor-note {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* === Verdict / Score display === */

.verdict {
  font-weight: 700;
  font-size: 1rem;
}

.score {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.muhurta-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.muhurta-header h3 {
  margin-bottom: 0;
}

/* === Color utilities === */

.color-green  { color: var(--green); }
.color-gold   { color: var(--gold); }
.color-muted  { color: var(--text-muted); }
.color-orange { color: var(--orange); }
.color-red    { color: var(--red); }

/* === Buttons === */

.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.2s;
  line-height: 1.4;
}

.btn:hover {
  background: var(--gold-dim);
  color: #fff;
}

.btn-primary {
  background: var(--gold-dim);
  color: #fff;
}

.btn-primary:hover {
  background: var(--gold);
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
  background: transparent;
}

/* === Forms === */

.chart-form {
  max-width: 440px;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.form-group input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  background: var(--bg-body);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--gold);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

/* === Alerts === */

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-error {
  background: rgba(224, 80, 80, 0.12);
  color: var(--red);
  border: 1px solid rgba(224, 80, 80, 0.3);
}

/* === Guidance Cards === */

.guidance-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.guidance-planet {
  font-weight: 700;
  color: var(--gold);
  font-size: 1rem;
}

.guidance-house {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 4px;
}

.guidance-area {
  font-size: 0.85rem;
  color: var(--text);
  font-style: italic;
}

.guidance-priority {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(201, 168, 76, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.guidance-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.guidance-do {
  padding: 0.4rem 0.75rem;
  border-left: 3px solid var(--green);
  background: rgba(76, 175, 122, 0.06);
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.guidance-dont {
  padding: 0.4rem 0.75rem;
  border-left: 3px solid var(--red);
  background: rgba(224, 80, 80, 0.06);
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.guidance-reason {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Overview Card (Chart Page) === */

.overview-body {
  margin-bottom: 1rem;
}

.overview-body p {
  margin-bottom: 0.4rem;
}

.overview-desc {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}

.overview-stats {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}

.stat {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
  margin-top: 2px;
}

.overview-notes h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.key-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.key-item {
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(42,42,90,0.3);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.key-item:last-child {
  border-bottom: none;
}

.key-planet {
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.key-benefic {
  color: var(--green);
  background: rgba(76, 175, 122, 0.1);
}

.key-malefic {
  color: var(--orange);
  background: rgba(208, 128, 48, 0.1);
}

.key-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* === House Mini Guide === */

.house-guide {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.house-mini {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  transition: border-color 0.2s;
}

.house-mini:hover {
  border-color: var(--border-glow);
}

.house-mini.house-active {
  border-left: 3px solid var(--gold);
}

.house-mini-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.house-mini-num {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold-dim);
  background: rgba(201, 168, 76, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
}

.house-mini-area {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.house-mini-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.3rem;
}

.house-mini-planets {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.mini-planet {
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}

.mini-benefic {
  color: var(--green);
  background: rgba(76, 175, 122, 0.08);
}

.mini-malefic {
  color: var(--orange);
  background: rgba(208, 128, 48, 0.08);
}

/* === Technical Details (Collapsible) === */

.tech-details summary {
  cursor: pointer;
  list-style: none;
}

.tech-details summary::-webkit-details-marker {
  display: none;
}

.tech-summary h3 {
  display: inline;
  margin-bottom: 0;
}

.tech-summary::before {
  content: "▶ ";
  color: var(--gold-dim);
  font-size: 0.8rem;
}

.tech-details[open] .tech-summary::before {
  content: "▼ ";
}

.rx-mark {
  font-size: 0.65rem;
  color: var(--red);
  font-weight: 700;
  background: rgba(224, 80, 80, 0.1);
  padding: 0 4px;
  border-radius: 2px;
}

/* === Footer === */

.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* === Responsive === */

@media (max-width: 640px) {
  .navbar {
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
  }

  .nav-links {
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .container {
    padding: 1rem 0.75rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .rashi-grid {
    max-width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .muhurta-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    text-align: center;
  }
}

/* === Dasha Timeline === */
.row-active { background: rgba(201, 168, 76, 0.08); }
.row-active td { font-weight: 600; }
.past td { color: var(--text-muted); }
.current td { color: var(--gold); font-weight: 700; }

/* === Divisional Chart === */
.lagna-row { background: rgba(201, 168, 76, 0.05); }
.lagna-row td { font-weight: 600; }

/* === Calendar Day === */
.calendar-day h3 { margin-bottom: 0.5rem; }

/* === Print Styles === */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .navbar, .footer, .btn, .btn-group, .nav-links { display: none !important; }
  .card { background: #fff !important; border: 1px solid #ccc !important; box-shadow: none !important; page-break-inside: avoid; }
  .container { max-width: 100% !important; padding: 0.5in !important; }
  .detail-table, .info-table { color: #000 !important; }
  .detail-table th { color: #333 !important; }
  .color-muted { color: #666 !important; }
  .color-green { color: #2a7a4a !important; }
  .color-gold { color: #8a7a3a !important; }
  .color-orange { color: #a06020 !important; }
  .color-red { color: #c03030 !important; }
  .rashi-grid { border-color: #999 !important; }
  .grid-cell { background: #f8f8f8 !important; }
  .grid-center { border-color: #666 !important; }
  a { color: #3366cc !important; text-decoration: underline !important; }
  h1, h2, h3, h4 { color: #000 !important; }
  .rx-mark { color: #c03030 !important; }
}
