/* ═══════════════════════════════════════════════════════════════════════════
   SCAPBOT DESIGN SYSTEM - Clean Minimalism
   No build required - Works with Tailwind CDN
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base Styles */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  scroll-behavior: smooth;
}

::selection {
  background-color: #e0e7ff;
  color: #312e81;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base button styles - shared by all button variants */
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease-out;
  cursor: pointer;
  border: none;
}

.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button - Indigo */
.btn-primary {
  background-color: #4f46e5;
  color: white;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-primary:hover:not(:disabled) {
  background-color: #4338ca;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.btn-primary:active:not(:disabled) {
  background-color: #3730a3;
}

/* Secondary Button - Outlined */
.btn-secondary {
  background-color: white;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

/* Ghost Button - Transparent */
.btn-ghost {
  background-color: transparent;
  color: #475569;
}

.btn-ghost:hover:not(:disabled) {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* Danger Button - Red */
.btn-danger {
  background-color: #dc2626;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background-color: #b91c1c;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════════════════════════════════════════ */

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  color: #0f172a;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.input::placeholder {
  color: #94a3b8;
}

.input:hover {
  border-color: #cbd5e1;
}

.input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-error {
  border-color: #fca5a5;
}

.input-error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.375rem;
}

.input-hint {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: #64748b;
}

.input-error-text {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: #dc2626;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04);
}

.card-hover {
  transition: all 0.2s;
}

.card-hover:hover {
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LINKS
   ═══════════════════════════════════════════════════════════════════════════ */

.link {
  color: #4f46e5;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.link:hover {
  color: #4338ca;
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING SPINNER
   ═══════════════════════════════════════════════════════════════════════════ */

.spinner {
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  border-top-color: #4f46e5;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 1rem;
  height: 1rem;
}

.spinner-md {
  width: 1.5rem;
  height: 1.5rem;
}

.spinner-lg {
  width: 2rem;
  height: 2rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */

.alert,
.alert-info,
.alert-success,
.alert-warning,
.alert-error {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
}

.alert-info {
  background-color: #eff6ff;
  color: #1e40af;
}

.alert-success {
  background-color: #ecfdf5;
  color: #065f46;
}

.alert-warning {
  background-color: #fffbeb;
  color: #92400e;
}

.alert-error {
  background-color: #fef2f2;
  color: #991b1b;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES - Modern Tech Background
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  /* Gradient background */
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

/* Animated mesh gradient overlay */
.auth-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 60%);
  animation: meshMove 15s ease-in-out infinite;
  pointer-events: none;
}

/* Grid pattern overlay */
.auth-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

@keyframes meshMove {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-20px, 10px) scale(1.02);
  }
  66% {
    transform: translate(20px, -10px) scale(0.98);
  }
}

/* Floating orbs */
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
}

.auth-orb-1 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.auth-orb-2 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

.auth-orb-3 {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  top: 50%;
  right: 20%;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(30px, -30px) rotate(5deg);
  }
  50% {
    transform: translate(-20px, 20px) rotate(-5deg);
  }
  75% {
    transform: translate(20px, 30px) rotate(3deg);
  }
}

/* Auth card - white background */
.auth-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 28rem;
  background: #ffffff;
  border-radius: 1.5rem;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 2.5rem;
  animation: cardSlideUp 0.5s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.auth-subtitle {
  color: #64748b;
  font-size: 0.95rem;
}

@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Dark mode support */
.dark .auth-container {
  background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #020617 100%);
}

.dark .auth-card {
  background: #1e293b;
}

.dark .auth-title {
  color: #f8fafc;
}

.dark .auth-subtitle {
  color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OTP INPUT
   ═══════════════════════════════════════════════════════════════════════════ */

.otp-input {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  color: #0f172a;
  transition: all 0.2s;
}

.otp-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   INDUSTRY CARDS (Onboarding)
   ═══════════════════════════════════════════════════════════════════════════ */

.industry-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.industry-card:hover {
  border-color: #a5b4fc;
  background-color: #eef2ff;
}

.industry-card.selected {
  border-color: #6366f1;
  background-color: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.industry-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background-color: #f1f5f9;
  color: #475569;
}

.industry-card.selected .industry-icon {
  background-color: #e0e7ff;
  color: #4f46e5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AVATAR PICKER (Onboarding)
   ═══════════════════════════════════════════════════════════════════════════ */

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

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

.avatar-option.selected {
  transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DEMO CHAT PAGE - Uses auth background + glassmorphism
   ═══════════════════════════════════════════════════════════════════════════ */

.demo-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 56rem;
  height: 92vh;
  max-height: 900px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cardSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.demo-card-body {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.demo-card-body::-webkit-scrollbar {
  width: 6px;
}
.demo-card-body::-webkit-scrollbar-track {
  background: transparent;
}
.demo-card-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.demo-card-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.demo-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

/* Chat bubbles */
.chat-bubble-user {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  border-radius: 1.25rem 1.25rem 0.375rem 1.25rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  animation: bubbleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-bubble-assistant {
  background: white;
  color: #1e293b;
  border-radius: 1.25rem 1.25rem 1.25rem 0.375rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  animation: bubbleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Assistant card in selector */
.assistant-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s ease-out;
  background: white;
}

.assistant-card:hover {
  border-color: #a5b4fc;
  background: #eef2ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.assistant-card.selected {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Typing dots */
.typing-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .dark\:bg-surface-800 {
    background-color: #1e293b;
  }
  .dark\:text-white {
    color: white;
  }
}
