/* main.css - move all inline <style> contents here */

/* Page */
body {
  font-family: system-ui, -apple-system, Roboto, 'Segoe UI', Arial;
  background: #fafafa;
  color: #222;
  padding: 24px;
  margin: 0;
}
.card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  max-width: 1200px;
  margin: 16px auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
header h1 {
  margin: 0;
  font-size: 22px;
  color: #1e293b;
}
.meta {
  color: #666;
  font-size: 14px;
  margin-top: 6px;
}

/* Forms */
label {
  display: block;
  margin-top: 12px;
  font-weight: 600;
  font-size: 14px;
}
input[type="text"],
input[type="date"],
input[type="time"],
select {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  margin-top: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
input:focus,
select:focus {
  outline: none;
  border-color: #2b6df6;
  box-shadow: 0 0 0 3px rgba(43, 109, 246, 0.1);
}
.row { display:flex; gap:12px; }
.row > div { flex:1; }

button {
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 0;
  background: #2b6df6;
  color: white;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}
button:hover { background: #1d4ed8; }

/* Cards/boxes */
.box { background: #f8fafc; border: 1px solid #eef2ff; padding: 14px; border-radius: 8px; }
.box h3 { margin: 0 0 8px 0; font-size: 16px; color: #1e293b; }
.kv { display:flex; justify-content:space-between; padding:6px 0; border-bottom:1px dashed #eee; font-size:14px; }

/* Charts */
.charts-container { display:flex; gap:20px; margin-top:24px; flex-wrap:wrap; justify-content:center; }
.chart-wrapper { flex:1; min-width:300px; max-width:550px; }
.chart-box { border:1px solid #ddd; padding:16px; border-radius:8px; background:white; display:inline-block; }
.chart-box svg { max-width:100%; height:auto; width:500px; }

/* Details grid */
.details-section { margin-top:24px; }
.details-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap:16px; margin-top:16px; }

/* Predictions */
.predictions-row { display:flex; gap:16px; margin-top:24px; flex-wrap:wrap; justify-content:center; }
.prediction-box { color:white; padding:20px; border-radius:10px; flex:1; min-width:280px; max-width:320px; box-shadow:0 4px 15px rgba(0,0,0,0.08); }
.prediction-box h3 { margin:0 0 12px 0; font-size:18px; border-bottom:2px solid rgba(255,255,255,0.3); padding-bottom:8px; }
.prediction-box p { margin:0; line-height:1.6; font-size:14px; }

/* Autocomplete */
.autocomplete-wrapper { position:relative; }
.autocomplete-dropdown { position:absolute; top:100%; left:0; right:0; background:white; border:1px solid #ddd; border-top:none; border-radius:0 0 6px 6px; max-height:240px; overflow-y:auto; z-index:1000; display:none; box-shadow:0 4px 12px rgba(0,0,0,0.1); }
.autocomplete-dropdown.show { display:block; }
.autocomplete-item { padding:10px 12px; cursor:pointer; border-bottom:1px solid #f0f0f0; transition:background 0.15s; }
.autocomplete-item:hover { background:#f0f7ff; }
.autocomplete-item .city-name { font-weight:600; color:#1e293b; font-size:14px; }
.autocomplete-item .city-meta { font-size:12px; color:#64748b; margin-top:2px; }
.autocomplete-empty { padding:10px 12px; color:#94a3b8; font-size:14px; }

/* Table */
.table-wrap { overflow-x:auto; }
.planet-table { width:100%; border-collapse:collapse; background:white; border-radius:8px; overflow:hidden; box-shadow:0 2px 8px rgba(0,0,0,0.08); }
.planet-table thead tr { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color:white; }
.planet-table th, .planet-table td { padding:12px; text-align:left; font-size:14px; border-bottom:1px solid #e2e8f0; }
.planet-row:hover { background:#f8fafc; }

/* Utility classes */
.center { text-align:center; }
.mt24 { margin-top:24px; }
.mt32 { margin-top:32px; }
.full-width { grid-column: 1 / -1; }
.small-meta { color:#64748b; font-size:13px; margin-bottom:8px; }
.muted { color:#64748b; font-size:13px; }

/* Marriage CTA */
.cta-marriage {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  padding: 14px 32px;
  border-radius: 10px;
  border: 0;
  color: white;
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta-marriage:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5); }
.cta-marriage:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Flash messages */
.flash { padding:10px; margin:6px 0; border-radius:6px; }
.flash.error, .flash.danger { color:#b00020; background:#fef2f2; }
.flash.success, .flash.info { color:#1a7f24; background:#f0fdf4; }

/* Responsive */
@media (max-width: 768px) {
  .charts-container { flex-direction: column; }
  .chart-wrapper { max-width:100%; }
  .details-grid { grid-template-columns: 1fr; }
  .predictions-row { flex-direction: column; }
  .prediction-box { max-width:100%; }
  table th, table td { padding:8px 6px !important; font-size:12px !important; }
}
/* ---------- Restore prediction box colors / gradients ---------- */

/* If you prefer adding classes in HTML, see note below.
   These rules target the boxes by id and position so no template edits required. */

/* General (first box) */
.predictions-row .prediction-box:first-child {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  color: white;
}

/* Marriage (middle box) — targeted by id if present */
#marriage_prediction_box {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
  color: white;
}

/* Profession (last box) */
.predictions-row .prediction-box:last-child {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.25);
  color: white;
}

/* Ensure headings and paragraph contrast */
.prediction-box h3 { color: rgba(255,255,255,0.95); }
.prediction-box p { color: rgba(255,255,255,0.95); }

/* CTA marriage button tweaks (if still needed) */
.cta-marriage {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
  color: white;
}
.cta-marriage:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5); }

/* ---------- Mahadasha / details look-and-feel ---------- */

/* Make the <details> blocks look like cards with soft border and spacing */
.maha-item {
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

/* Style the <summary> so it looks clickable and neat */
/* ===== Mahadasha summary line (planet name left) ===== */
.maha-item > summary {
  cursor: pointer;
  list-style: none; /* remove default arrow */
  font-weight: 600;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1e293b;
  background: linear-gradient(180deg, #f9fafb 0%, #f1f5f9 100%);
  border-bottom: 1px dashed #e2e8f0;
  transition: background 0.3s ease, padding-left 0.3s ease;
}

/* Use a container span to hold planet + date text */
.maha-title {
  flex: 1;                 /* occupies remaining space */
  text-align: left;        /* ensures left alignment */
  display: flex;
  flex-direction: column;  /* stack name + date vertically */
  gap: 2px;
}

/* Duration badge stays right-aligned */
.maha-duration {
  margin-left: auto;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  min-width: 48px;
  text-align: center;
}

/* antardasha rows (inside expanded area) */
.antardashas .antardasha-row {
  padding: 8px 6px;
  border-bottom: 1px dashed #eef2f7;
  display: flex;
  flex-direction: column;
}
.antardashas .antardasha-row:last-child { border-bottom: none; }

/* muted text for dates */
.maha-item .muted { color: #64748b; font-size: 13px; }

/* If you had a darker background for the dasha JSON preview: */
#dashRaw {
  background: #0b1220;
  color: #dff3ff;
  padding: 12px;
  border-radius: 6px;
  max-height: 300px;
  overflow: auto;
}

/* small responsive tweak to keep boxes stacked nicely on narrow screens */
@media (max-width: 640px) {
  .predictions-row { flex-direction: column; }
  .prediction-box { max-width: 100%; }
}
/* ==========================================================
   🪐 Mahadasha Accordion Styling (Restores old arrow + indent)
   ========================================================== */

/* Base container (already exists) */
.maha-item {
  position: relative;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.25s ease-in-out;
}

/* Add subtle lift on hover */
.maha-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

/* ---------- Summary line (main Mahadasha) ---------- */
.maha-item > summary {
  cursor: pointer;
  list-style: none; /* hide default arrow */
  font-weight: 600;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #1e293b;
  background: linear-gradient(180deg, #f9fafb 0%, #f1f5f9 100%);
  border-bottom: 1px dashed #e2e8f0;
  transition: background 0.3s ease, padding-left 0.3s ease;
}

/* Slight indent when open */
.maha-item[open] > summary {
  background: #f8fafc;
  padding-left: 22px;
}

/* ---------- Custom Arrow ---------- */
.maha-item > summary::before {
  content: "▸"; /* arrow symbol */
  color: #2563eb;
  font-size: 16px;
  margin-right: 10px;
  transition: transform 0.25s ease;
}

/* Rotate when open */
.maha-item[open] > summary::before {
  transform: rotate(90deg);
}

/* ---------- Antardasha section ---------- */
.antardashas {
  padding: 6px 16px 12px 30px; /* indent */
  background: #f9fafb;
  border-left: 3px solid #cbd5e1;
  animation: slideDown 0.3s ease;
}

/* Each row */
.antardashas .antardasha-row {
  padding: 6px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 14px;
  color: #334155;
  transition: padding-left 0.25s ease;
}
.antardashas .antardasha-row:hover {
  padding-left: 6px;
  background: #f1f5f9;
}

/* Last one no border */
.antardashas .antardasha-row:last-child {
  border-bottom: none;
}

/* ---------- Animation ---------- */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Duration badge ---------- */
.maha-duration {
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  min-width: 48px;
  text-align: center;
}

/* ---------- Small responsive tweak ---------- */
@media (max-width: 600px) {
  .maha-item > summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
