/* ============================================
   THE GITA GURU — Sacred Saffron Theme v2
   ============================================ */

:root {
  --saffron: #E8820C;
  --deep-saffron: #C4640A;
  --gold: #D4A017;
  --cream: #FDF6E3;
  --dark: #1A0F00;
  --brown: #3D2000;
  --lotus: #8B2252;
  --text-muted: rgba(253,246,227,0.62);
  --text-dim: rgba(253,246,227,0.35);
  --border: rgba(232,130,12,0.18);
  --border-strong: rgba(232,130,12,0.38);
  --green-wa: #25D366;
  --blue-fb: #1877F2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  font-family: 'Crimson Pro', Georgia, serif;
  color: var(--cream);
  min-height: 100vh;
  line-height: 1.7;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232,130,12,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(212,160,23,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(139,34,82,0.04) 0%, transparent 50%);
  pointer-events: none; z-index: 0;
}

/* ============================================
   LOTUS BLOOM ANIMATION
   ============================================ */
#lotus-portal {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  overflow: hidden;
}

.lotus-bloom {
  position: absolute;
  font-size: 2rem;
  opacity: 0;
  animation: lotusRise 1.6s ease-out forwards;
  pointer-events: none;
  transform-origin: center bottom;
}

@keyframes lotusRise {
  0%   { opacity: 0; transform: scale(0.2) translateY(0); }
  20%  { opacity: 1; transform: scale(1.1) translateY(-10px); }
  60%  { opacity: 0.8; transform: scale(1) translateY(-60px); }
  100% { opacity: 0; transform: scale(0.8) translateY(-120px); }
}

/* ============================================
   HEADER
   ============================================ */
header {
  text-align: center;
  padding: 2.5rem 1.5rem 0;
  position: relative; z-index: 1;
}

.header-inner { max-width: 700px; margin: 0 auto; }

.om {
  font-size: 3rem; color: var(--saffron);
  display: block; margin-bottom: 0.3rem;
  animation: omPulse 3s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(232,130,12,0.4);
}

@keyframes omPulse {
  0%,100% { opacity: 0.8; transform: scale(1); }
  50%     { opacity: 1;   transform: scale(1.05); }
}

.quote {
  font-family: 'Dancing Script', cursive;
  font-size: 1.6rem; font-weight: 500;
  color: var(--cream); opacity: 0.88;
  margin: 0.1rem 0 0.2rem; letter-spacing: 0.02em;
}

.quote-ref {
  font-family: 'Crimson Pro', serif;
  font-size: 0.72rem; color: var(--saffron);
  letter-spacing: 0.16em; text-transform: uppercase;
  display: block; margin-bottom: 1rem;
}

.divider {
  display: flex; align-items: center;
  gap: 0.8rem; margin: 0 auto 0.9rem; max-width: 280px;
}
.divider::before,.divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, rgba(232,130,12,0.4), transparent);
}
.divider-dot { width: 5px; height: 5px; background: var(--saffron); border-radius: 50%; }

.site-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700; color: var(--gold);
  letter-spacing: 0.1em; margin-bottom: 0.2rem;
  text-shadow: 0 2px 20px rgba(212,160,23,0.2);
}

.site-sub {
  font-size: 0.8rem; color: var(--text-dim);
  letter-spacing: 0.2em; text-transform: uppercase;
  margin-bottom: 1.5rem;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex; max-width: 420px;
  margin: 0 auto; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--border);
}
.tab {
  flex: 1; padding: 0.65rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; cursor: pointer;
  text-align: center; transition: all 0.25s;
  border: none; background: transparent;
}
.tab.active  { background: rgba(232,130,12,0.15); color: var(--saffron); }
.tab.inactive { color: var(--text-dim); }
.tab:not(:last-child) { border-right: 1px solid var(--border); }
.tab:hover:not(.active) { color: var(--cream); background: rgba(232,130,12,0.05); }

/* ============================================
   MAIN
   ============================================ */
main {
  max-width: 1100px; margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  position: relative; z-index: 1;
}
.panel { width: 100%; animation: panelSlide 0.3s ease; }

@keyframes panelSlide {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================
   CHAT TAB
   ============================================ */
.chat-wrap { max-width: 640px; margin: 0 auto; }

.instructions {
  background: rgba(212,160,23,0.05);
  border: 1px solid rgba(212,160,23,0.15);
  border-radius: 12px; padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.instructions-title {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 0.7rem;
}
.instr-item {
  font-size: 0.88rem; color: var(--text-muted);
  line-height: 1.7; padding-left: 1rem;
  position: relative; margin-bottom: 0.2rem;
}
.instr-item::before {
  content: '✦'; position: absolute; left: 0;
  color: var(--saffron); font-size: 0.55rem; top: 5px;
}

.q-label {
  font-family: 'Cinzel', serif; font-size: 0.62rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--saffron); margin-bottom: 0.5rem;
}

.chat-box {
  background: rgba(61,32,0,0.45);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.25rem; margin-bottom: 0.5rem;
  transition: border-color 0.2s;
}
.chat-box:focus-within { border-color: var(--border-strong); }

.chat-input {
  width: 100%; background: transparent;
  border: none; outline: none;
  font-family: 'Crimson Pro', serif;
  font-size: 1.05rem; font-style: italic;
  color: var(--cream); resize: none; line-height: 1.7;
}
.chat-input::placeholder { color: var(--text-dim); }

.chat-footer {
  display: flex; align-items: center;
  justify-content: space-between; margin-top: 0.75rem;
  border-top: 1px solid rgba(232,130,12,0.1); padding-top: 0.75rem;
}

.char-count { font-size: 0.75rem; color: var(--text-dim); font-family: monospace; }

.action-row { display: flex; align-items: center; gap: 0.6rem; }

/* Language toggle */
.lang-toggle {
  display: flex; border-radius: 20px;
  overflow: hidden; border: 1px solid var(--border);
}
.lang-btn {
  padding: 0.28rem 0.65rem;
  font-family: 'Cinzel', serif; font-size: 0.62rem;
  letter-spacing: 0.06em; cursor: pointer;
  border: none; background: transparent;
  color: var(--text-dim); transition: all 0.2s;
}
.lang-btn.active {
  background: rgba(232,130,12,0.18);
  color: var(--saffron);
}
.lang-btn:not(.active):hover { color: var(--cream); }

/* Seek button */
.seek-btn {
  background: linear-gradient(135deg, var(--saffron), var(--deep-saffron));
  color: white; border: none;
  padding: 0.55rem 1.4rem; border-radius: 50px;
  font-family: 'Cinzel', serif; font-size: 0.7rem;
  letter-spacing: 0.1em; cursor: pointer;
  transition: all 0.25s; text-transform: uppercase;
}
.seek-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(232,130,12,0.4);
}
.seek-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ============================================
   RESPONSE SECTIONS (JSON rendered)
   ============================================ */
.question-block { margin-bottom: 1rem; }

.response-block {
  background: rgba(61,32,0,0.35);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 1.25rem 1.5rem; margin-bottom: 1.25rem;
}

.response-label {
  font-family: 'Cinzel', serif; font-size: 0.62rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1rem;
}

/* Individual response sections */
.resp-empathy {
  font-size: 1rem; font-style: italic;
  color: rgba(253,246,227,0.82); line-height: 1.85;
  margin-bottom: 0.9rem;
  animation: sectionFade 0.5s ease both;
}

.resp-core {
  font-size: 0.82rem; color: var(--text-dim);
  letter-spacing: 0.08em; text-transform: uppercase;
  font-family: 'Cinzel', serif; margin-bottom: 1rem;
  animation: sectionFade 0.5s ease 0.1s both;
}

.resp-sloka {
  background: rgba(232,130,12,0.06);
  border-left: 2px solid var(--saffron);
  border-radius: 0 8px 8px 0;
  padding: 0.9rem 1.1rem; margin-bottom: 1rem;
  animation: sectionFade 0.5s ease 0.2s both;
}

.resp-sloka-ref {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.12em; color: var(--saffron);
  text-transform: uppercase; margin-bottom: 0.4rem;
}

.resp-sloka-sanskrit {
  font-style: italic; color: var(--gold);
  font-size: 0.95rem; line-height: 1.65; margin-bottom: 0.3rem;
}

.resp-sloka-transliteration {
  font-size: 0.8rem; color: var(--text-dim);
  font-style: italic; margin-bottom: 0.3rem;
}

.resp-sloka-meaning {
  font-size: 0.9rem; color: rgba(253,246,227,0.75);
  line-height: 1.6; margin-bottom: 0.4rem;
}

.resp-sloka-explanation {
  font-size: 0.88rem; color: var(--text-muted); line-height: 1.7;
}

.resp-modern {
  font-size: 0.95rem; color: rgba(253,246,227,0.78);
  line-height: 1.8; margin-bottom: 0.9rem;
  animation: sectionFade 0.5s ease 0.3s both;
}

.resp-guidance {
  background: rgba(212,160,23,0.06);
  border-left: 2px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem; color: rgba(253,246,227,0.85);
  line-height: 1.8;
  animation: sectionFade 0.5s ease 0.4s both;
}

.resp-section-label {
  font-family: 'Cinzel', serif; font-size: 0.58rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.35rem; display: block;
}

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

/* Feedback */
.feedback-row {
  display: flex; align-items: center; gap: 0.75rem;
  margin-top: 1.1rem; padding-top: 1rem;
  border-top: 1px solid rgba(232,130,12,0.1); flex-wrap: wrap;
}
.feedback-label { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }
.feedback-btn {
  padding: 0.35rem 1rem; border-radius: 20px; font-size: 0.85rem;
  cursor: pointer; transition: all 0.2s; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  font-family: 'Crimson Pro', serif;
}
.feedback-btn:hover { background: rgba(232,130,12,0.08); color: var(--cream); }
.feedback-btn.selected { background: rgba(232,130,12,0.15); color: var(--saffron); border-color: var(--border-strong); }

/* Share icons */
.share-row {
  display: flex; align-items: center; gap: 0.75rem;
  margin-top: 0.75rem; flex-wrap: wrap;
}
.share-label { font-size: 0.78rem; color: var(--text-dim); font-style: italic; }
.share-icons { display: flex; gap: 0.5rem; }

.share-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: rgba(61,32,0,0.4);
  cursor: pointer; transition: all 0.2s; padding: 0;
}
.share-icon svg { width: 16px; height: 16px; }
.share-icon.whatsapp { color: rgba(37,211,102,0.6); }
.share-icon.whatsapp:hover { background: rgba(37,211,102,0.12); color: var(--green-wa); border-color: rgba(37,211,102,0.4); transform: scale(1.1); }
.share-icon.facebook { color: rgba(24,119,242,0.6); }
.share-icon.facebook:hover { background: rgba(24,119,242,0.12); color: var(--blue-fb); border-color: rgba(24,119,242,0.4); transform: scale(1.1); }
.share-icon.twitter { color: rgba(253,246,227,0.4); }
.share-icon.twitter:hover { background: rgba(255,255,255,0.06); color: var(--cream); border-color: rgba(255,255,255,0.2); transform: scale(1.1); }

/* Session done */
.session-done, .limit-msg {
  text-align: center; padding: 2.5rem 1.5rem;
  background: rgba(61,32,0,0.35); border: 1px solid var(--border);
  border-radius: 12px; animation: sectionFade 0.5s ease;
}
.done-om { font-size: 2.5rem; color: var(--saffron); margin-bottom: 0.75rem; }
.done-title { font-family: 'Cinzel', serif; font-size: 1.1rem; color: var(--gold); margin-bottom: 0.5rem; letter-spacing: 0.05em; }
.done-text { font-size: 0.95rem; color: var(--text-muted); line-height: 1.7; max-width: 400px; margin: 0 auto; }

/* ============================================
   DIRECTORY TAB
   ============================================ */

/* Mobile dropdown */
.mobile-dropdown-wrap { display: none; margin-bottom: 1rem; }
.mobile-dropdown {
  width: 100%; padding: 0.75rem 1rem;
  background: rgba(61,32,0,0.5); border: 1px solid var(--border);
  border-radius: 10px; color: var(--cream);
  font-family: 'Crimson Pro', serif; font-size: 1rem;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23E8820C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}
.mobile-dropdown option { background: #2A1500; color: var(--cream); }

@media (max-width: 700px) {
  .mobile-dropdown-wrap { display: block; }
  .sidebar { display: none; }
  .dir-layout { grid-template-columns: 1fr; }
}

.dir-layout {
  display: grid; grid-template-columns: 220px 1fr;
  gap: 1.25rem; align-items: start;
}

/* Sidebar */
.sidebar {
  background: rgba(61,32,0,0.35); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem;
  position: sticky; top: 1rem;
  max-height: 80vh; overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--saffron); border-radius: 2px; }

.sidebar-title {
  font-family: 'Cinzel', serif; font-size: 0.6rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--saffron); margin-bottom: 0.75rem;
}

.category-group { margin-bottom: 0.25rem; }
.category-header {
  font-family: 'Cinzel', serif; font-size: 0.62rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); padding: 0.4rem 0.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 6px; transition: background 0.15s;
}
.category-header:hover { background: rgba(212,160,23,0.06); }
.category-arrow { font-size: 0.55rem; transition: transform 0.2s; }
.category-arrow.open { transform: rotate(90deg); }

.problem-item {
  padding: 0.38rem 0.5rem 0.38rem 0.9rem; border-radius: 6px;
  cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 0.4rem;
  margin-bottom: 0.15rem; transition: background 0.15s;
  border: 1px solid transparent;
}
.problem-item:hover { background: rgba(232,130,12,0.07); }
.problem-item.active { background: rgba(232,130,12,0.13); border-color: rgba(232,130,12,0.22); }
.prob-name { font-size: 0.8rem; color: var(--text-muted); line-height: 1.3; flex: 1; }
.problem-item.active .prob-name { color: var(--saffron); }
.prob-upvotes { font-size: 0.65rem; color: var(--text-dim); white-space: nowrap; }

.sidebar-divider { height: 1px; background: rgba(232,130,12,0.1); margin: 0.75rem 0; }
.ask-guru-link { font-size: 0.78rem; color: var(--text-dim); font-style: italic; line-height: 1.5; text-align: center; }
.ask-guru-link span { color: var(--saffron); display: block; margin-top: 0.25rem; font-style: normal; font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.08em; cursor: pointer; }

/* Main panel */
.main-panel {
  background: rgba(61,32,0,0.3); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem 1.75rem; min-height: 400px;
}

.problem-title { font-family: 'Cinzel', serif; font-size: 1.1rem; color: var(--gold); margin-bottom: 0.6rem; letter-spacing: 0.04em; }
.problem-feeling { font-size: 0.95rem; color: var(--text-muted); font-style: italic; line-height: 1.75; margin-bottom: 1.1rem; border-left: 2px solid rgba(232,130,12,0.3); padding-left: 0.9rem; }
.section-label { font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--saffron); margin-bottom: 0.45rem; }
.gita-teaching { font-size: 0.95rem; color: rgba(253,246,227,0.82); line-height: 1.8; margin-bottom: 1rem; }

.sloka-block { background: rgba(232,130,12,0.06); border-left: 2px solid var(--saffron); border-radius: 0 8px 8px 0; padding: 0.85rem 1.1rem; margin-bottom: 1rem; }
.sloka-ref { font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.12em; color: var(--saffron); margin-bottom: 0.3rem; text-transform: uppercase; }
.sloka-sanskrit { font-style: italic; color: var(--gold); font-size: 0.95rem; line-height: 1.65; margin-bottom: 0.2rem; }
.sloka-meaning { font-size: 0.88rem; color: var(--text-muted); line-height: 1.65; }

.upvote-row { display: flex; align-items: center; gap: 0.9rem; margin: 1.1rem 0 0.75rem; padding-top: 1rem; border-top: 1px solid rgba(232,130,12,0.1); }
.upvote-btn { background: rgba(232,130,12,0.08); border: 1px solid rgba(232,130,12,0.25); color: var(--saffron); padding: 0.4rem 1.1rem; border-radius: 20px; font-size: 0.85rem; cursor: pointer; font-family: 'Crimson Pro', serif; transition: all 0.2s; }
.upvote-btn:hover { background: rgba(232,130,12,0.15); }
.upvote-btn.voted { opacity: 0.6; cursor: default; }
.upvote-count { font-size: 0.82rem; color: var(--text-dim); }

.ask-personal { background: rgba(232,130,12,0.06); border: 1px solid rgba(232,130,12,0.18); border-radius: 8px; padding: 0.75rem 1rem; font-size: 0.88rem; color: var(--text-muted); text-align: center; cursor: pointer; font-style: italic; margin-top: 0.5rem; transition: background 0.2s; }
.ask-personal:hover { background: rgba(232,130,12,0.1); }
.ask-personal strong { color: var(--saffron); font-style: normal; }

/* Directory share row */
.dir-share-row { display: flex; align-items: center; gap: 0.75rem; margin: 0.75rem 0; flex-wrap: wrap; }

/* ============================================
   UTILITIES
   ============================================ */
.loading-text { color: var(--text-dim); font-style: italic; font-size: 0.95rem; padding: 2rem 0; text-align: center; }

/* ============================================
   FOOTER
   ============================================ */
footer {
  border-top: 1px solid rgba(232,130,12,0.1);
  padding: 2rem 1.25rem; text-align: center;
  position: relative; z-index: 1;
}
.footer-inner { max-width: 600px; margin: 0 auto; }
.footer-om { font-size: 1.4rem; color: var(--saffron); opacity: 0.4; display: block; margin-bottom: 0.75rem; }

.beta-badge {
  display: inline-block; background: rgba(232,130,12,0.1);
  border: 1px solid rgba(232,130,12,0.25); border-radius: 20px;
  padding: 0.3rem 1rem; font-family: 'Cinzel', serif;
  font-size: 0.65rem; letter-spacing: 0.12em;
  color: var(--saffron); text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.beta-text { font-size: 0.82rem; color: rgba(253,246,227,0.5); line-height: 1.65; margin-bottom: 1rem; font-style: italic; }

.footer-divider { height: 1px; background: rgba(232,130,12,0.08); margin: 0.75rem 0; }
footer p { font-size: 0.78rem; color: var(--text-dim); line-height: 1.6; margin-bottom: 0.3rem; }
footer strong { color: rgba(253,246,227,0.45); }
.footer-copy { font-size: 0.7rem; color: rgba(253,246,227,0.2); margin-top: 0.75rem; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 500px) {
  .quote { font-size: 1.25rem; }
  .action-row { gap: 0.4rem; }
  .seek-btn { padding: 0.5rem 1rem; font-size: 0.65rem; }
  .feedback-row { flex-direction: column; align-items: flex-start; }
  .share-row { flex-direction: column; align-items: flex-start; }
}
