/* Базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8fafc;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-outline {
  background: transparent;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-outline:hover {
  background: #667eea;
  color: white;
}

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

.btn-full {
  width: 100%;
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
}

.btn-disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Главная страница */
.landing-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.header {
  padding: 20px 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  font-size: 28px;
  font-weight: 700;
}

.logo span {
  font-size: 14px;
  opacity: 0.8;
}

.nav {
  display: flex;
  gap: 15px;
}

.hero {
  padding: 80px 0;
  text-align: center;
}

.hero h2 {
  font-size: 48px;
  margin-bottom: 20px;
  font-weight: 700;
}

.hero p {
  font-size: 20px;
  margin-bottom: 60px;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

.feature {
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.feature h3 {
  font-size: 24px;
  margin-bottom: 15px;
}

.cta {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Карта миров */
.worlds-map {
  margin-top: 40px;
}

.worlds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 25px;
}

.world-card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-left: 5px solid #667eea;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 0.6s ease-out;
}

.world-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.world-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.world-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.world-progress {
  background: #f3f4f6;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
}

.world-card p {
  color: #6b7280;
  margin-bottom: 20px;
  line-height: 1.5;
}

.world-stats {
  display: flex;
  justify-content: flex-end;
}

/* Страницы авторизации */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.auth-container {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h1 {
  color: #667eea;
  font-size: 32px;
  margin-bottom: 10px;
}

.auth-header h2 {
  color: #64748b;
  font-size: 20px;
  font-weight: 500;
}

.auth-form {
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.auth-footer {
  text-align: center;
  color: #64748b;
}

.auth-footer a {
  color: #667eea;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Алерты */
.alert {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-error {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* Дашборды */
.dashboard {
  min-height: 100vh;
  background: #f8fafc;
}

.dashboard-header {
  background: white;
  padding: 20px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.dashboard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.dashboard-content {
  padding: 0 20px 40px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #667eea;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 5px;
}

.stat-label {
  color: #64748b;
  font-size: 14px;
}

/* Адаптивность */
@media (max-width: 768px) {
  .hero h2 {
    font-size: 32px;
  }

  .hero p {
    font-size: 18px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .cta {
    flex-direction: column;
    align-items: center;
  }

  .btn-large {
    width: 100%;
    max-width: 300px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .worlds-grid {
    grid-template-columns: 1fr;
  }

  .world-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .auth-container {
    padding: 30px 20px;
  }

  .container {
    padding: 0 15px;
  }
}

/* Уровни */
.levels-grid {
  display: grid;
  gap: 20px;
}

.level-card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 25px;
  transition: all 0.3s ease;
}

.level-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.level-available {
  border-left: 5px solid #10b981;
}

.level-completed {
  border-left: 5px solid #3b82f6;
  background: #f8fafc;
}

.level-locked {
  border-left: 5px solid #d1d5db;
  opacity: 0.6;
}

.level-number {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
}

.level-locked .level-number {
  background: #d1d5db;
}

.level-completed .level-number {
  background: #10b981;
}

.level-content {
  flex: 1;
}

.level-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.level-content p {
  color: #6b7280;
  margin-bottom: 15px;
}

.level-rewards {
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
}

.reward {
  background: #f3f4f6;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.level-score {
  color: #10b981;
  font-weight: 600;
  font-size: 14px;
}

.level-action {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .level-card {
    flex-direction: column;
    text-align: center;
  }

  .level-action {
    width: 100%;
  }

  .level-rewards {
    justify-content: center;
  }
}

/* Добавлены стили для языковых групп */
.language-group-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 10px;
}

.language-group-badge.russian-learning-kazakh {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.language-group-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.language-group-option {
  padding: 12px 24px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-width: 200px;
}

.language-group-option:hover {
  border-color: #667eea;
  background: #f8fafc;
}

.language-group-option.active {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

.language-group-option h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 5px;
}

.language-group-option p {
  font-size: 14px;
  opacity: 0.8;
  margin: 0;
}

/* Цветовая схема для разных языковых групп */
.world-card.kazakh-learning-russian {
  border-left-color: #3b82f6;
}

.world-card.russian-learning-kazakh {
  border-left-color: #10b981;
}

.world-card.kazakh-learning-russian .world-progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.world-card.russian-learning-kazakh .world-progress {
  background: #d1fae5;
  color: #047857;
}

/* Адаптация для казахского интерфейса */
.dashboard[lang="kk"] .dashboard-title {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.dashboard[lang="kk"] .stat-label {
  font-size: 13px;
}

/* Индикаторы прогресса для языковых групп */
.progress-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
}

.progress-fill.russian-learning-kazakh {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.progress-text {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  min-width: 50px;
}

/* Специальные стили для админ-панели */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.admin-stat-card {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-top: 4px solid #667eea;
}

.admin-stat-card.kazakh-group {
  border-top-color: #3b82f6;
}

.admin-stat-card.russian-group {
  border-top-color: #10b981;
}

.admin-stat-value {
  font-size: 36px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 10px;
}

.admin-stat-label {
  color: #64748b;
  font-size: 16px;
  margin-bottom: 15px;
}

.admin-stat-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #e5e7eb;
}

.admin-stat-change {
  font-size: 14px;
  font-weight: 600;
}

.admin-stat-change.positive {
  color: #10b981;
}

.admin-stat-change.negative {
  color: #ef4444;
}

/* Таблицы для админ-панели */
.admin-table {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: #f8fafc;
  padding: 15px 20px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

.admin-table td {
  padding: 15px 20px;
  border-bottom: 1px solid #f3f4f6;
}

.admin-table tr:hover {
  background: #f8fafc;
}

.language-group-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.language-group-tag.kazakh-learning-russian {
  background: #dbeafe;
  color: #1d4ed8;
}

.language-group-tag.russian-learning-kazakh {
  background: #d1fae5;
  color: #047857;
}

/* Мобильная адаптация для языковых групп */
@media (max-width: 768px) {
  .language-group-selector {
    flex-direction: column;
    align-items: center;
  }

  .language-group-option {
    width: 100%;
    max-width: 300px;
  }

  .language-group-badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  .admin-stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-table {
    overflow-x: auto;
  }

  .admin-table table {
    min-width: 600px;
  }
}

/* Анимации для переключения языковых групп */
.language-transition {
  transition: all 0.3s ease;
}

/* Специальные стили для уведомлений */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #10b981;
  z-index: 1000;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification.error {
  border-left-color: #ef4444;
}

.notification.warning {
  border-left-color: #f59e0b;
}

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