/* === Общие стили === */
body {
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
  background-color: #faf8ff;
}

/* === Градиентный текст === */
.text-gradient {
  background: linear-gradient(90deg, #7f00ff, #5a00b5, #4b0082);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* === Градиентная кнопка === */
.btn-gradient {
  background: linear-gradient(90deg, #7f00ff, #5a00b5, #4b0082);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 12px 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.btn-gradient:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(127, 0, 255, 0.3);
}

/* === Navbar (тёмная версия) === */
.navbar {
  background: linear-gradient(90deg, #1a1a1d, #2c2c34, #3a3a46);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.navbar-brand {
  color: #fff !important;
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: #ddd !important;
  transition: color 0.3s, transform 0.2s;
}

.navbar-nav .nav-link:hover {
  color: #9d7dff !important;
  transform: translateY(-1px);
}

.navbar-toggler {
  border: none;
}

.navbar-toggler-icon {
  filter: invert(1); /* делает иконку "гамбургер" белой */
}

/* Кнопка "Войти" в шапке */
.navbar .btn-gradient {
  background: linear-gradient(90deg, #8a2be2, #6b00b6);
  color: #fff;
  border-radius: 25px;
  font-weight: 600;
  padding: 8px 18px;
  font-size: 0.9rem;
}

.navbar .btn-gradient:hover {
  box-shadow: 0 0 12px rgba(140, 82, 255, 0.4);
  transform: translateY(-2px);
}

/* === Hero Section === */
.hero {
  background: linear-gradient(to right, #7f00ff, #5a00b5, #4b0082);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
}

.fade-in-delay {
  opacity: 0;
  animation: fadeIn 1.5s ease-in forwards;
}

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

/* === Hover эффект для карточек === */
.hover-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(127, 0, 255, 0.25);
}

/* --- Контейнер карточки --- */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-text {
  min-height: 72px; /* выравнивает описание по высоте */
  color: #555;
}

/* === Фикс для пляшущих карточек === */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-text {
  flex-grow: 1; /* описание растягивается, заполняя пространство */
  color: #555;
}

.card-body .btn-gradient {
  margin-top: auto; /* кнопка всегда прижата к низу карточки */
}

/* === Раздел "Курсы" === */
section.container {
  border-radius: 16px;
  padding: 40px;
  background-color: #faf8ff;
}

.course-level {
  background-color: #fff;
  border-radius: 12px;
  padding: 30px 0;
  border-top: 2px solid rgba(127, 0, 255, 0.2);
  border-bottom: 2px solid rgba(127, 0, 255, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-level:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(127, 0, 255, 0.15);
}

.course-level h3 {
  color: #4b0082;
}

.course-level p {
  font-size: 1rem;
  color: #555;
}

/* === CTA Section === */
.cta {
  background: linear-gradient(to right, #4b0082, #5a00b5, #7f00ff);
  color: #fff;
}

/* === Страница регистрации === */
.auth-section {
  min-height: 100vh;
  background: linear-gradient(135deg, #7f00ff, #5a00b5, #4b0082);
  padding: 40px 15px;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 35px;
  max-width: 460px;
  width: 100%;
  animation: fadeIn 0.6s ease;
}

.auth-form .form-group {
  margin-bottom: 18px;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: #7f00ff;
  box-shadow: 0 0 8px rgba(127, 0, 255, 0.25);
  background: #fff;
  outline: none;
}

/* === Контакты === */
.contact-card {
  border-radius: 16px;
  background-color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(127, 0, 255, 0.15);
}

.contact-info li i {
  font-size: 1.2rem;
  vertical-align: middle;
}

.contact-info a:hover {
  color: #7f00ff;
  text-decoration: underline;
}

/* === Страница курса === */
.course-section {
  background-color: #faf8ff;
  padding: 40px 0;
}

/* Центрируем и сужаем контент */
.course-section .container {
  max-width: 720px; /* было 900 — теперь компактнее */
}

/* Карточка модуля */
.module-card {
  border-radius: 14px;
  background: #fff;
  padding: 25px 20px;
  box-shadow: 0 4px 12px rgba(127, 0, 255, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(127, 0, 255, 0.12);
}

/* Заголовок модуля */
.module-card h4 {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1.4rem;
}

/* Описание модуля */
.module-card p.text-muted {
  color: #666;
  margin-bottom: 15px;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Уроки */
.list-group {
  border-radius: 10px;
  overflow: hidden;
}

.list-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 8px 14px;
  transition: background 0.2s ease;
  font-size: 0.95rem;
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item:hover {
  background-color: rgba(127, 0, 255, 0.03);
}

.list-group-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Кнопки внутри карточек */
.list-group-item .btn {
  flex-shrink: 0;
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 20px;
}

/* Для узких экранов */
@media (max-width: 768px) {
  .course-section .container {
    padding: 0 15px;
    max-width: 100%;
  }

  .module-card {
    padding: 20px 15px;
  }

  .list-group-item span {
    white-space: normal;
  }
}

/* === Футер всегда внизу === */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

/* Контент страницы занимает всё оставшееся пространство */
main, .course-section {
  flex: 1 0 auto;
}

/* Футер прижат к низу */
footer {
  flex-shrink: 0;
  background: #1a1a1d;
  color: #ccc;
  text-align: center;
  padding: 20px 0;
  margin-top: auto;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer a {
  color: #9d7dff;
  text-decoration: none;
  margin: 0 8px;
}

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

.hero .container {
  margin-top: -100px; /* поднимает контент вверх без изменения высоты */
}

/* === Единый стиль для обложек курсов === */
.course-img {
  width: 100%;                  /* занимает всю ширину карточки */
  height: 220px;                /* фиксированная высота */
  object-fit: cover;            /* обрезает картинку, сохраняя пропорции */
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  background-color: #f2f2f7;    /* если картинка не загрузилась */
}



.console-section {
  background: #faf8ff;
  color: #333;
  min-height: 100vh;
  padding-top: 100px;
}

.console-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 6px 20px rgba(127, 0, 255, 0.12);
}

.editor-block, .output-block {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
}

.code-input {
  width: 100%;
  height: 350px;
  background: #f8f6ff;
  color: #4b0082;
  border: 2px solid rgba(127, 0, 255, 0.2);
  border-radius: 10px;
  font-family: 'Fira Code', monospace;
  padding: 15px;
  font-size: 1rem;
  resize: none;
  transition: all 0.3s ease;
}

.code-input:focus {
  outline: none;
  border-color: #7f00ff;
  box-shadow: 0 0 10px rgba(127, 0, 255, 0.25);
}

.code-output {
  width: 100%;
  height: 350px;
  background: #f8f6ff; /* тот же мягкий фон, что и у поля ввода */
  color: #333;
  border: 2px solid rgba(127, 0, 255, 0.2); /* такая же рамка */
  border-radius: 10px;
  padding: 15px;
  font-family: 'Fira Code', monospace;
  font-size: 1rem;
  overflow-y: auto;
  white-space: pre-wrap;
  box-shadow: inset 0 0 6px rgba(127, 0, 255, 0.08);
  transition: all 0.3s ease;
}

.code-output:focus-within {
  border-color: #7f00ff;
  box-shadow: 0 0 10px rgba(127, 0, 255, 0.25);
}