/* Movate 2.0 — Refined Dark Theme with Sophisticated Design
   Fixed layout, proper spacing, and distinct aesthetic */

/* ===================== THEME TOKENS ===================== */
:root {
  /* Core Colors - Deep ocean theme */
  --bg: #0a0e1a;
  --bg-2: #0f1420;
  --surface: rgba(15, 20, 32, 0.85);
  --surface-elevated: rgba(20, 28, 45, 0.92);
  --text: #f0f4ff;
  --text-muted: #8b95b0;
  --text-dim: #5a6480;
  
  /* Accent Colors - Cyan/Teal instead of purple */
  --accent: #00d4ff;
  --accent-2: #00ffcc;
  --accent-dark: #0099cc;
  
  /* Effects */
  --glass-border: rgba(255, 255, 255, 0.1);
  --glow: 0 0 20px rgba(0, 212, 255, 0.25), 0 0 40px rgba(0, 255, 204, 0.15);
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.6);
  
  /* Sizing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --maxw: 1200px;
  
  /* Transitions */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================== BASE RESET ===================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  background: 
    radial-gradient(ellipse 1400px 800px at 80% 10%, rgba(0, 212, 255, 0.06), transparent),
    radial-gradient(ellipse 1000px 600px at 20% 90%, rgba(0, 255, 204, 0.08), transparent),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
  overflow: hidden;
}

/* ===================== UTILITY CLASSES ===================== */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===================== GLASS PANEL ===================== */
.glass-panel {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ===================== HERO SECTION ===================== */
.hero {
  position: relative;
  min-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 40px;
}

.hero-spline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 80px 32px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-title {
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(18px, 2vw, 24px);
  color: var(--text-muted);
  margin: 0;
  font-weight: 300;
}

/* ===================== ANSWER ENGINE (Collapsed State) ===================== */
.answer-engine {
  margin-bottom: 60px;
}

.answer-engine__container {
  padding: 48px 40px;
}

.answer-engine__container h2 {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  margin: 0 0 24px;
  line-height: 1.3;
}

.answer-engine__container .accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Input Form */
.answer-engine__form {
  margin: 24px 0 32px;
}

.answer-engine__input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  transition: all var(--transition);
}

.answer-engine__input:hover {
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.answer-engine__input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.ai-orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.4);
  flex-shrink: 0;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.6), 0 0 40px rgba(0, 255, 204, 0.3);
  }
}

.answer-engine__input input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}

.answer-engine__input input::placeholder {
  color: var(--text-dim);
}

.ai-submit {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 255, 204, 0.15));
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.ai-submit:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(0, 255, 204, 0.25));
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.ai-submit:active {
  transform: translateY(0);
}

/* Suggestions */
.answer-engine__suggestions {
  margin-top: 32px;
}

.answer-engine__suggestions .muted {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 16px;
}

.suggest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.suggest-chip {
  text-align: left;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
}

.suggest-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.suggest-chip:active {
  transform: translateY(0);
}

/* ===================== AI PANEL (Fullscreen) ===================== */
.ai-panel {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  padding: 20px;
}

.ai-panel.is-open {
  opacity: 1;
  pointer-events: auto;
}

.ai-panel__inner {
  width: 100%;
  max-width: 1100px;
  height: 90vh;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  background: var(--surface-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  position: relative;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition);
}

.ai-panel.is-open .ai-panel__inner {
  transform: scale(1);
}

/* Close Button */
.ai-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  transition: all var(--transition);
}

.ai-close:hover {
  background: rgba(255, 0, 85, 0.15);
  border-color: rgba(255, 0, 85, 0.5);
  color: #ff0055;
}

/* Thread Container */
.ai-thread {
  flex: 1;
  padding: 80px 32px 24px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom Scrollbar */
.ai-thread::-webkit-scrollbar {
  width: 8px;
}

.ai-thread::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}

.ai-thread::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.3);
  border-radius: 4px;
}

.ai-thread::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.5);
}

/* Message Styles */
.msg {
  display: flex;
  gap: 16px;
  margin: 20px 0;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.msg--bot .msg-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.4);
}

.msg--user .msg-avatar {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.msg-body {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  line-height: 1.6;
}

.msg--user .msg-body {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Thinking Animation */
.thinking {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  margin-left: 56px;
}

.thinking span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
  animation: bounce 1.2s ease-in-out infinite;
}

.thinking span:nth-child(1) {
  animation-delay: 0s;
}

.thinking span:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Composer */
.ai-panel__composer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--glass-border);
}

.ai-panel__composer input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 14px 18px;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  transition: all var(--transition);
}

.ai-panel__composer input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.ai-panel__composer input::placeholder {
  color: var(--text-dim);
}

/* ===================== SERVICES SECTION ===================== */
.services h2 {
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 700;
  margin: 0 0 32px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.service-card {
  padding: 32px 28px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition);
  opacity: 0;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow), var(--shadow-soft);
  border-color: var(--accent);
}

.service-icon {
  font-size: 40px;
  opacity: 0.9;
  line-height: 1;
}

.service-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.service-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .wrap {
    padding: 40px 20px;
  }
  
  .answer-engine__container {
    padding: 36px 28px;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 50vh;
  }
  
  .hero-overlay {
    padding: 60px 24px;
  }
  
  .answer-engine__container {
    padding: 28px 24px;
  }
  
  .suggest-grid {
    grid-template-columns: 1fr;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .ai-panel {
    padding: 12px;
  }
  
  .ai-panel__inner {
    height: 95vh;
    border-radius: var(--radius-md);
  }
  
  .ai-thread {
    padding: 70px 20px 20px;
  }
  
  .msg {
    gap: 12px;
  }
  
  .msg-avatar {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }
  
  .answer-engine__input {
    padding: 12px 16px;
  }
  
  .ai-orb {
    width: 24px;
    height: 24px;
  }
  
  .answer-engine__input input {
    font-size: 15px;
  }
  
  .ai-submit {
    width: 40px;
    height: 40px;
  }
  
  .suggest-chip {
    padding: 14px 16px;
    font-size: 14px;
  }
}