@import "tailwindcss";

/* Custom Animations */
@keyframes blob {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
  100% {
    transform: translate(0px, 0px) scale(1);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-slow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Animation Utility Classes */
.animate-blob {
  animation: blob 7s infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-fade-in {
  animation: fade-in 0.5s ease-out;
}

.animate-pulse-slow {
  animation: pulse-slow 3s ease-in-out infinite;
}

/* Animation Delays */
.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

/* Custom Gradients */
.bg-gradient-spiritual {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-peaceful {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Glassmorphism Effects */
.glass-effect {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-effect-dark {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Custom Form Styles */
.form-input {
  @apply w-full px-4 py-3 border-2 border-gray-200 rounded-xl focus:ring-4 focus:ring-purple-500/20 focus:border-purple-500 transition-all duration-200 bg-gray-50/50;
}

.form-label {
  @apply block text-sm font-medium text-gray-700 mb-2;
}

/* Custom Button Styles */
.btn-primary {
  @apply w-full py-4 px-6 bg-gradient-to-r from-purple-600 to-indigo-600 text-white font-semibold rounded-xl hover:from-purple-700 hover:to-indigo-700 transform hover:scale-[1.02] transition-all duration-200 shadow-lg hover:shadow-xl;
}

.btn-secondary {
  @apply w-full py-4 px-6 bg-gray-100 text-gray-700 font-semibold rounded-xl hover:bg-gray-200 transform hover:scale-[1.02] transition-all duration-200 text-center block;
}

.btn-ghost {
  @apply bg-white/10 backdrop-blur-md border border-white/20 text-white px-6 py-2 rounded-full hover:bg-white/20 transition-all duration-200;
}

/* Card Styles */
.card-spiritual {
  @apply bg-white rounded-2xl shadow-xl overflow-hidden hover:shadow-2xl transition-all duration-300 hover:-translate-y-2;
}

.card-glass {
  @apply bg-white/95 backdrop-blur-md rounded-2xl shadow-2xl;
}

/* Background Blobs */
.blob-container {
  @apply absolute inset-0 overflow-hidden;
}

.blob {
  @apply absolute rounded-full mix-blend-multiply filter blur-3xl opacity-20;
}

.blob-purple {
  @apply bg-purple-700 w-72 h-72 md:w-96 md:h-96;
}

.blob-indigo {
  @apply bg-indigo-700 w-72 h-72 md:w-96 md:h-96;
}

.blob-blue {
  @apply bg-blue-700 w-72 h-72 md:w-96 md:h-96;
}

/* Onboarding Specific Styles */
.onboarding-step {
  @apply bg-white rounded-lg shadow-md p-6 border-2 border-gray-200 hover:border-indigo-300 transition-all duration-200;
}

.onboarding-step-selected {
  @apply border-indigo-600 ring-2 ring-indigo-200;
}

/* Chat Interface Styles */
.chat-bubble-user {
  @apply bg-gray-100 rounded-lg p-4 max-w-3xl;
}

.chat-bubble-ai {
  @apply bg-indigo-50 rounded-lg p-4 max-w-3xl;
}

/* Markdown Content in Chat Messages */
.message-content p {
  @apply mb-2 last:mb-0;
}

.message-content strong {
  @apply font-semibold;
}

.message-content em {
  @apply italic;
}

.message-content ul {
  @apply list-disc list-inside mb-2 space-y-1;
}

.message-content ol {
  @apply list-decimal list-inside mb-2 space-y-1;
}

.message-content li {
  @apply text-gray-900;
}

.message-content li p {
  @apply inline mb-0;
}

.message-content h1, .message-content h2, .message-content h3, .message-content h4 {
  @apply font-semibold text-gray-900 mt-3 mb-1;
}

.message-content h1 { @apply text-lg; }
.message-content h2 { @apply text-base; }
.message-content h3 { @apply text-sm uppercase tracking-wide; }

.message-content code {
  @apply bg-gray-200 text-gray-800 px-1.5 py-0.5 rounded text-sm;
}

.message-content pre {
  @apply bg-gray-200 rounded-md p-3 mb-2 overflow-x-auto;
}

.message-content pre code {
  @apply bg-transparent p-0;
}

.message-content blockquote {
  @apply border-l-3 border-gray-300 pl-3 italic text-gray-600 mb-2;
}

/* Chat Sidebar Active State */
.chat-active {
  @apply bg-indigo-50 border-l-4 border-indigo-600;
}

.chat-active svg {
  @apply text-indigo-600;
}

.chat-active p.text-sm {
  @apply text-gray-900 font-semibold;
}

/* Dashboard Card Styles */
.dashboard-card {
  @apply bg-white overflow-hidden shadow rounded-lg hover:shadow-lg transition-shadow duration-200;
}

/* Navigation Styles */
.nav-link {
  @apply text-gray-700 hover:text-indigo-600 px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200;
}

.nav-link-white {
  @apply text-white/80 hover:text-white transition-colors duration-200;
}

/* Hero Section Styles */
.hero-gradient {
  @apply bg-gradient-to-br from-purple-900 via-indigo-900 to-blue-900;
}

.hero-overlay {
  @apply absolute inset-0 bg-black/20;
}

/* Section Styles */
.section-padding {
  @apply py-24 px-4 sm:px-6 lg:px-8;
}

.section-header {
  @apply text-4xl md:text-5xl font-bold text-gray-900 mb-4;
}

.section-description {
  @apply text-xl text-gray-600 max-w-3xl mx-auto;
}

/* Feature Card Styles */
.feature-icon {
  @apply w-12 h-12 bg-gradient-to-br from-purple-500 to-indigo-600 rounded-lg flex items-center justify-center text-white text-2xl mb-4;
}

.feature-title {
  @apply text-xl font-bold text-gray-900 mb-2;
}

.feature-description {
  @apply text-gray-600;
}

/* Goal Highlight Animation */
@keyframes highlight {
  0% {
    background-color: rgba(199, 210, 254, 0.3);
  }
  100% {
    background-color: transparent;
  }
}

.animate-highlight {
  animation: highlight 3s ease-out;
  transition: all 0.3s ease;
}

/* Goal item hover effects */
.goal-item:hover .delete-btn {
  opacity: 1;
}

/* Memory notification animation */
@keyframes fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.animate-fade-out {
  animation: fade-out 0.3s ease-out forwards;
}

/* Goals Panel Animation */
@keyframes slide-in-right {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slide-out-right {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

.slide-in-right {
  animation: slide-in-right 0.3s ease-out;
}

.slide-out-right {
  animation: slide-out-right 0.3s ease-in;
}

/* Toast Notification Animations */
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.animate-toast-in {
  animation: toast-in 0.3s ease-out;
}

.animate-toast-out {
  animation: toast-out 0.3s ease-in;
}

/* Flash Toast Styles */
.flash-toast {
  @apply transition-all duration-300;
}

/* Voice Mode Animations */
@keyframes voice-ripple {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

@keyframes voice-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 30px rgba(52, 211, 153, 0.3), 0 0 60px rgba(52, 211, 153, 0.1);
  }
  50% {
    box-shadow: 0 0 50px rgba(52, 211, 153, 0.5), 0 0 100px rgba(52, 211, 153, 0.2);
  }
}

@keyframes voice-orb-breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes voice-orb-speak {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 40px rgba(52, 211, 153, 0.3);
  }
  25% {
    transform: scale(1.08);
    box-shadow: 0 0 60px rgba(52, 211, 153, 0.5);
  }
  75% {
    transform: scale(1.04);
    box-shadow: 0 0 50px rgba(52, 211, 153, 0.4);
  }
}

@keyframes voice-bar-bounce {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

@keyframes voice-thinking-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes voice-bg-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.1); }
  66% { transform: translate(-15px, 15px) scale(0.95); }
}

.voice-panel {
  transition: background 0.5s ease;
}

.voice-bg-blob {
  animation: voice-bg-float 8s ease-in-out infinite;
}

.voice-orb-wrapper {
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.voice-orb {
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.voice-glow {
  background: radial-gradient(circle, rgba(52, 211, 153, 0.2) 0%, transparent 70%);
  transform: scale(1.8);
}

/* Idle State */
.voice-state-idle .voice-orb {
  animation: none;
  box-shadow: 0 25px 50px -12px rgba(52, 211, 153, 0.25);
}

/* Connecting State */
.voice-state-connecting .voice-orb {
  animation: voice-orb-breathe 1.5s ease-in-out infinite;
}

.voice-state-connecting .voice-glow {
  opacity: 0.5;
}

/* Listening State */
.voice-state-listening .voice-ripple {
  opacity: 1;
  animation: voice-ripple 2.5s ease-out infinite;
}

.voice-state-listening .voice-ripple-2 {
  animation-delay: 0.8s;
}

.voice-state-listening .voice-ripple-3 {
  animation-delay: 1.6s;
}

.voice-state-listening .voice-orb {
  animation: voice-orb-breathe 2s ease-in-out infinite;
}

.voice-state-listening .voice-glow {
  opacity: 0.8;
  animation: voice-glow-pulse 2s ease-in-out infinite;
}

/* Thinking State */
.voice-state-thinking .voice-orb {
  animation: voice-orb-breathe 1s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(52, 211, 153, 0.2);
}

.voice-state-thinking .voice-glow {
  opacity: 0.4;
}

.voice-thinking-dot-1 { animation: voice-thinking-bounce 1.2s ease-in-out infinite; }
.voice-thinking-dot-2 { animation: voice-thinking-bounce 1.2s ease-in-out 0.15s infinite; }
.voice-thinking-dot-3 { animation: voice-thinking-bounce 1.2s ease-in-out 0.3s infinite; }

/* Speaking State */
.voice-state-speaking .voice-ripple {
  opacity: 1;
  animation: voice-ripple 1.8s ease-out infinite;
  border-color: rgba(52, 211, 153, 0.4);
}

.voice-state-speaking .voice-ripple-2 {
  animation-delay: 0.6s;
}

.voice-state-speaking .voice-ripple-3 {
  animation-delay: 1.2s;
}

.voice-state-speaking .voice-orb {
  animation: voice-orb-speak 1.5s ease-in-out infinite;
}

.voice-state-speaking .voice-glow {
  opacity: 1;
  animation: voice-glow-pulse 1.5s ease-in-out infinite;
}

/* Voice bar animation for listening icon */
.voice-state-listening .voice-bar,
.voice-state-speaking .voice-bar {
  transform-origin: bottom center;
  animation: voice-bar-bounce 0.8s ease-in-out infinite;
}

.voice-bar-1 { animation-delay: 0s !important; }
.voice-bar-2 { animation-delay: 0.1s !important; }
.voice-bar-3 { animation-delay: 0.2s !important; }
.voice-bar-4 { animation-delay: 0.15s !important; }
.voice-bar-5 { animation-delay: 0.25s !important; }

/* Interrupted State */
.voice-state-interrupted .voice-orb {
  animation: voice-orb-breathe 2s ease-in-out infinite;
}

.voice-state-interrupted .voice-glow {
  opacity: 0.5;
}

/* Transcript Scroll */
.voice-transcript-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.voice-transcript-scroll::-webkit-scrollbar {
  width: 4px;
}

.voice-transcript-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.voice-transcript-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .blob {
    @apply w-48 h-48;
  }

  #flash-container {
    @apply top-4 right-4 left-4;
  }

  .flash-toast {
    @apply min-w-full;
  }
}
