/* Kundali App Styles - Mobile responsive, print-friendly */
:root {
  --primary: #8b4513;
  --secondary: #d2691e;
  --bg: #fffaf0;
  --text: #333;
  --border: #ddd;
}

* { box-sizing: border-box; }

body {
  font-family: Georgia, serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
}

.topbar {
  background: #2c1810;
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.topbar .logo {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2rem;
}

.topbar nav a {
  color: #ddd;
  text-decoration: none;
  margin-left: 1.5rem;
}

.topbar nav a.active, .topbar nav a:hover {
  color: #ffd700;
}

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

h1 { color: var(--primary); text-align: center; }
.subtitle { text-align: center; color: #666; margin-bottom: 2rem; }

.form-section {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-grid label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.form-grid input, .form-grid select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}

.form-grid small { color: #666; font-size: 0.85rem; }

.btn-primary, .btn-secondary {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}

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

.btn-secondary {
  background: #555;
  color: white;
}

.privacy-note {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-top: 1rem;
}

#results {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.report-actions { text-align: right; margin-bottom: 1rem; }

.planet-table, .dasha-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.planet-table th, .planet-table td,
.dasha-table th, .dasha-table td {
  border: 1px solid var(--border);
  padding: 0.5rem;
  text-align: left;
}

.planet-table th, .dasha-table th {
  background: #f5f5f5;
}

.kundali-chart {
  max-width: 440px;
  margin: 1rem auto;
  display: block;
}

.varga-switcher {
  text-align: center;
  margin: 0.5rem 0 1rem;
}

.varga-btn {
  padding: 0.5rem 1.25rem;
  margin: 0 0.25rem;
  border: 1px solid var(--primary);
  background: white;
  color: var(--primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.varga-btn.active, .varga-btn:hover {
  background: var(--primary);
  color: white;
}

.varga-label {
  text-align: center;
  color: #666;
  font-style: italic;
  margin-top: 0.5rem;
}

.note {
  color: #555;
  font-size: 0.92rem;
}

.error {
  color: #a00;
  font-weight: bold;
}

.verdict {
  font-size: 1.15rem;
  background: #f5f0e6;
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 4px;
}

.koota-table td:nth-child(2) { white-space: nowrap; font-weight: bold; }

.gochar-list { padding-left: 1.25rem; }
.gochar-list li { margin-bottom: 0.5rem; }
.gochar-list ul { margin-top: 0.25rem; padding-left: 1.25rem; }
.gochar-list ul li { margin-bottom: 0.25rem; font-size: 0.95rem; }
.gochar-rating { color: #8a6d3b; font-weight: normal; font-style: italic; }
.remedy-list { padding-left: 1.25rem; margin: 0.25rem 0 1rem; }
.remedy-list li { margin-bottom: 0.35rem; }
.qa-item { margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid #eee; }
.qa-factors { font-size: 0.85rem; color: #777; font-style: italic; }
.tz-warning { display: block; color: #a94442; font-weight: 600; margin-top: 0.35rem; }
input.needs-check { border: 2px solid #c0392b; background: #fef3f0; }
.tz-display { display: block; font-weight: 700; color: #2c5f2d; margin-top: 0.35rem; }
.tz-auto { font-weight: 700; color: #2c5f2d; margin: 0.25rem 0; }
.tz-advanced { margin-top: 0.5rem; }
.tz-advanced summary { cursor: pointer; color: #5a4a2a; font-size: 0.9rem; }
.tz-advanced label { display: block; margin-top: 0.5rem; }
.past-chapters { margin: 0.5rem 0 1rem; }
.past-chapter { padding: 0.6rem 0.9rem; margin-bottom: 0.6rem; background: #faf8f2; border-left: 3px solid #8a6d3b; border-radius: 0 6px 6px 0; }
.past-chapter p { margin: 0; }
.guidance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0.5rem 0 1rem; }
.guidance-card { background: #faf8f2; border: 1px solid #e8e0cc; border-radius: 8px; padding: 1rem; }
.guidance-card h4 { margin: 0 0 0.5rem; color: #5a4a2a; }
.guidance-card p { margin: 0; font-size: 0.95rem; }
.ask-box { display: flex; gap: 0.5rem; margin: 0.75rem 0; }
.ask-box input { flex: 1; padding: 0.7rem; border: 1px solid #ccc; border-radius: 6px; font-size: 1rem; }
.ask-answer { background: #f4f9f4; border: 1px solid #cfe3cf; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.curious-details { margin: 1.5rem 0; border: 1px solid #e0d9c3; border-radius: 8px; padding: 0 1rem; background: #fffdf8; }
.curious-details summary { cursor: pointer; padding: 1rem 0; list-style: none; }
.curious-details summary::-webkit-details-marker { display: none; }
.curious-details summary:before { content: "+ "; font-weight: 700; color: #8a6d3b; }
.curious-details[open] summary:before { content: "- "; }
.summary-title { font-size: 1.25rem; font-weight: 700; color: #3a3a3a; }
@media (max-width: 600px) {
  .guidance-grid { grid-template-columns: 1fr; }
  .ask-box { flex-direction: column; }
}

/* Matching section */
.match-section { margin-top: 2rem; }
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.match-person {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  background: #fffdf7;
}
.match-person h3 { margin-top: 0; color: var(--primary); }
.match-person label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.75rem;
}
.match-person input, .match-person select {
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  margin-top: 0.25rem;
  font-weight: normal;
}
#matchResults { margin-top: 1.5rem; }

/* Print styles */
@media print {
  .topbar, .form-section, .report-actions, .faq, footer {
    display: none;
  }
  #results { display: block !important; box-shadow: none; }
  #matchingSection { display: block !important; box-shadow: none; }
  #matchingSection .match-form-wrap { display: none; }
  .varga-switcher { display: none; }
  table, .dosha, .kundali-chart, .match-person { page-break-inside: avoid; }
  body { background: white; }
  main { max-width: 100%; padding: 0; }
}

/* Mobile */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .match-grid { grid-template-columns: 1fr; }
  main { padding: 1rem 0.5rem; }
}

.dosha {
  border: 1px solid var(--border);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
}

.dosha h4 { margin-top: 0; color: var(--primary); }

.disclaimer {
  background: #fff3cd;
  border: 1px solid #ffc107;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 2rem;
  font-size: 0.9rem;
}

.privacy {
  text-align: center;
  color: #666;
  font-style: italic;
}

.faq { margin-top: 3rem; }
.faq h3 { color: var(--primary); }

footer {
  text-align: center;
  padding: 2rem;
  color: #666;
  font-size: 0.9rem;
}

/* Print styles */
@media print {
  .topbar, .form-section, .report-actions, .faq, footer {
    display: none;
  }
  #results { display: block !important; box-shadow: none; }
  body { background: white; }
  main { max-width: 100%; padding: 0; }
}

/* Mobile */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  main { padding: 1rem 0.5rem; }
}

/* Detailed reading */
.rdg-reading h3 { margin-top: 1.6em; }
.rdg-reading h4 { margin: 1.1em 0 0.3em; }
.rdg-factors { font-size: 0.86em; color: #5a5a5a; font-style: italic; }
.rdg-note { font-size: 0.86em; color: #5a5a5a; border-left: 3px solid #c9a227; padding-left: 0.8em; }
.rdg-for { font-size: 0.92em; }
.rdg-reading ol { margin-left: 1.2em; }
.rdg-reading ol li { margin-bottom: 0.5em; }

/* ---- premium 3D layer ---- */
.btn-primary, .btn-secondary{
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -1px 0 rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.22);
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s, filter .2s;
}
.btn-primary:hover, .btn-secondary:hover{ transform: translateY(-2px); filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 3px 8px rgba(0,0,0,.35), 0 14px 32px rgba(0,0,0,.28); }
.btn-primary:active, .btn-secondary:active{ transform: translateY(1px) scale(.98); box-shadow: inset 0 2px 5px rgba(0,0,0,.3); }
.guidance-card{
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0) 40%), #faf8f2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 1px 2px rgba(90,74,42,.08), 0 8px 22px rgba(90,74,42,.1);
  border-radius: 14px;
  transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s;
}
.guidance-card:hover{ transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 3px 8px rgba(90,74,42,.12), 0 16px 36px rgba(90,74,42,.14); }
.varga-btn{
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.varga-btn:hover{ transform: translateY(-1px); }
.varga-btn:active{ transform: translateY(1px) scale(.97); }
@media (prefers-reduced-motion: reduce){
  .btn-primary, .btn-secondary, .guidance-card, .varga-btn{ transition: none; }
  .btn-primary:hover, .btn-secondary:hover, .guidance-card:hover, .varga-btn:hover{ transform: none; }
}
