/**
 * Sanatan Hindu Calendar - Kundli & Horoscope Design System
 * Sacred Golden Temples & Dark/Light Mode Visual Styling
 */

/* ==========================================================================
   COLOR SCHEME & BASE CONTROLS
   ========================================================================== */

:root {
  color-scheme: light dark;
}
[data-mode="dark"] {
  color-scheme: dark;
}
[data-mode="light"] {
  color-scheme: light;
}

/* ==========================================================================
   KUNDLI SVG CHARTS STYLES
   ========================================================================== */

.kundli-svg-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  border-radius: var(--radius-lg, 16px);
  background: var(--bg-card);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.3));
  border: 1px solid var(--border-highlight, rgba(255, 179, 0, 0.25));
  padding: 12px;
  box-sizing: border-box;
}

.kundli-svg-chart {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.chart-outer-box {
  fill: var(--bg-card);
  stroke: var(--primary-gold, #ffb300);
  stroke-width: 2.5;
}

.chart-border-line {
  fill: none;
  stroke: var(--primary-gold, #ffb300);
  stroke-width: 2;
}

.chart-inner-line {
  stroke: var(--primary-gold, #ffb300);
  stroke-width: 1.5;
  stroke-opacity: 0.85;
}

.chart-inner-diamond {
  fill: rgba(255, 179, 0, 0.04);
  stroke: var(--primary-gold, #ffb300);
  stroke-width: 1.5;
}

.chart-rashi-num {
  font-size: 13px;
  font-weight: 800;
  fill: var(--primary-gold, #ffb300);
  opacity: 0.9;
  font-family: inherit;
}

.chart-planet-text {
  font-size: 11px;
  font-weight: 700;
  fill: var(--text-primary);
  font-family: inherit;
  transition: fill 0.2s, transform 0.2s;
  cursor: pointer;
}

.chart-planet-text.planet-retro {
  fill: #f59e0b; /* Amber for Retrograde */
}

.chart-planet-text.planet-combust {
  fill: #ef4444; /* Crimson for Combust */
}

.chart-box-cell {
  fill: var(--bg-surface);
  stroke: var(--primary-gold, #ffb300);
  stroke-width: 1.2;
}

.chart-box-cell.cell-lagna {
  fill: rgba(255, 179, 0, 0.12);
}

.chart-rashi-tag {
  font-size: 9.5px;
  font-weight: 600;
  fill: var(--text-secondary);
  font-family: inherit;
}

.chart-center-hollow {
  fill: var(--bg-card);
  stroke: var(--primary-gold, #ffb300);
  stroke-width: 1.5;
}

.chart-center-title {
  font-size: 14px;
  font-weight: 800;
  fill: var(--primary-gold, #ffb300);
  font-family: inherit;
}

.chart-center-sub {
  font-size: 10px;
  font-weight: 500;
  fill: var(--text-secondary);
  font-family: inherit;
}

.chart-title-tag {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-gold, #ffb300);
  margin-top: 8px;
}

/* ==========================================================================
   KUNDLI FORM & CONTROLS
   ========================================================================== */

.kundli-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight, rgba(255, 179, 0, 0.25));
  border-radius: var(--radius-lg, 16px);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm, 0 4px 16px rgba(0, 0, 0, 0.15));
}

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

.kundli-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kundli-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0.92;
}

.kundli-form-input,
.kundli-form-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
  color: var(--text-primary);
  border-radius: var(--radius-sm, 10px);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kundli-form-input::placeholder {
  color: var(--text-muted);
}

.kundli-form-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.kundli-form-input:focus,
.kundli-form-select:focus {
  border-color: var(--primary-gold, #ffb300);
  box-shadow: 0 0 0 3px rgba(255, 179, 0, 0.2);
}

/* Date and Time Picker Indicators */
[data-mode="dark"] .kundli-form-input::-webkit-calendar-picker-indicator {
  filter: invert(0.85) sepia(1) saturate(5) hue-rotate(5deg);
  cursor: pointer;
  opacity: 0.85;
}
[data-mode="light"] .kundli-form-input::-webkit-calendar-picker-indicator {
  filter: invert(0.2) sepia(1) saturate(5) hue-rotate(5deg);
  cursor: pointer;
  opacity: 0.85;
}

.kundli-submit-btn {
  width: 100%;
  background: var(--gradient-gold, linear-gradient(135deg, #ffb300, #ff8f00));
  color: #120e0a;
  border: none;
  font-weight: 800;
  font-size: 15px;
  border-radius: var(--radius-md, 12px);
  padding: 13px 20px;
  cursor: pointer;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(255, 179, 0, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.kundli-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 179, 0, 0.45);
}

/* ==========================================================================
   KUNDLI REPORT TABS & TABLES
   ========================================================================== */

.kundli-tabs-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.kundli-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.kundli-tab-chip {
  flex-shrink: 0;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.kundli-tab-chip.active {
  background: var(--primary-gold, #ffb300);
  color: #120e0a;
  border-color: var(--primary-gold, #ffb300);
  box-shadow: 0 2px 8px rgba(255, 179, 0, 0.3);
}

.kundli-tab-pane {
  display: none;
}
.kundli-tab-pane.active {
  display: block;
}

/* Avakhada Chakra Grid */
.avakhada-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.avakhada-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight, rgba(255, 179, 0, 0.15));
  border-radius: var(--radius-sm, 10px);
  padding: 12px;
}

.avakhada-lbl {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.avakhada-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Planetary Table */
.kundli-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  background: var(--bg-card);
}

.kundli-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.kundli-table th {
  background: var(--bg-surface);
  color: var(--primary-gold, #ffb300);
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.kundli-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.kundli-table tr:hover {
  background: rgba(255, 179, 0, 0.06);
}

/* Dasha Timeline */
.dasha-tree-card {
  background: var(--bg-surface);
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border-highlight, rgba(255, 179, 0, 0.2));
  padding: 16px;
  margin-bottom: 12px;
}

.dasha-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dasha-badge {
  background: rgba(255, 179, 0, 0.18);
  color: var(--primary-gold, #ffb300);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.dasha-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}

.dasha-progress-fill {
  height: 100%;
  background: var(--primary-gold, #ffb300);
  border-radius: 3px;
}

/* Yogas & Doshas Cards */
.yoga-item-card,
.dosha-item-card {
  background: var(--bg-surface);
  border-left: 4px solid var(--primary-gold, #ffb300);
  border-radius: var(--radius-sm, 10px);
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px;
  margin-bottom: 14px;
}

.yoga-item-card.inauspicious,
.dosha-item-card.has-dosha {
  border-left-color: #ef4444;
}

.yoga-header,
.dosha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.yoga-title,
.dosha-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-gold, #ffb300);
}

.dosha-item-card.has-dosha .dosha-title {
  color: #ef4444;
}

.dosha-remedy-box {
  background: rgba(255, 179, 0, 0.06);
  border: 1px dashed rgba(255, 179, 0, 0.3);
  border-radius: var(--radius-xs, 6px);
  padding: 10px 14px;
  margin-top: 10px;
}

/* Ashtakoot 36 Guna Score Circle */
.guna-score-hero {
  text-align: center;
  padding: 24px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--border-highlight, rgba(255, 179, 0, 0.3));
  margin-bottom: 24px;
}

.guna-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(255, 179, 0, 0.12);
  border: 3px solid var(--primary-gold, #ffb300);
}

.guna-circle.match-good {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.guna-circle.match-bad {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.guna-score-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary-gold, #ffb300);
  line-height: 1;
}

.guna-score-max {
  font-size: 12px;
  color: var(--text-secondary);
}

.guna-verdict {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   PRINT / PDF STYLING (CLEAN HOROSCOPE EXPORT)
   ========================================================================== */

@media print {
  body, html {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 11pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .site-header,
  .app-bottom-nav,
  .panchang-hero-banner,
  .kundli-input-card,
  .kundli-tabs-scroll,
  .kundli-tab-chip,
  .action-btn,
  .site-footer,
  #sidebar-drawer,
  #sidebar-backdrop,
  .pwa-install-banner,
  .kundli-submit-btn,
  #btn-kundli-pick-city,
  .kundli-style-selector-wrap {
    display: none !important;
  }

  .festivals-container,
  .site-main,
  .app-content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #kundli-report-container {
    display: block !important;
  }

  .kundli-tab-pane {
    display: none;
  }

  .kundli-tab-pane.active,
  .kundli-tab-pane.print-visible,
  #kundli-report-container.print-all-panes .kundli-tab-pane {
    display: block !important;
    margin-bottom: 20px;
    page-break-inside: avoid;
  }

  .kundli-svg-container,
  .avakhada-card,
  .yoga-item-card,
  .dosha-item-card,
  .kundli-table-wrap {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #d1d5db !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .kundli-table th {
    background: #f3f4f6 !important;
    color: #111827 !important;
  }

  .kundli-table td {
    color: #1f2937 !important;
    border-bottom: 1px solid #e5e7eb !important;
  }

  .chart-outer-box,
  .chart-box-cell {
    fill: #ffffff !important;
    stroke: #b45309 !important;
  }

  .chart-border-line,
  .chart-inner-line,
  .chart-inner-diamond {
    stroke: #b45309 !important;
  }

  .chart-planet-text {
    fill: #111827 !important;
  }

  .chart-rashi-num {
    fill: #b45309 !important;
  }
}
