/* ================================
   svaib Design System
   ================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@600;700;800&display=swap');

/* ================================
   CSS Variables
   ================================ */
:root {
  /* Primary (Бирюзовый) */
  --color-primary: #00B4A6;
  --color-primary-hover: #008B7F;
  --color-primary-light: #E0F7F5;
  --color-primary-subtle: #F0FDFB;
  
  /* Accent (Розовый) - только для сайта */
  --color-accent: #FF4D8D;
  --color-accent-hover: #E6548A;
  --color-accent-light: #FFE5ED;
  
  /* Gradient - только для CTA на сайте */
  --gradient-hero: linear-gradient(135deg, #00B4A6 0%, #FF4D8D 100%);
  
  /* Backgrounds */
  --bg-primary: #FAFBFC;
  --bg-secondary: #F3F4F6;
  --surface: #FFFFFF;
  
  /* Text */
  --text-primary: #1A1A1A;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --text-on-primary: #FFFFFF;
  
  /* Borders */
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  
  /* States */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;
  
  /* Typography */
  --font-heading: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Spacing */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.02), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.02), 0 12px 24px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.04), 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* ================================
   Reset & Base
   ================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================
   Typography
   ================================ */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: 42px;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}

h2 {
  font-size: 32px;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-5);
}

h3 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

h4 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: var(--space-3);
}

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

/* ================================
   Buttons
   ================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

/* Primary Button */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--text-on-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

/* Gradient CTA Button */
.btn-gradient {
  background: var(--gradient-hero);
  color: var(--text-on-primary);
}

.btn-gradient:hover {
  box-shadow: var(--shadow-lg);
}

/* Secondary Button */
.btn-secondary {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  box-shadow: none;
}

.btn-secondary:hover {
  background-color: var(--color-primary-hover);
  color: var(--text-on-primary);
}

/* Button Sizes */
.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

/* ================================
   Cards
   ================================ */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-clickable {
  cursor: pointer;
}

.card-highlighted {
  background-color: var(--color-primary-light);
  border: 1px solid var(--color-primary);
}

/* Card Icon */
.card-icon {
  width: 48px;
  height: 48px;
  background-color: var(--color-primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--space-4);
}

/* ================================
   Badges
   ================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.badge-gradient {
  background: var(--gradient-hero);
  color: var(--text-on-primary);
}

.badge-accent {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.badge-success {
  background: #D1FAE5;
  color: var(--success);
}

.badge-warning {
  background: #FEF3C7;
  color: var(--warning);
}

.badge-error {
  background: #FEE2E2;
  color: var(--error);
}

/* ================================
   Forms
   ================================ */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--surface);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--color-primary);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-tertiary);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ================================
   Layout
   ================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-16) 0;
}

.section-sm {
  padding: var(--space-12) 0;
}

/* ================================
   Grid
   ================================ */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

/* ================================
   Utilities
   ================================ */
.text-center {
  text-align: center;
}

.text-secondary {
  color: var(--text-secondary);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mt-8 {
  margin-top: var(--space-8);
}

.hidden {
  display: none !important;
}

/* ================================
   App-specific Styles
   ================================ */

/* Screen transitions */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Header */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-6);
}

.breadcrumbs-item {
  color: var(--text-tertiary);
}

.breadcrumbs-item.active {
  color: var(--color-primary);
  font-weight: 600;
}

.breadcrumbs-separator {
  color: var(--border);
}

/* Role cards */
.role-card {
  position: relative;
  overflow: hidden;
}

.role-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-primary);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.role-card:hover::before {
  transform: scaleX(1);
}

.role-tagline {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

/* Task list */
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: var(--space-3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.task-item.recommended {
  border-left: 4px solid var(--color-primary);
}

.task-badges {
  display: flex;
  gap: var(--space-2);
}

/* Chat interface */
.chat-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 800px;
  margin: 0 auto;
}

.chat-message {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.chat-message.ai-response {
  background: var(--color-primary-subtle);
  border-left: 4px solid var(--color-primary);
}

/* Typing animation */
@keyframes typing {
  from { 
    width: 0;
    opacity: 0;
  }
  to { 
    width: 100%;
    opacity: 1;
  }
}

.typing-indicator {
  display: inline-block;
  animation: typing 2s ease-in-out;
}

/* Landing hero */
.hero {
  text-align: center;
  padding: var(--space-16) 0;
}

.hero-title {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-6);
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Loading state */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6);
  color: var(--text-secondary);
}

.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: loading-bounce 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes loading-bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5 {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: 32px;
  }
  
  h2 {
    font-size: 24px;
  }
  
  .section {
    padding: var(--space-12) 0;
  }
}
