:root {
  /* Magical color palette */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

  --primary-color: #667eea;
  --primary-dark: #5a67d8;
  --primary-light: #7c3aed;
  --secondary-color: #ec4899;
  --accent-color: #14b8a6;

  --background: #0f0f23;
  --surface: #1a1a2e;
  --surface-light: #2a2a3e;
  --card-bg: rgba(255, 255, 255, 0.03);

  --text-primary: #ffffff;
  --text-secondary: #a0a0b8;
  --text-muted: #6b7280;

  --border: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);

  --error: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;

  --glow: 0 0 40px rgba(102, 126, 234, 0.6);
  --glow-intense: 0 0 80px rgba(102, 126, 234, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
  z-index: 0;
  animation: backgroundShift 20s ease infinite;
}

@keyframes backgroundShift {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Hero Section with magical effects */
.hero {
  background: var(--primary-gradient);
  color: white;
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
  to { text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 40px rgba(102, 126, 234, 0.8); }
}

.subtitle {
  font-size: 1.25rem;
  opacity: 0.95;
  font-weight: 300;
}

/* Magical particles */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: float 15s infinite;
}

@keyframes float {
  0%, 100% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10%, 90% {
    opacity: 1;
  }
  50% {
    transform: translateY(-100vh) scale(1);
  }
}

/* Chat Container with glassmorphism */
.chat-container {
  max-width: 900px;
  margin: -60px auto 40px;
  position: relative;
  z-index: 10;
}

.chat-wrapper {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.02)
  );
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px var(--success);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 40px var(--success);
  }
}

/* Chat Messages */
.chat-messages {
  height: 450px;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.message {
  display: flex;
  gap: 12px;
  animation: messageSlide 0.4s ease-out;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
  animation: messageSlideRight 0.4s ease-out;
}

@keyframes messageSlideRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.message-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.message.user .message-avatar {
  background: var(--secondary-gradient);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.message-content {
  max-width: 70%;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
}

.message.user .message-content {
  background: var(--primary-gradient);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

/* Chat Input */
.chat-input-wrapper {
  padding: 24px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.chat-input-container {
  display: flex;
  gap: 12px;
}

/* Option bar and buttons */
.option-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 6px 2px 6px;
}

.option-btn {
  appearance: none;
  border: 1px solid rgba(102, 126, 234, 0.35);
  background: white;
  color: #334155;
  padding: 10px 14px;
  border-radius: 9999px; /* pill */
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: background 0.15s ease, transform 0.05s ease, border-color 0.15s ease;
}

.option-btn:hover {
  background: #f7f8ff;
  border-color: rgba(102,126,234,0.6);
}

.option-btn:active {
  transform: translateY(1px);
}

.chat-input {
  flex: 1;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  color: var(--text-primary);
  transition: all 0.3s;
}

.chat-input::placeholder {
  color: var(--text-secondary);
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}

.send-btn {
  padding: 14px 24px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
}

.send-btn:active:not(:disabled) {
  transform: translateY(0);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 0;
}

.typing-indicator span {
  width: 10px;
  height: 10px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: typing 1.4s infinite;
  box-shadow: 0 0 10px var(--primary-color);
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Progress Bar */
.progress-container {
  padding: 30px 20px;
}

.progress-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
}

.progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 10px;
  transition: width 0.5s ease;
  width: 14%;
  box-shadow: 0 0 20px var(--primary-color);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
}

.step {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  position: relative;
  transition: all 0.3s;
}

.step.active {
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-color);
}

.step.completed {
  color: var(--success);
}

/* Features Section */
.features {
  padding: 80px 0;
  background: linear-gradient(180deg, transparent, rgba(102, 126, 234, 0.03));
  position: relative;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  margin-top: 50px;
}

.feature {
  text-align: center;
  padding: 30px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid var(--border-light);
  transition: all 0.3s;
}

.feature:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 20px currentColor);
}

.feature h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--text-primary);
  font-weight: 600;
}

.feature p {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Disclaimer Section */
.disclaimer {
  padding: 40px 0;
  background: rgba(239, 68, 68, 0.05);
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  margin-top: 60px;
}

.disclaimer-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.disclaimer h3 {
  color: var(--error);
  margin-bottom: 20px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.disclaimer h3::before {
  content: '⚠️';
  font-size: 1.5rem;
}

.disclaimer-text {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}

.disclaimer-list {
  list-style: none;
  padding: 0;
}

.disclaimer-list li {
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-left: 24px;
  position: relative;
}

.disclaimer-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--error);
  font-weight: bold;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--surface);
  padding: 40px;
  border-radius: 24px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Footer */
.footer {
  padding: 30px 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s;
}

.footer a:hover {
  text-shadow: 0 0 10px var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .chat-messages {
    height: 350px;
  }

  .message-content {
    max-width: 85%;
  }

  .progress-steps {
    display: none;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .disclaimer-content {
    padding: 20px;
  }
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
