/* ═══════════════════════════════════════════
   వేదకాలం — VedaKalam Design System
   Theme: Traditional + Modern, Dark/Light
   ═══════════════════════════════════════════ */

:root {
  /* Light Theme (Default) */
  --bg-primary: #FFF8F0;
  --bg-secondary: #FFF1E6;
  --bg-card: #FFFFFF;
  --bg-card-alt: #FFF5EB;
  --bg-nav: #8B1A1A;
  --bg-nav-hover: #A0522D;
  --bg-accent: #FF6B00;
  --bg-accent2: #D4380D;
  --bg-good: #52C41A;
  --bg-bad: #FF4D4F;
  --bg-warn: #FAAD14;
  --bg-info: #1890FF;

  --text-primary: #2C1810;
  --text-secondary: #5C4033;
  --text-muted: #8B7355;
  --text-inverse: #FFFFFF;
  --text-accent: #D4380D;
  --text-good: #389E0D;
  --text-bad: #CF1322;

  --border-light: #F0D9C0;
  --border-card: #E8D5C0;
  --shadow-card: 0 2px 8px rgba(139,26,26,0.08);
  --shadow-hover: 0 4px 16px rgba(139,26,26,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-telugu: "Noto Sans Telugu", "Mandali", -apple-system, sans-serif;
  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --bg-primary: #0D0D1A;
  --bg-secondary: #141428;
  --bg-card: #1A1A35;
  --bg-card-alt: #1E1E3A;
  --bg-nav: #1A0A2E;
  --bg-nav-hover: #2D1B4E;
  --bg-accent: #FF8C00;
  --bg-accent2: #FF6347;

  --text-primary: #F0E6D6;
  --text-secondary: #C4B098;
  --text-muted: #8B7355;
  --text-inverse: #FFFFFF;
  --text-accent: #FFB347;
  --text-good: #73D13D;
  --text-bad: #FF7875;

  --border-light: #2A2A4A;
  --border-card: #333355;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.5);
}

/* ═══ Reset ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
html, body { overscroll-behavior: contain; }

body {
  font-family: var(--font-telugu);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  padding-bottom: 70px;
}

a { color: var(--text-accent); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ═══ Top Header ═══ */
.top-header {
  background: linear-gradient(135deg, #8B1A1A 0%, #CD5C5C 50%, #8B4513 100%);
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .top-header {
  background: linear-gradient(135deg, #1A0A2E 0%, #2D1B4E 50%, #0D0D1A 100%);
}
.top-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  animation: shimmer 8s infinite linear;
}
@keyframes shimmer { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.top-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #FFD700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}
.top-header .subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.8);
  margin-top: 2px;
  position: relative;
  z-index: 1;
}
.top-header .date-line {
  font-size: 13px;
  color: #FFF;
  margin-top: 8px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* Theme Toggle */
.theme-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #FFD700;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:active { transform: scale(0.9); }

/* ═══ Navigation ═══ */
.main-nav {
  background: var(--bg-nav);
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 2px solid rgba(255,215,0,0.3);
}
.main-nav::-webkit-scrollbar { display: none; }

.nav-list {
  display: flex;
  list-style: none;
  min-width: max-content;
}
.nav-item {
  display: block;
  padding: 12px 14px;
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
  text-align: center;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover, .nav-item.active {
  background: var(--bg-nav-hover);
  color: #FFD700;
  border-bottom-color: #FFD700;
}
.nav-item .nav-icon { font-size: 16px; display: block; margin-bottom: 2px; }

/* ═══ Container ═══ */
.container { max-width: 720px; margin: 0 auto; padding: 12px; }

/* ═══ Section Title ═══ */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-accent);
  margin: 20px 0 10px;
  padding: 8px 12px;
  background: var(--bg-card-alt);
  border-left: 4px solid var(--bg-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ═══ Cards ═══ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.card-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.card-extra {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.card-highlight {
  border-left: 4px solid var(--bg-accent);
  background: var(--bg-card-alt);
}

/* ═══ Panchang Table ═══ */
.panch-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  transition: var(--transition);
}
.panch-row:last-child { border-bottom: none; }
.panch-row:hover { background: var(--bg-card-alt); }
.panch-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 40%;
  display: flex;
  align-items: center;
  gap: 6px;
}
.panch-value {
  text-align: right;
  color: var(--text-primary);
  font-weight: 500;
}
.panch-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ═══ Time Cards ═══ */
.time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.time-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}
.time-card-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.time-card-value { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-top: 4px; }
.time-card.good { border-left: 4px solid var(--bg-good); }
.time-card.bad { border-left: 4px solid var(--bg-bad); }
.time-card.warn { border-left: 4px solid var(--bg-warn); }

/* ═══ Status Tags ═══ */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.tag-good { background: rgba(82,196,26,0.12); color: var(--text-good); }
.tag-bad { background: rgba(255,77,79,0.12); color: var(--text-bad); }
.tag-warn { background: rgba(250,173,20,0.12); color: #D48806; }
.tag-info { background: rgba(24,144,255,0.12); color: var(--bg-info); }

/* ═══ Shuddhi Meter ═══ */
.shuddhi-meter {
  height: 10px;
  background: var(--border-light);
  border-radius: 5px;
  overflow: hidden;
  margin: 8px 0;
}
.shuddhi-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #FF4D4F, #FAAD14, #52C41A);
  transition: width 0.5s ease;
}

/* ═══ Hora Row ═══ */
.hora-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}
.hora-row.current {
  background: rgba(255,215,0,0.1);
  border-color: rgba(255,215,0,0.5);
  box-shadow: 0 0 8px rgba(255,215,0,0.2);
}
.hora-row.good { border-left: 3px solid var(--bg-good); }
.hora-row-planet { font-weight: 700; }
.hora-row-time { font-size: 11px; color: var(--text-muted); }
.hora-row-effect { font-size: 11px; text-align: right; max-width: 50%; color: var(--text-secondary); }

/* ═══ Choghadiya ═══ */
.chog-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 13px;
}
.chog-good { background: rgba(82,196,26,0.08); border-left: 3px solid var(--bg-good); }
.chog-bad { background: rgba(255,77,79,0.08); border-left: 3px solid var(--bg-bad); }
.chog-neutral { background: var(--bg-card); border-left: 3px solid var(--border-light); }

/* ═══ Grid Layouts ═══ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

/* ═══ Rashi Grid ═══ */
.rashi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.rashi-card:active { transform: scale(0.96); }
.rashi-card.highlight { border: 2px solid var(--bg-accent); background: var(--bg-card-alt); }
.rashi-icon { font-size: 24px; margin-bottom: 4px; }
.rashi-name { font-size: 12px; font-weight: 700; }
.rashi-verdict { font-size: 10px; margin-top: 2px; }

/* ═══ Calendar ═══ */
.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.cal-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cal-month { font-size: 16px; font-weight: 700; color: var(--text-accent); }
.cal-header { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-bottom: 4px; }
.cal-header-day { text-align: center; font-size: 10px; font-weight: 700; color: var(--text-muted); padding: 6px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  background: var(--bg-card);
  border: 1px solid transparent;
  transition: var(--transition);
  padding: 2px;
}
.cal-cell:active { transform: scale(0.95); }
.cal-cell.today { background: var(--bg-accent); color: #FFF; font-weight: 700; }
.cal-cell.selected { border-color: var(--bg-accent); background: var(--bg-card-alt); }
.cal-cell.other { opacity: 0.3; }
.cal-day { font-size: 14px; font-weight: 600; }
.cal-nak { font-size: 7px; color: var(--text-muted); text-align: center; line-height: 1.1; }

/* ═══ Buttons ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--bg-accent), var(--bg-accent2));
  color: #FFF;
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-telugu);
}
.btn:active { transform: scale(0.97); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--bg-accent);
  color: var(--text-accent);
}
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-whatsapp { background: #25D366; }
.btn-telegram { background: #0088CC; }

/* ═══ Form ═══ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-telugu);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--bg-accent);
  box-shadow: 0 0 0 3px rgba(255,107,0,0.1);
}
.form-textarea { min-height: 100px; resize: vertical; }

/* ═══ Modal ═══ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal.active { display: flex; animation: fadeIn 0.2s; }
.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--border-card);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; color: var(--text-accent); }
.modal-text { font-size: 14px; line-height: 1.8; white-space: pre-wrap; }

/* ═══ Footer ═══ */
.site-footer {
  background: var(--bg-nav);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 20px 16px;
  font-size: 12px;
  margin-top: 24px;
}
.site-footer a { color: #FFD700; }

/* ═══ Bottom Nav (Mobile) ═══ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}
.bottom-nav-item {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}
.bottom-nav-item.active { color: var(--text-accent); }
.bottom-nav-icon { font-size: 18px; display: block; margin-bottom: 2px; }

/* ═══ Loading ═══ */
.loading { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--bg-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ═══ Share Bar ═══ */
.share-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
  flex-wrap: wrap;
}

/* ═══ Responsive ═══ */
@media (max-width: 480px) {
  .top-header h1 { font-size: 18px; }
  .nav-item { padding: 10px 10px; font-size: 11px; }
  .container { padding: 8px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

@media (min-width: 768px) {
  .container { padding: 16px; }
  .bottom-nav { display: none; }
}

/* ═══ Print ═══ */
@media print {
  .main-nav, .bottom-nav, .theme-toggle, .share-bar, .btn { display: none !important; }
  body { background: #FFF; color: #000; padding: 0; }
  .card { box-shadow: none; border: 1px solid #CCC; page-break-inside: avoid; }
}
