/* ========================================
   ПЛАТФОРМА ОБУЧЕНИЯ СОТРУДНИКОВ
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* --- Стилизация глобального скроллбара --- */

/* Скрываем скроллбары глобально (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  display: none;
}

/* Скрываем скроллбары глобально (Firefox) — также убирает зарезервированный отступ */
* {
  scrollbar-width: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Основная палитра */
  --eucalyptus: #c0bc90;
  --ash: #1a1905;

  /* Нейтральные */
  --neutral-1: #f9f9f5;
  --neutral-2: #f4f3ea;
  --neutral-3: #e2e0d3;

  /* Семантические цвета */
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --info: #2196f3;

  /* Поверхности */
  --bg: linear-gradient(135deg, #f9f9f5 0%, #f4f3ea 100%);
  --surface: rgba(255, 255, 255, 0.85);
  --surface-glass: rgba(255, 255, 255, 0.6);

  /* Текст */
  --text: #1a1905;
  --text-secondary: #5a5a48;
  --text-light: #8a8a78;
  --text-on-dark: #ffffff;

  /* Границы и тени */
  --border: rgba(192, 188, 144, 0.2);
  --shadow-sm: 0 2px 8px rgba(26, 25, 5, 0.04);
  --shadow-md: 0 4px 16px rgba(26, 25, 5, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 25, 5, 0.12);
  --shadow-glass: 0 8px 32px rgba(26, 25, 5, 0.06);

  /* Радиусы */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-full: 999px;

  /* Spacing scale (увеличенные отступы для воздушности) */
  --space-xs: 0.5rem; /* 8px */
  --space-sm: 0.75rem; /* 12px */
  --space-md: 1rem; /* 16px */
  --space-lg: 1.5rem; /* 24px */
  --space-xl: 2rem; /* 32px */
  --space-2xl: 3rem; /* 48px */
  --space-3xl: 4rem; /* 64px */
}

.text-gray {
  color: #94a3b8;
}
.text-blue {
  color: #3b82f6;
}
.text-green {
  color: #10b981;
}

.tab-content {
  display: none; /* Скрыто по умолчанию */
}
.tab-content.active {
  display: block; /* Показываем активную */
  animation: fadeIn 0.3s ease;
}

/* Квадратные чекбоксы со скруглением */
input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px; /* Мягкое скругление */
  background: var(--surface);
  /* Центрируем галочку внутри */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Предотвращает сжатие в flex-контейнерах */
  padding: 0; /* Сбрасываем padding, который наследуется от глобального input */
}

/* При выборе - ваш цвет */
input[type="checkbox"]:checked {
  background: var(--ash); /* Ваш тёмный цвет */
  border-color: var(--ash);
}

/* Галочка внутри */
input[type="checkbox"]:checked::after {
  content: "✓";
  color: white;
  font-size: 14px;
  font-weight: 600;
}

/* Стилизация радиокнопок */
input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%; /* Круглая форма */
  background: var(--surface);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

input[type="radio"]:checked {
  border-color: var(--ash);
}

/* Внутренний кружок */
input[type="radio"]:checked::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ash);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}


/* ========================================
   ТИПОГРАФИКА
   ======================================== */

body {
  font-family:
    "IBM Plex Sans",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-weight: 400;
  font-size: 16px;
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Иерархия заголовков */
h1 {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--space-md);
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--space-sm);
}

p {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

small {
  font-size: 0.875rem;
  line-height: 1.5;
}

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

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

/* ========================================
   АНИМАЦИИ
   ======================================== */

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* ========================================
   LAYOUT
   ======================================== */

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-xl);
}

/* ========================================
   СТРАНИЦА ВХОДА
   ======================================== */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3xl);
  width: 480px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.logo img {
  margin-bottom: var(--space-md);
}

.logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ash);
  margin-bottom: var(--space-xs);
}

/* ========================================
   ФОРМЫ
   ======================================== */

.form-group {
  margin-bottom: var(--space-lg);
}

label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 500;
  color: var(--text);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}

input,
select,
textarea {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--surface);
  color: var(--text);
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='14' height='14'%3E%3Cpath fill='none' stroke='%238a8a78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--eucalyptus);
  background: var(--surface-glass);
  box-shadow: 0 0 0 4px rgba(192, 188, 144, 0.1);
  transform: translateY(-1px);
}

select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='14' height='14'%3E%3Cpath fill='none' stroke='%238a8a78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
}

input::placeholder {
  color: var(--text-light);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
  font-size: 0.9rem;
}

/* ========================================
   КНОПКИ
   ======================================== */

.btn {
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--ash);
  color: var(--text-on-dark);
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: #2a2816;
}

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

.btn-secondary {
  background: var(--neutral-2);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--eucalyptus);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-small {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.875rem;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.btn-small:hover {
  background: var(--neutral-2);
  border-color: var(--eucalyptus);
}

.btn-small.btn-danger {
  color: var(--danger);
  border-color: rgba(244, 67, 54, 0.3);
}

.btn-small.btn-danger:hover {
  background: rgba(244, 67, 54, 0.1);
}

/* ========================================
   ДАШБОРД
   ======================================== */

.dashboard {
  display: none;
}

.dashboard.active {
  display: block;
}

.header {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-2xl);
  margin-bottom: var(--space-2xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* ========================================
   БЕЙДЖИ
   ======================================== */

.badge {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Базовый стиль бейджа */
.group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Размеры бейджей */
.badge-sm {
  padding: 3px 6px 1px;
  font-size: 0.65rem;
  border-radius: 4px;
}
.badge-group-default {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}
.badge-group-manager {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
}
.badge-group-hr {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #e1bee7;
}
.badge-group-finance {
  background: #e8f5e9;
  color: #388e3c;
  border: 1px solid #c8e6c9;
}

/* Универсальная круглая кнопка для иконок */
.btn-round-icon {
  background: transparent;
  border: 1px solid transparent;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  padding: 0; /* Чтобы иконка была ровно по центру */
}

.btn-round-icon:hover {
  background-color: var(--neutral-1);
  color: var(--ash);
  border-color: var(--neutral-2);
}

/* Специфические анимации для разных иконок внутри этой кнопки */
.btn-round-icon:hover .settings-icon {
  transform: rotate(45deg);
}

.btn-round-icon:hover .arrow-left-icon {
  transform: translateX(-3px);
}

/* Общая настройка для всех SVG внутри таких кнопок */
.btn-round-icon svg {
  transition:
    transform 0.2s ease,
    stroke-width 0.2s ease;
}

/* ========================================
   КАРТОЧКИ (GLASS MORPHISM)
   ======================================== */

.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  box-shadow: var(--shadow-glass);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--eucalyptus);
}

.card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  color: var(--text);
}

/* ========================================
   СЕТКА
   ======================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

/* Фиксируем раскладку таблицы */
#employeesTable {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

/* Задаем ширину колонок через заголовки */
#employeesTable th:nth-child(1) {
  width: 18%;
} /* Имя */
#employeesTable th:nth-child(2) {
  width: 260px;
} /* Группа  */
#employeesTable th:nth-child(3) {
  width: 200px;
} /* Статус */
#employeesTable th:nth-child(4) {
  width: auto;
} /* Выбранные навыки (максимум места) */

/* Бейджи этапов */
.stage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 6px 1px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Цвета для разных этапов */
.stage-testing {
  background-color: #fff3e0; /* Светло-оранжевый */
  color: #e65100;
  border: 1px solid #ffe0b2;
}

.stage-selection {
  background-color: #e3f2fd; /* Светло-синий */
  color: #1565c0;
  border: 1px solid #bbdefb;
}

.stage-learning {
  background-color: #e8f5e9; /* Светло-зеленый */
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.stage-default {
  background-color: #f5f5f5;
  color: #616161;
}

/* Стили для ячеек */
#employeesTable td {
  padding: 12px 8px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis; /* Если текст не влезает */
}


/* Мини-спиннер для кнопки */
.spinner-mini {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 5px;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-md);
}

.skill-card:hover::before {
  opacity: 1;
}

.skill-card.selected {
  background: linear-gradient(135deg, var(--eucalyptus), var(--ash));
  color: white;
  border-color: var(--ash);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px) scale(1.03);
}

.skill-card.selected h4 {
  color: white;
}

.skill-card h4 {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.skill-card small {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* Мини-карточки навыков (для админки) */
.skill-card-mini {
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.skill-card-mini:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--eucalyptus);
  background: var(--surface);
}

.skill-icon {
  font-size: 1.75rem;
  background: var(--neutral-2);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.learning-path {
  position: relative;
  padding-left: var(--space-xl);
}

/* ========================================
   ТАБЛИЦЫ
   ======================================== */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--neutral-2);
  font-weight: 600;
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0.02em;
}

th:first-child {
  border-top-left-radius: var(--radius-md);
}

th:last-child {
  border-top-right-radius: var(--radius-md);
}

tr {
  transition: background 0.2s ease;
}

tr:hover {
  background: var(--neutral-1);
}

tr:last-child td {
  border-bottom: none;
}


/* ========================================
   ВКЛАДКИ
   ======================================== */

.tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.tab {
  padding: var(--space-md) var(--space-xl);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-light);
  transition: all 0.3s ease;
  position: relative;
}

.tab:hover {
  color: var(--text);
  background: var(--neutral-1);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab.active {
  color: var(--ash);
  border-bottom-color: var(--ash);
  font-weight: 600;
}

/* ========================================
   СЕКЦИИ
   ======================================== */

.section {
  display: none;
}

.section.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

/* ========================================
   СЧЁТЧИКИ
   ======================================== */

/* ========================================
   НАСТРОЙКИ (АДМИНКА)
   ======================================== */

.settings-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.settings-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.settings-menu li {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.settings-menu li:hover {
  background: var(--neutral-2);
}

.settings-menu li.active {
  background: var(--ash);
  color: white;
}

/* ========================================
   МОДАЛЬНЫЕ ОКНА
   ======================================== */

.skill-card-admin {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.skill-card-admin:hover {
  border-color: var(--eucalyptus);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* Карточка теста — унифицирована с .skill-card-admin */
.test-card {
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-sm) !important;
  transition: all 0.2s ease !important;
}

.test-card:hover {
  border-color: var(--eucalyptus) !important;
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-3px) !important;
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  width: 100%;
}

.skill-icon-fixed {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--neutral-1);
  border-radius: 8px;
}

.skill-name-text {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dark);
}

.skill-tags-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.skill-divider {
  border: 0;
  border-top: 1px solid #eee;
  margin: 12px 0;
}

.skill-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-action {
  border: none;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: opacity 0.2s;
}

.btn-action.edit {
  background: #eeeded;
  color: #666666;
}
.btn-action.delete {
  background: #ffebee;
  color: #d32f2f;
}
.btn-action:hover {
  opacity: 0.8;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 25, 5, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 900px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-card-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
  flex-grow: 1; /* Растягивает описание, прижимая низ */
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}

.group-main-cb,
.group-req-cb {
  margin: 0 !important;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

/* Переключатель Обязательно/Нет (появляется только если выбрана группа) */
.requirement-toggle {
  display: flex;
  align-items: center;
  margin-left: var(--space-lg);
  gap: var(--space-sm);
  color: var(--text-light);
  opacity: 0.5;
  cursor: pointer;
  pointer-events: none; /* Отключен пока не выбран чекбокс */
  transition: all 0.3s;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

.requirement-toggle.active {
  opacity: 1;
  pointer-events: all;
}

.requirement-toggle:hover {
  opacity: 0.5;
}

/* Строка группы */
.group-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  transition: all 0.2s ease;
}

.group-row:hover {
  border-color: var(--eucalyptus);
}

.group-row.selected .requirement-toggle {
  opacity: 1;
}

.group-row:last-child {
  border-bottom: none !important;
}

/* Чекбокс с названием группы */
.group-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  flex: 1;
}

.group-checkbox-wrapper input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  flex-shrink: 0;
  accent-color: var(--ash);
  margin: 0; /* Убираем внешние отступы, используем gap в родителе */
  padding: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.group-checkbox-wrapper,
.requirement-toggle {
  display: flex;
  align-items: center; /* Центрирует чекбокс и текст по вертикали */
}

.group-checkbox-wrapper input[type="checkbox"]:checked {
  background-color: var(--ash) !important; /* Цвет заливки */
  border-color: var(--ash) !important;
}

.group-checkbox-wrapper input[type="checkbox"]:hover {
  border-color: var(--eucalyptus);
}

.group-name {
  font-weight: 500;
  color: var(--text);
  font-size: 0.9375rem;
}

.requirement-toggle input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex-shrink: 0;
  accent-color: var(--ash);
  margin: 0; /* Убираем внешние отступы, используем gap в родителе */
  padding: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.requirement-toggle input[type="checkbox"]:checked {
  border-color: var(--ash) !important;
}

.requirement-toggle input[type="checkbox"]:hover {
  border-color: var(--eucalyptus);
}

.requirement-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.topic-item {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.topic-header {
  background: #f8f9fa;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move; /* Курсор перетаскивания */
  border-bottom: 1px solid #eee;
}

.topic-title-edit {
  font-weight: 600;
  border: none;
  background: transparent;
  font-size: 1rem;
  width: 70%;
}

.lessons-list {
  padding: 10px;
  min-height: 50px; /* Чтобы можно было бросить урок в пустую тему */
}

.lesson-item {
  background: white;
  border: 1px solid #eee;
  padding: 8px 12px;
  margin-bottom: 5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: grab;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.lesson-item:hover {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.lesson-icon {
  font-size: 1.2rem;
  color: var(--ash);
}

/* При перетаскивании */
.sortable-ghost {
  opacity: 0.4;
  background: #e3f2fd;
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

@media (max-width: 768px) {
  :root {
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 2.5rem;
  }

  .container {
    padding: var(--space-lg);
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

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

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

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

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .login-card {
    padding: var(--space-xl);
  }
}

/* ==================== УВЕДОМЛЕНИЯ (TOASTS) ==================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20000;
}

.toast {
  min-width: 300px;
  padding: 15px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-left: 5px solid #ccc;
  display: flex;
  align-items: center;
  gap: 15px;
  animation: slideInRight 0.3s ease forwards;
  transform: translateX(100%);
  opacity: 0;
}

.toast.success {
  border-left-color: var(--eucalyptus);
}
.toast.error {
  border-left-color: #ff6b6b;
}
.toast.info {
  border-left-color: #a3e635;
}

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

@keyframes fadeOutRight {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ==================== ВЫБОР ТИПА УРОКА (В МОДАЛКЕ) ==================== */
.type-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.05);
  padding: 5px;
  border-radius: var(--radius-md);
  gap: 5px;
}

.type-option {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  opacity: 0.7;
}

/* Скрытый радио-инпут */
.type-option input {
  display: none;
}

/* Активное состояние */
.type-option:has(input:checked) {
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  opacity: 1;
  font-weight: 600;
  color: var(--ash);
}

/* --- Стили для плана обучения (Прогресс и блокировка) --- */

.lesson-link.locked {
  opacity: 0.6;
  pointer-events: none; /* Запрещаем клик */
  background: #f9f9f9 !important;
  border-color: #eee !important;
  filter: grayscale(1);
}

.lesson-link.locked .lesson-icon {
  opacity: 0.5;
}

.skill-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-light);
  transition: transform 0.3s ease;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-toggle-btn.collapsed {
  transform: rotate(-90deg);
}

.skill-progress-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
  width: 100%;
}

.skill-progress-bar {
  height: 100%;
  background: var(--success);
  width: 0%;
  transition: width 0.5s ease;
}

/* ========================================
   MODAL UTILITIES & TYPOGRAPHY
   ======================================== */

/* Typography scale */
.text-xs   { font-size: 0.7rem; }
.text-sm   { font-size: 0.85rem; }
.text-lg   { font-size: 1.15rem; }
.text-bold { font-weight: 600; }
.text-upper { text-transform: uppercase; letter-spacing: 0.07em; }
.text-muted { color: var(--text-light); }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Modal profile layout */
.modal-profile-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--neutral-1);
}
.modal-profile-body {
  padding: 24px;
  overflow-y: auto;
}
.modal-info-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--neutral-1);
  flex-wrap: wrap;
}
.modal-info-item {
  flex: 1;
  padding: 14px 20px;
}
.modal-info-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-light);
  margin-bottom: 4px;
}
.modal-info-value {
  font-size: 0.85rem;
  font-weight: 500;
}
.modal-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ash);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Status badges */
.badge-pass {
  background: #d1fae5;
  color: #059669;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}
.badge-fail {
  background: #fee2e2;
  color: #dc2626;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

/* Small progress bar */
.progress-sm {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 7px;
}
.progress-sm .fill {
  height: 100%;
  border-radius: 2px;
  background: var(--info, #3b82f6);
}

/* ========================================
   ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА
   ======================================== */
.lang-switcher {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--neutral-1);
  padding: 2px;
}
.lang-switcher input[type="radio"] {
  display: none;
}
.lang-switcher label {
  padding: 6px 16px;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 6px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lang-switcher input[type="radio"]:checked + label {
  background: var(--ash);
  color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* --- Флаги-закладки (общие позиционирования) --- */
.login-lang-flags,
.header-lang-flags {
  position: absolute;
  right: -1px;
  top: 24px;
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.lang-flag {
  width: 46px;
  height: 40px;
  border: 1px solid var(--border);
  border-left: none;
  background: var(--neutral-1);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  font-family: inherit;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  opacity: 0.55;
  padding: 0;
}
.lang-flag:first-child {
  border-radius: 0 var(--radius-md) 0 0;
}
.lang-flag:last-child {
  border-radius: 0 0 var(--radius-md) 0;
  border-top: none;
}
.lang-flag:hover {
  opacity: 0.85;
  background: var(--surface);
}
.lang-flag.active {
  opacity: 1;
  background: var(--surface);
}

@media (max-width: 600px) {
  .login-lang-flags {
    position: static;
    transform: none;
    flex-direction: row;
    justify-content: center;
    margin-top: 16px;
  }
  .lang-flag {
    border: 1px solid var(--border);
    border-left: none;
  }
  .lang-flag:first-child {
    border-left: 1px solid var(--border);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
  }
  .lang-flag:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-top: 1px solid var(--border);
  }
}
