/* AstroKundli Stylesheet - Deep Cosmos & Elegant Light Parchment Themes */

:root, [data-theme="light"] {
  --bg-deep: #fcfbf7;
  --bg-body-gradient: 
    radial-gradient(circle at 15% 15%, rgba(217, 119, 6, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(180, 83, 9, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
  --bg-header: rgba(255, 255, 255, 0.94);
  --bg-card: #ffffff;
  --bg-card-hover: #faf6ee;
  --bg-input: #ffffff;
  --border-input: #d5c9b7;
  --border-gold: rgba(217, 119, 6, 0.28);
  --border-gold-bright: #b45309;
  --gold-primary: #b45309;
  --gold-glow: #d97706;
  --text-main: #1e293b;
  --text-muted: #475569;
  --text-dim: #64748b;
  --brand-gradient: linear-gradient(135deg, #78350f 30%, #b45309 100%);
  --hero-title-gradient: linear-gradient(180deg, #1e293b 30%, #334155 70%, #b45309 100%);
  --card-header-h2: #78350f;
  --card-inner-box: #fcf8f1;
  --accent-purple: #7c3aed;
  --accent-blue: #2563eb;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-gold: 0 4px 20px rgba(180, 83, 9, 0.08);
  --shadow-card: 0 6px 24px rgba(148, 115, 60, 0.08);
  --footer-bg: #f5ede0;
}

[data-theme="dark"] {
  --bg-deep: #070814;
  --bg-body-gradient: 
    radial-gradient(circle at 15% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(245, 166, 35, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 85%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  --bg-header: rgba(7, 8, 20, 0.85);
  --bg-card: rgba(18, 19, 43, 0.82);
  --bg-card-hover: rgba(28, 30, 64, 0.9);
  --bg-input: rgba(10, 11, 26, 0.8);
  --border-input: rgba(255, 255, 255, 0.15);
  --border-gold: rgba(245, 166, 35, 0.32);
  --border-gold-bright: #ffd700;
  --gold-primary: #f5a623;
  --gold-glow: #ffd700;
  --text-main: #f0f2ff;
  --text-muted: #9ba1c7;
  --text-dim: #6c729c;
  --brand-gradient: linear-gradient(135deg, #fff 40%, var(--gold-glow) 100%);
  --hero-title-gradient: linear-gradient(180deg, #ffffff 30%, #e2e8f0 70%, #f5a623 100%);
  --card-header-h2: #ffffff;
  --card-inner-box: rgba(10, 11, 26, 0.9);
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --shadow-gold: 0 4px 24px rgba(245, 166, 35, 0.15);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --footer-bg: rgba(4, 5, 14, 0.95);
}

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

body {
  background-color: var(--bg-deep);
  background-image: var(--bg-body-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-gold);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 8px 0;
}

.header-main-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  flex-shrink: 0;
}

.logo:hover .brand-logo-img {
  transform: rotate(30deg) scale(1.08);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.7);
}

.logo-icon {
  display: none;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.48rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}

.brand-subtitle {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gold-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 5px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold-primary);
  background: rgba(245, 166, 35, 0.12);
}

.nav-link.ai-link {
  color: var(--accent-purple);
}

@media (min-width: 992px) {
  .header-main-bar {
    display: contents;
  }
  .header-actions {
    order: 3;
  }
  .nav-links {
    order: 2;
  }
  .logo {
    order: 1;
  }
}


/* Theme Toggle Bar (Segmented Switch Bar) */
.theme-toggle-bar {
  display: inline-flex;
  align-items: center;
  background: var(--card-inner-box);
  border: 1.5px solid var(--border-gold);
  border-radius: 24px;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  user-select: none;
}

.theme-bar-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.theme-bar-btn:hover {
  color: var(--gold-primary);
}

.theme-bar-btn.active {
  background: var(--gold-primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(180, 83, 9, 0.35);
}

[data-theme="dark"] .theme-bar-btn.active {
  background: linear-gradient(135deg, #ffd700, #f5a623);
  color: #0b0c1e;
  box-shadow: 0 2px 12px rgba(245, 166, 35, 0.45);
}

.theme-bar-icon {
  font-size: 0.95rem;
}

/* Language Switcher Segmented Control */
.lang-selector-group {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.lang-btn.active {
  background: var(--gold-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.3);
}

[data-theme="dark"] .lang-btn.active {
  background: var(--gold-primary);
  color: #0b0c1e;
}

/* Legacy language button */
.lang-switch-btn {
  display: none;
}

/* Tamil & Telugu Typography enhancements */
body.lang-ta {
  font-family: 'Noto Sans Tamil', var(--font-sans);
}
body.lang-ta .hero-title,
body.lang-ta h1,
body.lang-ta h2,
body.lang-ta h3,
body.lang-ta .brand-title {
  font-family: 'Noto Sans Tamil', var(--font-serif);
  line-height: 1.35;
}

body.lang-te {
  font-family: 'Noto Sans Telugu', var(--font-sans);
}
body.lang-te .hero-title,
body.lang-te h1,
body.lang-te h2,
body.lang-te h3,
body.lang-te .brand-title {
  font-family: 'Noto Sans Telugu', var(--font-serif);
  line-height: 1.35;
}

/* Hero */
.hero-section {
  padding: 56px 0 32px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  color: var(--gold-primary);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  line-height: 1.25;
  background: var(--hero-title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Cards & Layout */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 32px;
  margin-bottom: 32px;
}

.calculator-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  box-shadow: var(--shadow-card), var(--shadow-gold);
  padding: 36px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border-gold);
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.card-header h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--card-header-h2);
}

.quick-samples {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-dim);
}

.sample-btn {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.sample-btn:hover {
  background: rgba(245, 166, 35, 0.2);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.2);
}

.form-actions {
  margin-top: 28px;
  text-align: center;
}

.submit-btn {
  background: linear-gradient(135deg, #ffd700, #f5a623);
  color: #0b0c1e;
  border: none;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 15px 36px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.4);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(245, 166, 35, 0.6);
}

/* Panchang Bar */
.panchang-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  padding: 22px 28px;
}

.panchang-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.p-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.p-value.highlight {
  color: var(--gold-glow);
  font-family: var(--font-serif);
}

/* Charts Section */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  color: var(--card-header-h2);
}

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

.chart-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-group {
  display: flex;
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  overflow: hidden;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn.active {
  background: var(--gold-primary);
  color: #ffffff;
}

[data-theme="dark"] .toggle-btn.active {
  color: #0c0d20;
}

.btn-secondary {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(245, 166, 35, 0.15);
  border-color: var(--gold-primary);
}

.chart-container-wrap {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 28px;
  align-items: start;
}

.chart-display-card {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
}

.vedic-chart-svg {
  width: 100%;
  max-width: 400px;
  height: auto;
  aspect-ratio: 1 / 1;
}

.chart-legend-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--gold-primary);
  margin-bottom: 6px;
}

.legend-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.houses-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
}

.house-legend-item {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.house-num {
  font-weight: 700;
  color: var(--gold-primary);
  margin-right: 6px;
}

.house-planets {
  color: var(--text-main);
  font-weight: 600;
}

.planet-colors-key {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-gold);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.badge-dot.green { background: #16a34a; }
.badge-dot.blue { background: #2563eb; }
.badge-dot.white { background: #94a3b8; }
.badge-dot.red { background: #dc2626; }

[data-theme="dark"] .badge-dot.green { background: #4ade80; }
[data-theme="dark"] .badge-dot.blue { background: #60a5fa; }
[data-theme="dark"] .badge-dot.white { background: #ffffff; }
[data-theme="dark"] .badge-dot.red { background: #f87171; }

/* Table */
.table-responsive {
  overflow-x: auto;
}

.planets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.planets-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--card-inner-box);
  color: var(--gold-primary);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-gold);
}

.planets-table td {
  padding: 12px 16px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-gold);
}

.planets-table tr:hover {
  background: var(--bg-card-hover);
}

.dignity-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.dignity-badge.exalted { background: rgba(74, 222, 128, 0.15); color: #16a34a; border: 1px solid rgba(74, 222, 128, 0.3); }
.dignity-badge.own { background: rgba(96, 165, 250, 0.15); color: #2563eb; border: 1px solid rgba(96, 165, 250, 0.3); }
.dignity-badge.friendly { background: rgba(250, 204, 21, 0.15); color: #d97706; border: 1px solid rgba(250, 204, 21, 0.3); }
.dignity-badge.neutral { background: var(--card-inner-box); color: var(--text-muted); border: 1px solid var(--border-gold); }
.dignity-badge.debilitated { background: rgba(248, 113, 113, 0.15); color: #dc2626; border: 1px solid rgba(248, 113, 113, 0.3); }

[data-theme="dark"] .dignity-badge.exalted { color: #4ade80; }
[data-theme="dark"] .dignity-badge.own { color: #60a5fa; }
[data-theme="dark"] .dignity-badge.friendly { color: #facc15; }
[data-theme="dark"] .dignity-badge.neutral { color: #e2e8f0; }
[data-theme="dark"] .dignity-badge.debilitated { color: #f87171; }

/* Dasha Section */
.current-dasha-banner {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(124, 58, 237, 0.08));
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

[data-theme="dark"] .current-dasha-banner {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(245, 166, 35, 0.15));
}

.dasha-badge-active {
  background: var(--gold-primary);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

[data-theme="dark"] .dasha-badge-active {
  color: #0b0c1e;
}

.dasha-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--card-header-h2);
  margin-right: 12px;
}

.dasha-dates {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.dasha-row {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.dasha-row-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s;
}

.dasha-row-header:hover {
  background: var(--bg-card-hover);
}

.dasha-row-header strong {
  color: var(--text-main);
}

.dasha-row.active .dasha-row-header {
  border-left: 4px solid var(--gold-primary);
  background: rgba(245, 166, 35, 0.1);
}

.antardasha-subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-gold);
}

.antardasha-card {
  padding: 8px 12px;
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  font-size: 0.82rem;
}

/* Dosha & Yogas */
.dosha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.dosha-card {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 20px;
}

.dosha-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.dosha-icon {
  font-size: 1.8rem;
}

.dosha-card-header h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--card-header-h2);
  margin-bottom: 4px;
}

.dosha-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.dosha-status-pill.safe { background: rgba(74, 222, 128, 0.15); color: #16a34a; border: 1px solid rgba(74, 222, 128, 0.3); }
.dosha-status-pill.warning { background: rgba(250, 204, 21, 0.15); color: #d97706; border: 1px solid rgba(250, 204, 21, 0.3); }
.dosha-status-pill.danger { background: rgba(248, 113, 113, 0.15); color: #dc2626; border: 1px solid rgba(248, 113, 113, 0.3); }

[data-theme="dark"] .dosha-status-pill.safe { color: #4ade80; }
[data-theme="dark"] .dosha-status-pill.warning { color: #facc15; }
[data-theme="dark"] .dosha-status-pill.danger { color: #f87171; }

.dosha-description {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.yogas-container h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--gold-primary);
  margin-bottom: 16px;
}

.yogas-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.yoga-card {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 16px;
}

.yoga-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 4px;
}

[data-theme="dark"] .yoga-name {
  color: var(--gold-glow);
}

.yoga-type {
  font-size: 0.76rem;
  text-transform: uppercase;
  color: var(--accent-purple);
  font-weight: 600;
  margin-bottom: 8px;
}

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

/* AI Astrologer */
.ai-astrologer-section {
  border-color: rgba(192, 132, 252, 0.4);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15);
}

.ai-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.3);
  color: var(--accent-purple);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.ai-reading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.ai-reading-card {
  background: var(--card-inner-box);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 12px;
  padding: 20px;
}

.ai-card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--card-header-h2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-card-body {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.ai-chat-box {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 24px;
}

.ai-chat-box h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--card-header-h2);
  margin-bottom: 12px;
}

.ai-input-wrap {
  display: flex;
  gap: 12px;
}

.ai-input-wrap input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.95rem;
}

.ai-ask-btn {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.ai-ask-btn:hover {
  filter: brightness(1.15);
}

.ai-answer-wrap {
  margin-top: 16px;
  padding: 16px;
  background: rgba(139, 92, 246, 0.08);
  border-left: 3px solid #a855f7;
  border-radius: 6px;
}

.ai-answer-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-purple);
  margin-bottom: 6px;
}

.ai-answer-content {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.6;
  white-space: pre-wrap;
}

.ai-actions {
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #c084fc, #9333ea);
  color: #fff;
  border: none;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.6);
}


/* Footer */
.site-footer {
  border-top: 1px solid var(--border-gold);
  background: var(--footer-bg);
  padding: 48px 0 24px;
  margin-top: 64px;
  transition: background 0.3s ease;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.footer-brand-header h4 {
  margin-bottom: 0 !important;
}

.footer-logo-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.footer-col h4 {
  font-family: var(--font-serif);
  color: var(--gold-primary);
  font-size: 1.1rem;
  margin-bottom: 14px;
}

.footer-col p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-col ul li a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: var(--gold-primary);
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid var(--border-gold);
  padding-top: 24px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ========================================================
   COMPREHENSIVE MOBILE RESPONSIVE SUITE (Android & iOS)
   ======================================================== */

/* Global Mobile Fixes */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Tablet & Smaller Laptops (max-width: 991px) */
@media (max-width: 991px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 0 6px;
    min-height: auto;
  }

  .header-main-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .brand-logo-img {
    width: 40px;
    height: 40px;
  }

  .brand-title {
    font-size: 1.38rem;
  }

  .brand-subtitle {
    font-size: 0.65rem;
  }

  .header-actions {
    gap: 8px;
  }

  .nav-links {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 6px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    font-size: 0.82rem;
    padding: 5px 10px;
    background: var(--card-inner-box);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    flex-shrink: 0;
  }

  .chart-container-wrap {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .chart-display-card {
    justify-content: center;
  }

  .vedic-chart-svg {
    max-width: 380px;
    margin: 0 auto;
  }
}

/* Smartphones (Android & iOS iPhones: max-width: 768px) */
@media (max-width: 768px) {
  /* Prevent iOS Safari auto-zoom on input focus */
  input[type="text"],
  input[type="date"],
  input[type="time"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  .container {
    padding: 0 14px;
  }

  /* Header Controls on Mobile */
  .theme-bar-btn {
    padding: 5px 9px;
    font-size: 0.76rem;
  }

  .lang-btn {
    padding: 5px 9px;
    font-size: 0.76rem;
  }

  /* Hero Section */
  .hero-section {
    padding: 24px 0 16px;
  }

  .hero-badge {
    font-size: 0.72rem;
    padding: 4px 10px;
    line-height: 1.4;
    margin-bottom: 12px;
  }

  .hero-title {
    font-size: 1.85rem;
    line-height: 1.22;
    margin-bottom: 10px;
  }

  .hero-subtitle {
    font-size: 0.90rem;
    line-height: 1.5;
  }

  /* Form & Calculator */
  .calculator-card {
    padding: 20px 14px;
    border-radius: 14px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .quick-samples {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sample-btn {
    font-size: 0.74rem;
    padding: 6px 10px;
    min-height: 36px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .form-actions {
    margin-top: 20px;
  }

  .submit-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 1.05rem;
    min-height: 50px;
    border-radius: 25px;
  }

  /* Panchang Bar */
  .panchang-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px 14px;
  }

  .panchang-item {
    padding: 6px 4px;
  }

  .p-label {
    font-size: 0.70rem;
  }

  .p-value {
    font-size: 0.94rem;
  }

  /* Charts Section */
  .card {
    padding: 20px 14px;
    border-radius: 14px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
  }

  .section-header h2 {
    font-size: 1.4rem;
  }

  .chart-controls {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .chart-controls::-webkit-scrollbar {
    display: none;
  }

  .toggle-btn {
    padding: 7px 11px;
    font-size: 0.78rem;
    min-height: 38px;
  }

  .btn-secondary {
    padding: 7px 12px;
    font-size: 0.78rem;
    min-height: 38px;
  }

  .vedic-chart-svg {
    max-width: 320px;
  }

  /* Responsive Tables (Planets & Dashas) */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin: 0 -4px;
    padding: 0 4px;
  }

  .planets-table th,
  .planets-table td,
  .dasha-table th,
  .dasha-table td {
    padding: 10px 8px;
    font-size: 0.80rem;
    white-space: nowrap;
  }

  /* Grids: Doshas, Bhavas & AI */
  .dosha-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
  }

  .bhavas-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ai-reading-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
  }

  .ai-input-wrap {
    flex-direction: column;
    gap: 10px;
  }

  .ai-ask-btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    border-radius: 8px;
  }

  .ai-actions .btn-primary {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    font-size: 0.98rem;
    border-radius: 24px;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-footer {
    padding: 36px 0 20px;
    margin-top: 40px;
  }
}

/* Compact Phones (iPhone SE, Galaxy Mini: max-width: 480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .brand-logo-img {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .brand-subtitle {
    font-size: 0.58rem;
  }

  /* On very small phones, hide text label inside theme button to save horizontal room */
  .theme-bar-btn {
    padding: 4px 7px;
  }

  .theme-bar-text {
    display: none;
  }

  .lang-btn {
    padding: 4px 7px;
    font-size: 0.70rem;
  }

  .hero-title {
    font-size: 1.55rem;
  }

  .card {
    padding: 16px 12px;
  }

  .vedic-chart-svg {
    max-width: 290px;
  }

  .panchang-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px 10px;
  }
}

/* Ultra-compact screens (max-width: 360px) */
@media (max-width: 360px) {
  .panchang-bar {
    grid-template-columns: 1fr;
  }

  .vedic-chart-svg {
    max-width: 250px;
  }
}

/* Print Styles */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .site-header, .calculator-section, .chart-controls, .ai-actions, .site-footer {
    display: none !important;
  }
  .card {
    background: #fff;
    color: #000;
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
  .panchang-bar, .panchang-item {
    color: #000;
  }
}

/* ==================== CITY SEARCH & AUTOCOMPLETE STYLES ==================== */
.city-search-box-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  width: 100%;
}

.city-input-field-group {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.city-icon {
  position: absolute;
  left: 12px;
  font-size: 1rem;
  pointer-events: none;
  opacity: 0.8;
}

.city-search-input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.city-search-input:focus {
  border-color: var(--gold-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.btn-clear-city {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  display: none;
}

.btn-clear-city:hover {
  color: var(--text-main);
}

.city-suggestions-dropdown {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-gold);
  box-shadow: 0 8px 24px var(--shadow-color);
}

.city-suggestion-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-gold);
  font-size: 0.9rem;
  color: var(--text-main);
  transition: background 0.15s ease;
}

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

.city-suggestion-item:hover,
.city-suggestion-item.active {
  background: var(--bg-card-hover);
  color: var(--gold-primary);
}

.city-item-state {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.city-select-wrapper {
  margin-top: 2px;
}

.city-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-gold);
  background: var(--card-inner-box);
  color: var(--text-main);
  font-size: 0.85rem;
}

/* ==================== NADI SECTION STYLES ==================== */
.nadi-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nadi-header-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 8px;
}

[data-theme="dark"] .nadi-header-badge {
  color: #34d399;
  background: rgba(16, 185, 129, 0.2);
}

/* Primary Native Nadi & Dosha Card */
.nadi-primary-card {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}

.nadi-badge-pill {
  position: absolute;
  top: 16px;
  right: 18px;
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--gold-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.25);
}

.nadi-dosha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.nadi-dosha-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-gold);
}

.nadi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nadi-highlight {
  font-size: 1.1rem;
  color: var(--gold-primary);
}

.nadi-dosha-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-main);
  border-top: 1px dashed var(--border-gold);
  padding-top: 12px;
  margin-top: 12px;
}

/* Sub-blocks */
.nadi-sub-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nadi-sub-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.nadi-sub-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: -4px;
  margin-bottom: 6px;
}

/* 4-Direction Grid */
.nadi-direction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.direction-card {
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
  background: var(--card-inner-box);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.direction-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.dir-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
}

.dir-east .dir-header { color: #dc2626; }
.dir-south .dir-header { color: #d97706; }
.dir-west .dir-header { color: #2563eb; }
.dir-north .dir-header { color: #059669; }

[data-theme="dark"] .dir-east .dir-header { color: #f87171; }
[data-theme="dark"] .dir-south .dir-header { color: #fbbf24; }
[data-theme="dark"] .dir-west .dir-header { color: #60a5fa; }
[data-theme="dark"] .dir-north .dir-header { color: #34d399; }

.dir-planets {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.5;
}

/* Karaka Synthesis Cards */
.nadi-karaka-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.nadi-karaka-card {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.karaka-card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.karaka-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-primary);
  letter-spacing: 0.04em;
}

.karaka-card-header h4 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-serif);
  color: var(--text-main);
}

.karaka-card-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
}

.karaka-domains {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.domain-tag {
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(217, 119, 6, 0.12);
  color: var(--gold-primary);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

/* Milestones List */
.nadi-milestones-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.milestone-item {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.milestone-age-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--gold-primary);
  color: #fff;
  width: fit-content;
}

.milestone-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
}

.milestone-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Ayurvedic Health Card */
.nadi-health-card {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.health-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.health-col-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-primary);
}

.health-col-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-main);
}

/* Remedies Grid */
.nadi-remedies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.remedy-card {
  background: var(--card-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.remedy-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--gold-primary);
}

.remedy-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-main);
}

/* Match Tester */
.nadi-match-tester {
  margin-top: 10px;
  background: var(--card-inner-box);
  border: 1.5px solid var(--gold-primary);
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.match-tester-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.match-tester-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-primary);
  letter-spacing: 0.05em;
}

.match-tester-header h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-main);
}

.match-tester-header p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.match-tester-controls {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.partner-nakshatra-select {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 0.92rem;
  min-width: 240px;
}

.match-result-card {
  margin-top: 8px;
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.match-score-pill {
  position: absolute;
  top: 14px;
  right: 18px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 800;
  background: #16a34a;
  color: #fff;
}

.match-score-pill.dosha {
  background: #dc2626;
}

.match-score-pill.mitigated {
  background: #d97706;
}

.match-result-card h4 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-main);
}

.match-result-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}
