/* Import typography styles */
@import 'styles/typography.css';
@import 'styles/header.css';

/* Base styles */
body {
  background-color: #111827;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Particle background */
.particle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Dark background overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 24, 39, 0.95);
  z-index: -2;
  pointer-events: none;
}

.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: 
    radial-gradient(circle at 10% 20%, rgba(20, 184, 166, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(129, 140, 248, 0.1) 0%, transparent 50%);
  animation: pulse 15s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.1);
  }
}

.gradient-text {
  background: linear-gradient(to right, #14b8a6, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin: 0;
  padding: 0;
}

/* Glow effect for active page */
.logo-text.gradient-text {
  transition: text-shadow 0.3s ease;
}

body[data-page="index"] .logo-text.gradient-text {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0% {
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.3),
                 0 0 20px rgba(129, 140, 248, 0.2);
  }
  50% {
    text-shadow: 0 0 15px rgba(20, 184, 166, 0.6),
                 0 0 30px rgba(129, 140, 248, 0.4);
  }
  100% {
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.3),
                 0 0 20px rgba(129, 140, 248, 0.2);
  }
}

.glow {
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.3);
}

.card {
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(20, 184, 166, 0.2);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Button hover effects */
.btn-hover {
  transition: all 0.3s ease;
}

.btn-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

/* Navigation hover effects */
nav a {
  position: relative;
  transition: color 0.3s ease;
  text-decoration: none !important;
}

nav a:hover,
nav a:focus,
nav a:active {
  text-decoration: none !important;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #14b8a6;
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* Navigation Styles */
.nav-link {
  position: relative;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.3s ease;
  padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 4px;
  height: 4px;
  background-color: #14b8a6;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: translateX(-50%) scale(1);
}

.nav-link,
.nav-link:hover,
.nav-link:focus,
.nav-link:active {
  border-bottom: none !important;
  outline: none !important;
}

.nav-link:hover {
  color: #4F46E5;
}

.nav-link.active {
  color: #4F46E5;
  position: relative;
}

.nav-link::after,
.nav-link:hover::after {
  display: none !important;
}

/* Active Dot */
.active-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #4F46E5;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 6px #4F46E5;
  opacity: 1;
}

/* Dot Sparks */
.dot-spark {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #4F46E5;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  filter: blur(1px);
  box-shadow: 0 0 8px #4F46E5;
}

@keyframes sparkFly {
  0% {
    transform: translate(0, 0) scale(0.3);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
  }
  60% {
    opacity: 0.7;
  }
  100% {
    transform: translate(var(--x), var(--y)) scale(0);
    opacity: 0;
  }
}

/* Spark Container */
.spark-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* Remove outline/box when clicked */
.nav-link:focus {
  outline: none;
  box-shadow: none;
}

/* Remove focus outline */
a:focus,
button:focus,
.nav-link:focus,
.btn:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Spark Effect */
.spark {
  position: absolute;
  pointer-events: none;
  width: 4px;
  height: 4px;
  background: #4F46E5;
  border-radius: 50%;
  opacity: 0;
  animation: spark 0.8s ease-out;
}

@keyframes spark {
  0% {
    transform: scale(0) translate(0, 0);
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: scale(1.2) translate(20px, -20px);
    opacity: 0;
  }
}

.spark-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Particles */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(79, 70, 229, 0.15); /* Much more transparent */
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.1);
  animation: float var(--duration) ease-in-out infinite;
  opacity: 0.3; /* Reduced opacity */
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(var(--x), var(--y));
  }
}

/* Spark Container */
.spark-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* Form styles */
input, textarea {
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  width: 100%;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

/* Grid layouts */
.grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Utility classes */
.backdrop-blur {
  backdrop-filter: blur(8px);
}

.text-gradient {
  background: linear-gradient(to right, #14b8a6, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Avatar styles */
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #14b8a6;
  color: white;
  font-weight: 600;
}

/* Chat container styles */
.chat-container {
  overflow-y: auto;
  max-height: 600px;
  scroll-behavior: smooth;
}

.message {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.message.user {
  flex-direction: row-reverse;
}

.message-content {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.message.assistant .message-content {
  background-color: rgba(31, 41, 55, 0.8);
  color: #fff;
}

.message.user .message-content {
  background-color: rgba(20, 184, 166, 0.2);
  color: #fff;
}

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
}

.message.assistant .avatar {
  background-color: #14b8a6;
}

.message.user .avatar {
  background-color: #4f46e5;
}

.message-content ul {
  margin-top: 0.5rem;
  margin-left: 1.25rem;
}

.message-content li {
  margin-bottom: 0.25rem;
}

/* Particle canvas */
.particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.5;
  z-index: -1;
}

/* Button glow effect */
.glow-button {
  position: relative;
  overflow: hidden;
}

.glow-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  background: rgba(20, 184, 166, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.3s ease;
}

.glow-button:hover::before {
  transform: translate(-50%, -50%) scale(1.5);
}

/* Loading animation */
.loading {
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  border: 4px solid transparent;
  border-top-color: #14b8a6;
  border-radius: 50%;
  animation: loading-spinner 1s ease infinite;
}

@keyframes loading-spinner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Form feedback animations */
.form-success {
  animation: success-pulse 0.5s ease;
}

@keyframes success-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.form-error {
  animation: error-shake 0.5s ease;
}

@keyframes error-shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Enhanced logo animation for home page */
.logo-active {
  background: linear-gradient(to right, #00ffeb, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: glowPulse 2s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(0, 255, 235, 0.5);
}

@keyframes glowPulse {
  0% {
    filter: brightness(1);
    text-shadow: 0 0 10px rgba(0, 255, 235, 0.5);
  }
  50% {
    filter: brightness(1.3);
    text-shadow: 0 0 20px rgba(0, 255, 235, 0.8);
  }
  100% {
    filter: brightness(1);
    text-shadow: 0 0 10px rgba(0, 255, 235, 0.5);
  }
}

/* Animated background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, rgba(20, 184, 166, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(129, 140, 248, 0.1) 0%, transparent 50%);
  animation: pulse 15s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.1);
  }
}

/* Navigation link styling */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
  background: linear-gradient(to right, #14b8a6, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #14b8a6;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active::after {
  width: 100%;
}

/* Navigation link styles */
.nav-link {
  position: relative;
  text-decoration: none;
  color: #6b7280;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 4px;
  height: 4px;
  background-color: #14b8a6;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-link:hover {
  color: #ffffff;
}

.nav-link:hover::after {
  opacity: 1;
}

.nav-link.active {
  color: #ffffff;
}

.nav-link.active::after {
  opacity: 1;
}

/* Navigation overrides to prevent underlines */
nav a,
nav a:hover,
nav a:focus,
nav a:active,
nav a:visited {
  text-decoration: none !important;
  border-bottom: none !important;
}

/* Alert Components */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #10B981;
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

@keyframes slideIn {
  from {
    transform: translateY(-1rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Form States */
.form-success {
  background-color: rgba(16, 185, 129, 0.1) !important;
  border-color: #10B981 !important;
  color: #10B981 !important;
}

.form-error {
  background-color: rgba(239, 68, 68, 0.1) !important;
  border-color: #EF4444 !important;
  color: #EF4444 !important;
}

/* Primary Button Style */
.btn-primary {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background-color: #14b8a6;
  color: white;
  border-radius: 9999px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: #0d9488;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(20, 184, 166, 0.1), 0 2px 4px -1px rgba(20, 184, 166, 0.06);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Gradient text styles */
.gradient-text {
  background: linear-gradient(to right, #14b8a6, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;
}

/* Base styles */
.gradient-text {
  background: linear-gradient(to right, #14b8a6, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;
}

/* Button styles */
.btn-primary {
  background: linear-gradient(to right, #14b8a6, #818cf8);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Loading animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .text-6xl {
    font-size: 2.5rem;
  }
  
  .text-4xl {
    font-size: 2rem;
  }
  
  .py-20 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

/* Performance optimizations */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessibility improvements */
:focus {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Button styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #14b8a6, #818cf8);
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Main content styles */
main {
  padding-top: 6rem; /* Ensures content starts below fixed header */
}

/* Ensure proper stacking context */
.particle-background {
  z-index: 0;
}

/* Footer styles */
footer {
  background: rgba(17, 24, 39, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Utility classes */
.text-gray-300 {
  color: #d1d5db;
}

.text-gray-400 {
  color: #9ca3af;
}

/* Focus styles */
:focus {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hidden {
    display: none;
  }
  
  .mobile-menu {
    display: block;
  }
}
