/* 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;
}

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

/* 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;
}

/* 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: 2rem;
  color: rgba(236, 72, 153, 0.8);
  text-shadow: 0 0 10px rgba(236, 72, 153, 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); 
  }
}