/* Tathastu Horoscope Custom Styles */
body {
  background-image: 
    radial-gradient(ellipse at 20% 30%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(251, 191, 36, 0.08) 0%, transparent 50%);
}

#stars {
  background: transparent;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  animation: twinkle var(--duration) ease-in-out infinite;
  will-change: opacity, transform;
}

/* Each star gets its own peak/min brightness via --peak / --min (set in JS),
   so the field shimmers unevenly instead of pulsing in lockstep. */
@keyframes twinkle {
  0%, 100% { opacity: var(--min, 0.25); transform: scale(1); }
  50% { opacity: var(--peak, 1); transform: scale(1.25); }
}

.glass-panel {
  background: rgba(18, 18, 42, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s, transform 0.2s;
}

.glass-panel:hover {
  border-color: rgba(124, 58, 237, 0.4);
}

.section-tab {
  font-weight: 500;
  letter-spacing: 0.025em;
}

.section-tab.active {
  background: linear-gradient(135deg, #7c3aed, #6366f1) !important;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.input-field {
  width: 100%;
  background: rgba(18, 18, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: #e0e7ff;
  transition: border-color 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.section-tab.active {
  background: linear-gradient(to right, #7c3aed, #4f46e5) !important;
  color: white;
}

.period-btn.active {
  background: #7c3aed !important;
}

/* Chart Wheel */
.chart-wheel {
  width: 100%;
  max-width: 480px;
  height: 480px;
}

/* Mobile menu */
@media (max-width: 768px) {
  nav {
    display: none;
  }
}

/* --- Round 2 components: solutions blocks + Ask Tathastu AI --- */

/* Gentle reveal when a new block renders (opacity/transform only — cheap on mobile) */
@keyframes tathastuReveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal-in {
  animation: tathastuReveal 0.45s ease-out both;
}
.reveal-in-slow {
  animation: tathastuReveal 0.6s ease-out 0.08s both;
}

/* Solutions block: soft gold-tinted glass card inside result areas */
.sol-block {
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.07), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.sol-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.65rem;
  padding: 0.45rem 0.6rem;
}

/* AI chat */
.ai-chat {
  background: linear-gradient(165deg, rgba(124, 58, 237, 0.12), rgba(18, 18, 42, 0.65));
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
@keyframes aiMsgIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-msg {
  animation: aiMsgIn 0.3s ease-out both;
}
.ai-bubble-user {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff;
  border-radius: 1rem 1rem 0.25rem 1rem;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}
.ai-bubble-ai {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 1rem 1rem 1rem 0.25rem;
}
.ai-bubble-error {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 0.75rem;
  color: #fcd34d;
}
.ai-chip-btn {
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.ai-chip-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(251, 191, 36, 0.5);
}
.ai-chip-btn:active {
  transform: translateY(0) scale(0.97);
}
.ai-ask-btn {
  transition: transform 0.15s ease, filter 0.2s ease, opacity 0.2s ease;
}
.ai-ask-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.12);
}
.ai-ask-btn:active:not(:disabled) {
  transform: scale(0.97);
}
.ai-ask-btn:disabled, .ai-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Typing indicator — three softly bouncing dots */
.ai-typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 2px 0;
}
.ai-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbf24;
  opacity: 0.35;
  animation: aiDotBounce 1.2s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiDotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-in, .reveal-in-slow, .ai-msg { animation: none; }
  .ai-typing span { animation: none; opacity: 0.7; }
}

/* --- Round 3: interface polish (presentation only) --- */

/* Smooth in-page anchor scrolling + gold text selection */
html {
  scroll-behavior: smooth;
}
::selection {
  background: rgba(251, 191, 36, 0.35);
  color: #fff7e0;
}

/* Gold focus ring for keyboard users, everywhere */
:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.85);
  outline-offset: 2px;
}

/* Drifting nebula backdrop — layered radial gradients, transform-only drift */
#nebula {
  position: fixed;
  inset: -12%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(620px 420px at 15% 18%, rgba(124, 58, 237, 0.20), transparent 62%),
    radial-gradient(760px 520px at 85% 78%, rgba(251, 191, 36, 0.08), transparent 62%),
    radial-gradient(520px 520px at 62% 8%, rgba(99, 102, 241, 0.12), transparent 62%),
    radial-gradient(480px 380px at 30% 88%, rgba(168, 85, 247, 0.10), transparent 62%);
  animation: nebulaDrift 90s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes nebulaDrift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(1.5%, 1.2%, 0) scale(1.06); }
}

/* Occasional shooting star (spawned by JS, removed after the streak) */
.shooting-star {
  position: absolute;
  width: 110px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95) 70%, #fcd34d);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.55);
  opacity: 0;
  pointer-events: none;
  animation: shootingStar 1.15s ease-out forwards;
}
@keyframes shootingStar {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-32deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(-190px, 128px, 0) rotate(-32deg); }
}

/* Section switching: incoming section fades/slides in */
@keyframes sectionIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.section-enter {
  animation: sectionIn 0.45s ease-out both;
}

/* Active tab: keep the purple fill, add a gold glow + underline bar */
.section-tab {
  position: relative;
}
.section-tab.active {
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.45), 0 0 0 1px rgba(251, 191, 36, 0.35), 0 8px 16px -8px rgba(251, 191, 36, 0.6);
}
.section-tab.active::after {
  content: '';
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #fbbf24, transparent);
}

/* Section headings: shared purple→gold gradient + a small gold rule */
.section-title {
  background: linear-gradient(100deg, #e9d5ff 0%, #c4b5fd 45%, #fcd34d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  position: relative;
  padding-bottom: 0.7rem;
}
.section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 72px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #fbbf24, transparent);
}

/* Sign cards: lift + gold glow on hover/tap */
.sign-card {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.sign-card:hover, .sign-card:active {
  transform: translateY(-4px);
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(251, 191, 36, 0.22);
}
.sign-card:hover .sign-symbol {
  transform: scale(1.12);
}
.sign-symbol {
  display: inline-block;
  transition: transform 0.25s ease;
}

/* Buttons: gentle press feedback (transform only) */
button {
  -webkit-tap-highlight-color: transparent;
}
button:active {
  transform: scale(0.97);
}

/* Loading: pulsing gold ring spinner + shimmering skeleton lines */
.loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.loader-ring {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 9999px;
  border: 3px solid rgba(251, 191, 36, 0.15);
  border-top-color: #fbbf24;
  border-right-color: rgba(251, 191, 36, 0.55);
  animation: loaderSpin 0.85s linear infinite, loaderGlow 1.6s ease-in-out infinite;
}
@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}
@keyframes loaderGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(251, 191, 36, 0.15); }
  50% { box-shadow: 0 0 22px rgba(251, 191, 36, 0.45); }
}
.skel {
  border-radius: 0.6rem;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 35%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.04) 65%);
  background-size: 200% 100%;
  animation: skelShimmer 1.3s linear infinite;
}
@keyframes skelShimmer {
  from { background-position: 180% 0; }
  to { background-position: -80% 0; }
}

/* Interactive chart wheel */
.wheel-deco-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: wheelSpin 240s linear infinite;
}
@keyframes wheelSpin {
  to { transform: rotate(360deg); }
}
.wheel-planet {
  cursor: pointer;
}
.wheel-planet .planet-hit {
  fill: transparent;
}
.wheel-planet:hover .planet-dot,
.wheel-planet:focus-visible .planet-dot {
  stroke: #fbbf24;
  stroke-width: 2.5;
}
.wheel-planet.selected .planet-dot {
  stroke: #fbbf24;
  stroke-width: 3;
}
.wheel-planet.selected .planet-label {
  fill: #fcd34d;
}
.wheel-chip {
  margin: 14px auto 0;
  max-width: 430px;
  text-align: center;
  background: rgba(18, 18, 42, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 0.9rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: #e0e7ff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Decorative moon disc (Sky section) — illumination class set from phase keywords */
.moon-disc {
  position: relative;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 35% 35%, #fdf6d8, #e7d9a8 55%, #c9b678);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.35), inset -6px -6px 14px rgba(120, 90, 20, 0.35);
}
.moon-disc::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #12122a;
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
}
.moon-full::after { opacity: 0; }
.moon-new {
  background: radial-gradient(circle at 35% 35%, #1d1d36, #0d0d1f);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.moon-new::after { opacity: 0; }
/* Half lit (neutral default): dark overlay covers the left half */
.moon-half::after, .moon-quarter-first::after {
  opacity: 1;
  width: 50%;
  right: auto;
  border-radius: 0;
}
.moon-quarter-last::after {
  opacity: 1;
  width: 50%;
  left: auto;
  border-radius: 0;
}
/* Crescent / gibbous: full dark disc offset sideways */
.moon-crescent-wax::after { opacity: 1; transform: translateX(-38%); }
.moon-crescent-wane::after { opacity: 1; transform: translateX(38%); }
.moon-gibbous-wax::after { opacity: 1; transform: translateX(-16%); }
.moon-gibbous-wane::after { opacity: 1; transform: translateX(16%); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #nebula, .wheel-deco-ring, .skel { animation: none !important; }
  .star { animation: none; opacity: 0.7; }
  .section-enter { animation: none; }
  .loader-ring { animation-duration: 2.4s, 1.6s; }
  .moon-disc::after { transition: none; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0a0a1a;
}
::-webkit-scrollbar-thumb {
  background: #7c3aed;
  border-radius: 4px;
}

/* Brand name: solid bright gold — gradient-clipped text gets mangled by
   browser forced-dark modes (owner's phone rendered it near-invisible
   dark purple). Solid colour + glow survives every browser. */
:root { color-scheme: dark; }
.brand-name {
  color: #f6d47c;
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.35);
  letter-spacing: 0.04em;
}
.hero-name {
  color: #ffe9a8;
  text-shadow: 0 0 28px rgba(251, 191, 36, 0.30);
  letter-spacing: 0.03em;
}
