/* Custom styles for the page */
html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #0c0a1e;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(120, 80, 220, 0.2), transparent 30%),
        radial-gradient(circle at 85% 30%, rgba(80, 150, 220, 0.2), transparent 30%),
        radial-gradient(circle at 50% 80%, rgba(220, 80, 150, 0.2), transparent 30%);
    position: relative;
    display: flex;
    flex-direction: column;
    text-rendering: optimizeLegibility;

}

/* Use Playfair Display for headings */
h1, h2, h3 {
    font-family: 'Playfair Display', serif;
}

/* === Astral.email Glowing Header Styles === */
.glow-text {
  position: relative;
  font-size: 3rem; /* matches text-4xl */
  font-weight: 700; /* font-bold */
  letter-spacing: -0.015em;
  color: #ffffff;
  filter: brightness(1.1);
  z-index: 1;
  text-align: center;
}

.glow-text::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #00cfff, #a600ff, #ff006e, #ff8800);
  filter: blur(20px) brightness(0.8);
  opacity: 0.7;
  border-radius: 100px;
  z-index: -1;
  pointer-events: none;
  background-size: 200% 200%;
  animation: gradientShift 12s ease-in-out infinite;
}

.glow-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  letter-spacing: inherit;
  background: linear-gradient(90deg, #00cfff, #a600ff, #ff006e, #ff8800);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  mix-blend-mode: color-burn;
  filter: blur(3px) brightness(1.3);
  z-index: 0;
  pointer-events: none;
  background-size: 200% 200%;
  animation: gradientShift 12s ease-in-out infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* === End Astral.email Glowing Header Styles === */


/* Twinkling stars animation */
.stars, .twinkling {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.stars {
    background: #000 url(https://www.transparenttextures.com/patterns/stardust.png) repeat top center;
    z-index: -2;
}

.twinkling {
    background: transparent url(https://www.transparenttextures.com/patterns/stardust.png) repeat top center;
    z-index: -1;
    animation: move-twink-back 200s linear infinite;
}

@keyframes move-twink-back {
    from { background-position: 0 0; }
    to { background-position: -10000px 5000px; }
}

/* Custom scrollbar for the chat */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(167, 139, 250, 0.6);
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(167, 139, 250, 0.8);
}

/* Chat bubble animation - unified version */
.chat-bubble {
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.4s forwards ease-out;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zodiac wheel styles */
.zodiac-wheel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .zodiac-wheel {
        grid-template-columns: repeat(6, 1fr);
        gap: 1rem;
    }
}

.zodiac-sign {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.zodiac-sign:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.7);
}

/* Loading spinner - unified version */
.loader {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth transitions */
.transition-colors {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Focus states for better accessibility (compatible with Tailwind) */
input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.5);
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.5);
}

/* Ensure proper scrolling */
#chat-messages {
    scroll-behavior: smooth;
}

/* Nice defaults for rendered Markdown */
.markdown-body {
  color: #e5e7eb;                 /* text-gray-200-ish */
  line-height: 1.6;
}

.markdown-body h1, 
.markdown-body h2, 
.markdown-body h3 {
  font-family: 'Playfair Display', serif; /* matches your heading font */
  margin: 0.4rem 0 0.6rem;
  line-height: 1.25;
}

.markdown-body p {
  margin: 0.5rem 0 0.75rem;
}

.markdown-body strong {
  color: #f9a8d4;                 /* pink-300ish to match your vibe */
  font-weight: 700;
}

.markdown-body em {
  color: #d1d5db;                 /* gray-300-ish */
}

.markdown-body ul, 
.markdown-body ol {
  margin: 0.5rem 0 0.75rem 1.25rem;
}

.markdown-body li {
  margin: 0.25rem 0;
}

.markdown-body a {
  color: #93c5fd;                 /* blue-300-ish */
  text-decoration: underline;
}

/* Optional: tighten emoji line height */
.markdown-body :where(p, li) {
  line-height: 1.6;
}

/* If you use Tailwind Typography, you can instead do:
   <div class="prose prose-invert"> ... </div>
   and omit most of the rules above. */


/* Animated gradient border without z-index hacks (safe with overflow hidden) */
@property --rotate {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.glow-card {
  position: relative;
  border-radius: 10px !important;              /* keep in sync with ::before padding mask */
  background: #191c29;              /* inner fill */
  color: white;
  isolation: isolate;               /* local stacking context */
  overflow: visible !important;
}

/* Border stroke */
.glow-card::before {
  content: "";
  position: absolute;
  inset: 0;                         /* full box */
  border-radius: inherit;
  padding: 2px;                     /* border thickness */
  background: conic-gradient(
    from var(--rotate),
    #5ddcff, #3c67e3 43%, #4e00c2
  );
  /* Mask so only the border ring shows */
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: glowSpin 2.5s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Soft inner glow (kept inside the box so it won't be clipped by ancestors) */
.glow-card::after {
  content: "";
  position: absolute;
  inset: 2px;                       /* just inside the border */
  border-radius: calc(10px - 2px);
  background: radial-gradient(120% 120% at 50% 50%,
    rgba(100, 180, 255, 0.12),
    rgba(76, 0, 194, 0.06) 40%,
    transparent 70%);
  filter: blur(6px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

/* Unique animation name to avoid colliding with your loader's "spin" */
@keyframes glowSpin {
  to { --rotate: 360deg; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .glow-card::before { animation: none; }
}

/* Additional responsive improvements */
@media (max-width: 640px) {
    .zodiac-sign {
        padding: 0.5rem;
    }
    
    .zodiac-sign span:first-child {
        font-size: 1.5rem;
    }
    
    .zodiac-sign span:last-child {
        font-size: 0.7rem;
    }
}

/* Cosmic Loader Styles - Add these to your main.css */

/* Cosmic loader container */
.cosmic-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background-color: hsla(217, 35%, 5%, 1);
  transition: opacity 0.5s ease-out;
}

.cosmic-loader canvas {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Loading text overlay */
.cosmic-loader-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  z-index: 10;
  pointer-events: none;
  text-shadow: 
    0 0 20px rgba(147, 51, 234, 0.8),
    0 0 40px rgba(236, 72, 153, 0.6),
    0 0 60px rgba(147, 51, 234, 0.4);
  letter-spacing: 0.05em;
}

/* Animated dots */
.cosmic-loader-dots {
  display: inline-block;
  margin-top: 10px;
}

.cosmic-loader-dots span {
  display: inline-block;
  animation: cosmicPulse 1.4s infinite ease-in-out both;
  font-size: 3rem;
  color: rgba(235, 235, 235, 0.8);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.cosmic-loader-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.cosmic-loader-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes cosmicPulse {
  0%, 80%, 100% {
    opacity: 0;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Hide with fade out */
.cosmic-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Loading message in chat */
.cosmic-loading-message {
  padding: 10px;
  margin: 8px 0;
  animation: fadeIn 0.3s ease-in;
}

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