/* 
  ASTRO ALAXIS - DESIGN SYSTEM
  Aesthetic: Celestial Obsidian & Imperial Starlight Gold Glassmorphism
*/

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #080a12;
  --bg-secondary: #0f1424;
  --bg-tertiary: #171f38;
  --card-bg: rgba(18, 24, 46, 0.72);
  --card-border: rgba(212, 175, 55, 0.22);
  --card-border-glow: rgba(230, 195, 92, 0.45);
  
  --gold-primary: #e6c35c;
  --gold-secondary: #d4af37;
  --gold-dark: #aa8620;
  --gold-glow: rgba(230, 195, 92, 0.25);
  
  --text-main: #f0f3fa;
  --text-muted: #94a3b8;
  --text-gold: #f8df8c;
  
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-purple: #a855f7;

  --font-serif: 'Cinzel', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 12px 36px -8px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-gold: 0 0 25px rgba(212, 175, 55, 0.25);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(212, 175, 55, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(56, 189, 248, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(15, 20, 36, 0.9) 0%, var(--bg-primary) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header & Navigation */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  background: rgba(10, 14, 28, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--gold-glow);
  font-size: 1.5rem;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: linear-gradient(90deg, #fff, var(--gold-primary), var(--gold-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-gold);
  opacity: 0.85;
}

.header-badges {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--card-border);
  color: var(--text-gold);
}

.badge-tag.pulse::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Master Layout */
.app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
}

/* Input Form Section */
.hero-input-panel {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.hero-input-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.panel-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem 1.25rem;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-input, .form-select {
  background: rgba(15, 20, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: all 0.25s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
  background: rgba(23, 31, 56, 0.95);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #0b0f1d;
  font-weight: 700;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  letter-spacing: 0.5px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 18px rgba(212, 175, 55, 0.35);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--text-gold);
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-primary);
}

/* Navigation Tabs */
.tabs-navigation {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.tab-button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-button.active {
  color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--card-border);
  box-shadow: 0 0 12px var(--gold-glow);
}

/* Tab Content */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Chart & Dashboard Grid */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 2rem;
}

@media (max-width: 1200px) {
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chart-controls {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.chart-svg-container {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  background: #080c18;
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8), 0 0 15px rgba(212, 175, 55, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chart-svg-container svg {
  width: 100%;
  height: 100%;
}

/* Data Tables */
.table-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}

.astro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.astro-table th {
  background: rgba(15, 20, 36, 0.9);
  color: var(--text-gold);
  font-family: var(--font-serif);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--card-border);
  letter-spacing: 0.5px;
}

.astro-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.astro-table tr:hover td {
  background: rgba(212, 175, 55, 0.05);
}

/* Planet Badges & Tags */
.status-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.pill-exalted { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.pill-debilitated { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.4); }
.pill-own { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.pill-combust { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.pill-retro { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }

/* Lo Shu Magic Square */
.loshu-container {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 8px;
  margin: 1.5rem auto;
  justify-content: center;
}

.loshu-cell {
  background: rgba(15, 20, 36, 0.95);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.25s ease;
}

.loshu-cell:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 15px var(--gold-glow);
  transform: scale(1.03);
}

.loshu-num {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-gold);
}

.loshu-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.loshu-cell.empty {
  opacity: 0.4;
  border-style: dashed;
}

/* Vastu Wheel */
.vastu-wheel-box {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

/* Cards Grid */
.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.info-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.info-card h4 {
  font-family: var(--font-serif);
  color: var(--text-gold);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Accordion for Dasha */
.dasha-accordion-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  background: rgba(15, 20, 36, 0.6);
  overflow: hidden;
}

.dasha-header {
  padding: 0.85rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.dasha-header:hover {
  background: rgba(212, 175, 55, 0.08);
}

.dasha-sub-list {
  padding: 0.5rem 1.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 12, 24, 0.4);
}

/* Toast & Loading */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(15, 20, 36, 0.95);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-gold);
  z-index: 9999;
  display: none;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Master Footer */
.master-footer {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 2.5rem;
}

.master-footer a {
  color: var(--text-gold);
  text-decoration: none;
}

/* =====================================================================
   UPGRADE: CORPORATE COMPACT HORIZONTAL CALCULATION TOOLBAR
   Astrosage & ClickAstro Gold Standard Layout
   ===================================================================== */
.calc-horizontal-toolbar {
  background: rgba(15, 20, 36, 0.92);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
}

.calc-toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.calc-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.calc-label-micro {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-gold);
}

.calc-input-micro {
  background: rgba(8, 11, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.calc-input-micro:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-glow);
}

/* Mode Switcher in Header */
.mode-switch-wrapper {
  display: flex;
  background: rgba(8, 12, 24, 0.9);
  padding: 3px;
  border-radius: 30px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  gap: 2px;
}

.mode-switch-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mode-switch-btn.active {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #000;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.35);
}

/* Tenant Inspector Alert Banner */
.inspector-banner {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.15), rgba(15, 20, 36, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
}

/* 16 Shodashvargas Category Grouping */
.varga-groups-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.varga-group-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.varga-category-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-gold);
  text-transform: uppercase;
  min-width: 80px;
  letter-spacing: 0.5px;
}

.btn-varga-chip {
  background: rgba(15, 20, 36, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-varga-chip:hover {
  border-color: var(--gold-primary);
  color: #fff;
}

.btn-varga-chip.active {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-primary);
  color: var(--text-gold);
  font-weight: 700;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

/* 5-Tier Vimshottari Tree Hierarchy */
.dasha-tier-5-hero {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16), rgba(8, 12, 24, 0.95));
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.dasha-tree-row {
  border-left: 2px solid rgba(212, 175, 55, 0.3);
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  margin-top: 0.35rem;
}

.dasha-tree-table {
  width: 100%;
  font-size: 0.78rem;
  border-collapse: collapse;
}

.dasha-tree-table th {
  padding: 4px 8px;
  color: var(--text-gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.dasha-tree-table td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.badge-active-level {
  background: #10b981;
  color: #000;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.65rem;
  margin-left: 4px;
}
