/* ==================================
   PyLand - Современный дизайн онлайн школы
   ================================== */

/* CSS Custom Properties (Variables) */
:root {
  /* === Layout === */
  --header-height: 140px; /* Full header height: header-top (~60px) + header-main (~80px) */

  /* === Цветовая палитра === */
  /* Основные цвета */
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #7dd3fc;
  --primary-400: #38bdf8;
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --primary-800: #075985;
  --primary-900: #0c4a6e;

  /* Вторичные цвета */
  --secondary-50: #fafaf9;
  --secondary-100: #f5f5f4;
  --secondary-200: #e7e5e4;
  --secondary-300: #d6d3d1;
  --secondary-400: #a8a29e;
  --secondary-500: #78716c;
  --secondary-600: #57534e;
  --secondary-700: #44403c;
  --secondary-800: #292524;
  --secondary-900: #1c1917;

  /* Успех */
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-200: #bbf7d0;
  --success-300: #86efac;
  --success-400: #4ade80;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  --success-800: #166534;
  --success-900: #14532d;

  /* Предупреждение */
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-200: #fde68a;
  --warning-300: #fcd34d;
  --warning-400: #fbbf24;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;
  --warning-800: #92400e;
  --warning-900: #78350f;

  /* Ошибка */
  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-200: #fecaca;
  --error-300: #fca5a5;
  --error-400: #f87171;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-700: #b91c1c;
  --error-800: #991b1b;
  --error-900: #7f1d1d;

  /* Нейтральные цвета */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Базовые цвета для светлой темы */
  --white: #ffffff;
  --black: #000000;

  /* Фоны для светлой темы */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-color: #ffffff;

  /* Текстовые цвета для светлой темы */
  --text-color: #111827;
  --text-muted: #6b7280;
  --text-secondary: #4b5563;

  /* Границы для светлой темы */
  --border-color: #e5e7eb;

  /* === Градиенты === */
  --gradient-primary: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--secondary-400) 0%, var(--secondary-600) 100%);
  --gradient-success: linear-gradient(135deg, var(--success-400) 0%, var(--success-600) 100%);
  --gradient-hero: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 50%, var(--secondary-800) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

  /* === Тени === */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

  /* === Типографика === */
  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-family-serif: 'Playfair Display', Georgia, serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Liberation Mono', monospace;

  /* Размеры шрифтов */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */
  --text-6xl: 3.75rem;    /* 60px */
  --text-7xl: 4.5rem;     /* 72px */
  --text-8xl: 6rem;       /* 96px */
  --text-9xl: 8rem;       /* 128px */

  /* Высота строк */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* === Отступы === */
  --spacing-0: 0px;
  --spacing-1: 0.25rem;   /* 4px */
  --spacing-2: 0.5rem;    /* 8px */
  --spacing-3: 0.75rem;   /* 12px */
  --spacing-4: 1rem;      /* 16px */
  --spacing-5: 1.25rem;   /* 20px */
  --spacing-6: 1.5rem;    /* 24px */
  --spacing-8: 2rem;      /* 32px */
  --spacing-10: 2.5rem;   /* 40px */
  --spacing-12: 3rem;     /* 48px */
  --spacing-16: 4rem;     /* 64px */
  --spacing-20: 5rem;     /* 80px */
  --spacing-24: 6rem;     /* 96px */
  --spacing-32: 8rem;     /* 128px */

  /* === Радиусы скругления === */
  --radius-none: 0px;
  --radius-sm: 0.125rem;  /* 2px */
  --radius-md: 0.375rem;  /* 6px */
  --radius-lg: 0.5rem;    /* 8px */
  --radius-xl: 0.75rem;   /* 12px */
  --radius-2xl: 1rem;     /* 16px */
  --radius-3xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;

  /* === Анимации === */
  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.25s ease-out;
  --transition-slow: 0.4s ease-out;

  /* === Размеры экранов === */
  --screen-sm: 640px;
  --screen-md: 768px;
  --screen-lg: 1024px;
  --screen-xl: 1280px;
  --screen-2xl: 1536px;

  /* === Z-индексы === */
  --z-negative: -1;
  --z-0: 0;
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
  --z-40: 40;
  --z-50: 50;
  --z-modal: 1000;
  --z-popover: 1010;
  --z-tooltip: 1020;
  --z-toast: 1030;
}

/* Темная тема */
[data-theme="dark"] {
  /* Переопределение цветов для темной темы */
  --primary-50: #0c1e2e;
  --primary-100: #1e3a5f;
  --gray-50: #111827;
  --gray-100: #1f2937;
  --gray-200: #374151;
  --gray-300: #4b5563;
  --gray-400: #6b7280;
  --gray-500: #9ca3af;
  --gray-600: #d1d5db;
  --gray-700: #e5e7eb;
  --gray-800: #f3f4f6;
  --gray-900: #f9fafb;

  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

/* === Базовая настройка === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--gray-800);
  background-color: var(--gray-50);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* === Типографика === */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--leading-tight);
  margin-bottom: var(--spacing-4);
  color: var(--gray-900);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--spacing-4);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--primary-700);
  text-decoration: underline;
}

/* === Утилитарные классы === */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: var(--gradient-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.container {
  width: 100%;
  max-width: var(--screen-xl);
  margin: 0 auto;
  padding: 0 var(--spacing-4);
}

@media (min-width: 640px) {
  .container { padding: 0 var(--spacing-6); }
}

@media (min-width: 1024px) {
  .container { padding: 0 var(--spacing-8); }
}

/* === Main Content Layout === */
main,
.main-content {
  padding-top: var(--header-height);
}

/* Для секций которые идут сразу после header */
main > section:first-child,
.main-content > section:first-child,
main > .revolutionary-hero-home:first-child,
.main-content > .revolutionary-hero-home:first-child {
  padding-top: var(--header-height);
}

/* === Скрытие элементов === */
.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;
}

/* === Сброс стилей для изображений === */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === Сброс стилей для списков === */
ul, ol {
  padding-left: var(--spacing-6);
  margin-bottom: var(--spacing-4);
}

li {
  margin-bottom: var(--spacing-1);
}

/* === Стили для кода === */
code {
  font-family: var(--font-family-mono);
  font-size: 0.9em;
  background-color: var(--gray-100);
  padding: var(--spacing-1) var(--spacing-2);
  border-radius: var(--radius-md);
  color: var(--primary-700);
}

pre {
  background-color: var(--gray-900);
  color: var(--gray-100);
  padding: var(--spacing-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--spacing-4);
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* === Анимации === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-slow) ease-out;
}

.animate-slide-up {
  animation: slideInUp var(--transition-slow) ease-out;
}

.animate-slide-down {
  animation: slideInDown var(--transition-slow) ease-out;
}

.animate-scale-in {
  animation: scaleIn var(--transition-slow) ease-out;
}

/* === Медиа-запросы для темной темы === */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    /* Автоматическая темная тема */
    --primary-50: #0c1e2e;
    --primary-100: #1e3a5f;
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;
  }
}

/* === Стили для фокуса === */
*:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* === Стили для выделения текста === */
::selection {
  background-color: var(--primary-200);
  color: var(--primary-900);
}

::-moz-selection {
  background-color: var(--primary-200);
  color: var(--primary-900);
}

/* === Стили для прокрутки === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* === Responsive утилиты === */
@media (max-width: 639px) {
  .hidden-mobile { display: none !important; }
}

@media (min-width: 640px) and (max-width: 767px) {
  .hidden-tablet { display: none !important; }
}

@media (min-width: 768px) {
  .hidden-desktop { display: none !important; }
}

@media (max-width: 767px) {
  .mobile-only { display: block !important; }
}

@media (min-width: 768px) {
  .desktop-only { display: block !important; }
}

/* === ТЕМНАЯ ТЕМА === */
[data-theme="dark"] {
  /* Переопределение цветов для темной темы */
  --white: #1a1a1a;
  --black: #ffffff;

  /* Серые цвета для темной темы */
  --gray-50: #1f1f1f;
  --gray-100: #2a2a2a;
  --gray-200: #3a3a3a;
  --gray-300: #4a4a4a;
  --gray-400: #6a6a6a;
  --gray-500: #8a8a8a;
  --gray-600: #a0a0a0;
  --gray-700: #c0c0c0;
  --gray-800: #e0e0e0;
  --gray-900: #ffffff;
  --gray-950: #ffffff;

  /* Фоны для темной темы */
  --bg-primary: #1a1a1a;
  --bg-secondary: #2a2a2a;
  --bg-tertiary: #3a3a3a;
  --bg-color: #1a1a1a;

  /* Текстовые цвета для темной темы */
  --text-color: #ffffff;
  --text-muted: #a0a0a0;
  --text-secondary: #c0c0c0;

  /* Границы для темной темы */
  --border-color: #4a4a4a;

  /* Обновленные градиенты для темной темы */
  --gradient-primary: linear-gradient(135deg, var(--primary-600) 0%, var(--secondary-600) 100%);
  --gradient-success: linear-gradient(135deg, var(--success-600) 0%, var(--success-700) 100%);
  --gradient-warning: linear-gradient(135deg, var(--warning-600) 0%, var(--warning-700) 100%);
  --gradient-error: linear-gradient(135deg, var(--error-600) 0%, var(--error-700) 100%);
}

/* Переходы для плавного переключения темы */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Специальные стили для темной темы */
[data-theme="dark"] body {
  background-color: var(--gray-50);
  color: var(--gray-900);
}

[data-theme="dark"] .card {
  background-color: var(--gray-100);
  border-color: var(--gray-200);
}

[data-theme="dark"] .header {
  background-color: rgba(26, 26, 26, 0.95);
  border-bottom-color: var(--gray-200);
}

[data-theme="dark"] .footer {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  border-top: 1px solid rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .footer-newsletter {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .footer-main {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .newsletter-title {
  color: #f8fafc;
}

[data-theme="dark"] .newsletter-subtitle {
  color: #cbd5e1;
}

[data-theme="dark"] .newsletter-input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #f8fafc;
}

[data-theme="dark"] .newsletter-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .footer-title {
  color: #f8fafc;
}

[data-theme="dark"] .footer-link {
  color: #cbd5e1;
}

[data-theme="dark"] .footer-link:hover {
  color: #3b82f6;
}

[data-theme="dark"] .footer-description {
  color: #cbd5e1;
}

[data-theme="dark"] .social-link {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}

[data-theme="dark"] .social-link:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
}

[data-theme="dark"] .footer-bottom {
  background: #0f172a;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .footer-copyright {
  color: #cbd5e1;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .form-select {
  background-color: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-900);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus,
[data-theme="dark"] .form-select:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ==================================
   Переключатель языков
   ================================== */

.language-switcher {
  position: relative;
  display: inline-block;
}

.language-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.language-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.language-btn .flag {
  font-size: 16px;
  line-height: 1;
}

.language-btn .dropdown-arrow {
  transition: transform 0.2s ease;
}

.language-switcher.open .dropdown-arrow {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  min-width: 160px;
}

.language-switcher.open .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--gray-100);
}

.language-option:last-child {
  border-bottom: none;
}

.language-option:hover {
  background: var(--gray-50);
}

.language-option.active {
  background: var(--primary-50);
  color: var(--primary-700);
}

.language-option .flag {
  font-size: 16px;
  line-height: 1;
}

/* ==================================
   Переключатель темы
   ================================== */

.theme-switcher {
  display: inline-block;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.theme-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--gray-700);
}

.theme-btn svg {
  width: 18px;
  height: 18px;
  transition: all 0.3s ease;
  position: absolute;
}

.theme-btn .sun-icon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

.theme-btn .moon-icon {
  transform: rotate(90deg) scale(0);
  opacity: 0;
}

/* Темная тема для переключателей */
[data-theme="dark"] .language-btn,
[data-theme="dark"] .theme-btn {
  background: #1a1f2e;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f3f4f6;
}

[data-theme="dark"] .language-btn:hover,
[data-theme="dark"] .theme-btn:hover {
  background: #242938;
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

[data-theme="dark"] .language-dropdown {
  background: #1a1f2e;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .language-option {
  color: #f3f4f6;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .language-option:hover {
  background: #242938;
}

[data-theme="dark"] .language-option.active,
[data-theme="dark"] .language-option[data-current="true"] {
  background: #667eea;
  color: #ffffff;
}

/* ==================================
   Главная страница - Hero Section
   ================================== */

.hero-section {
  background: linear-gradient(
    135deg,
    var(--primary-50) 0%,
    var(--primary-100) 25%,
    var(--secondary-50) 50%,
    var(--success-50) 75%,
    var(--warning-50) 100%
  );
  border-radius: 24px;
  padding: 80px 40px;
  margin-bottom: 80px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23E5E7EB" fill-opacity="0.1"><circle cx="30" cy="30" r="2"/></g></svg>');
  opacity: 0.3;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500), var(--success-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--gray-700);
  margin-bottom: 40px;
  font-weight: 400;
}

.hero-progress {
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--gray-100);
}

/* ==================================
   Features Section
   ================================== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 60px;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }
}

.feature-card {
  background: white;
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  border: 1px solid var(--gray-100);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-500), var(--success-500), var(--warning-500));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

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

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-200);
}

.feature-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

.feature-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.feature-description {
  color: var(--gray-600);
  line-height: 1.6;
  font-size: 1rem;
}

/* ==================================
   Course Cards
   ================================== */

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 32px;
  margin-top: 60px;
}

.course-card {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--gray-100);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.course-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-200);
}

.course-card-image {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.course-card-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}

.achievement-badge {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.course-card-content {
  padding: 32px 28px;
}

.course-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
  line-height: 1.3;
}

.course-card-description {
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 24px;
}

.course-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--gray-100);
}

.course-card-price {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--primary-600);
}

.course-card-rating {
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ==================================
   Stats Section
   ================================== */

.stats-section {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 50%, var(--primary-800) 100%);
  border-radius: 24px;
  padding: 80px 40px;
  margin: 80px 0;
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23FFFFFF" fill-opacity="0.05"><rect width="2" height="2" rx="1"/></g></svg>');
  z-index: 1;
}

.stats-content {
  position: relative;
  z-index: 2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-top: 60px;
}

.stat-item {
  text-align: center;
  padding: 20px;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  font-weight: 500;
}

/* ==================================
   CTA Section
   ================================== */

.cta-section {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-50) 100%);
  border-radius: 24px;
  padding: 80px 40px;
  text-align: center;
  border: 1px solid var(--gray-100);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--primary-100) 0%, transparent 70%);
  opacity: 0.3;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.05); opacity: 0.1; }
}

.cta-content {
  position: relative;
  z-index: 2;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 20px;
  line-height: 1.2;
}

.cta-description {
  font-size: 1.25rem;
  color: var(--gray-700);
  margin-bottom: 40px;
  line-height: 1.6;
}

/* ==================================
   Animations
   ================================== */

.animate-fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* ==================================
   Responsive Design
   ================================== */

@media (max-width: 768px) {
  .hero-section {
    padding: 60px 24px;
    margin-bottom: 60px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }

  .features-grid,
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .stats-section {
    padding: 60px 24px;
  }

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

  .cta-section {
    padding: 60px 24px;
  }

  .cta-title {
    font-size: 2rem;
  }
}

/* ==================================
   Dark Theme Support - Улучшенная цветовая гамма
   ================================== */

[data-theme="dark"] .hero-section {
  background: linear-gradient(
    135deg,
    #0f172a 0%,
    #1e293b 20%,
    #334155 40%,
    #1e40af 60%,
    #1e293b 80%,
    #0f172a 100%
  );
  border: 1px solid rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .hero-section::before {
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23E5E7EB" fill-opacity="0.05"><circle cx="30" cy="30" r="2"/></g></svg>');
  opacity: 0.1;
}

[data-theme="dark"] .hero-title {
  color: #f8fafc;
  text-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .text-gradient {
  background: linear-gradient(135deg, #60a5fa, #3b82f6, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .hero-subtitle {
  color: #cbd5e1;
}

[data-theme="dark"] .hero-progress {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .hero-progress .text-gray-600 {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .feature-card {
  background: linear-gradient(145deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .feature-card::before {
  background: linear-gradient(90deg, #3b82f6, #22d3ee, #10b981);
}

[data-theme="dark"] .feature-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2);
  transform: translateY(-8px);
}

[data-theme="dark"] .feature-title {
  color: #f8fafc;
}

[data-theme="dark"] .feature-description {
  color: #cbd5e1;
}

[data-theme="dark"] .feature-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(34, 211, 238, 0.2)) !important;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .course-card {
  background: linear-gradient(145deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .course-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 25px 50px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .course-card-title {
  color: #f8fafc;
}

[data-theme="dark"] .course-card-description {
  color: #cbd5e1;
}

[data-theme="dark"] .course-card-meta {
  border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .course-card-rating {
  color: #cbd5e1;
}

[data-theme="dark"] .achievement-badge {
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .stats-section {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 50%, #1e293b 100%);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cta-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e40af 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .cta-section::before {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
  opacity: 0.5;
}

[data-theme="dark"] .cta-title {
  color: #f8fafc;
  text-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .cta-description {
  color: #cbd5e1;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
  color: #f8fafc !important;
}

[data-theme="dark"] .text-gray-600 {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .text-gray-900 {
  color: #f8fafc !important;
}

[data-theme="dark"] .container {
  color: #e2e8f0;
}

/* Dark theme для форм и других элементов */
[data-theme="dark"] .card {
  background: linear-gradient(145deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #f8fafc;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .form-label {
  color: #f8fafc;
}

[data-theme="dark"] .btn-outline {
  border-color: rgba(59, 130, 246, 0.5);
  color: #3b82f6;
}

[data-theme="dark"] .btn-outline:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
}
