/* Базовые сбросы и переменные */
:root {
  --tg-bg: #1a1a1a;
  --tg-bg-light: #2a2a2a;
  --tg-card: #2a2a2a;
  --tg-card-light: rgba(51, 51, 51, 0.8);
  --tg-accent: #ff7700;
  --tg-accent2: #ff9933;
  --tg-text: #ffffff;
  --tg-text-light: #ffffff;
  --tg-muted: #cccccc;
  --tg-radius: 18px;
  --tg-shadow: 0 4px 24px rgba(255, 119, 0, 0.15);
}

@media (prefers-color-scheme: light) {
  :root {
    --tg-bg: #f6f7fb;
    --tg-bg-light: #fff;
    --tg-card: #fff;
    --tg-text: #23262f;
    --tg-text-light: #23262f;
    --tg-muted: #7a869a;
  }
}

html, body {
  height: 100%;
  background: var(--tg-bg);
  color: var(--tg-text);
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%) fixed;
  background-size: cover;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 12px 32px 12px;
}

.header {
  padding: 32px 0 16px 0;
  text-align: center;
}

.back-btn {
  position: absolute;
  left: 16px;
  top: 32px;
  background: var(--tg-card);
  color: var(--tg-accent);
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 1rem;
  text-decoration: none;
  font-weight: 500;
  box-shadow: var(--tg-shadow);
  border: none;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.back-btn:hover {
  background: var(--tg-accent);
  color: #fff;
}

.main-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--tg-text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.subtitle {
  color: var(--tg-muted);
  font-size: 1.1rem;
  margin-bottom: 0;
}

/* --- ФИЛЬТРЫ --- */
.filters-section {
  background: #23262f;
  border-radius: 22px;
  box-shadow: 0 4px 24px rgba(255, 119, 0, 0.10);
  padding: 16px 12px 12px 12px;
  margin-bottom: 22px;
  margin-top: 10px;
  border: 1.5px solid rgba(255,119,0,0.10);
}
.filters-container {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.filter-label {
  color: #bdbdbd;
  font-size: 1rem;
  font-weight: 600;
  margin-right: 10px;
}
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-btn {
  background: #23262f;
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 8px 18px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  outline: none;
  min-height: 38px;
  min-width: 90px;
  box-shadow: 0 2px 8px rgba(255,119,0,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--tg-accent);
  color: #fff;
}

/* --- КАРТОЧКИ УРОКОВ --- */
.lessons-container {
  background: var(--tg-card);
  border-radius: var(--tg-radius);
  box-shadow: var(--tg-shadow);
  padding: 18px 6px 24px 6px;
}
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
}
.lesson-card {
  background: #23262f;
  color: #fff;
  border-radius: 22px;
  box-shadow: 0 4px 24px rgba(255, 119, 0, 0.10);
  padding: 0;
  min-height: 320px;
  margin-bottom: 18px;
  border: 1.5px solid rgba(255,119,0,0.10);
}
.lesson-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 32px var(--tg-accent2, #7f53ac33);
}
/* Улучшения для touch-устройств */
.lesson-card:active {
  transform: translateY(-2px) scale(1.01);
  transition: transform 0.1s;
}
.video-preview {
  position: relative;
  height: 220px;
  background: #eee;
  overflow: hidden;
}
.video-preview img,
.video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.93) saturate(1.1) contrast(1.05);
  transition: filter 0.2s, transform 0.2s;
}
.lesson-card:hover .video-preview img,
.lesson-card:hover .video-preview video {
  filter: brightness(1) saturate(1.2) contrast(1.1);
  transform: scale(1.04);
}
.video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,rgba(94,129,244,0.12),rgba(127,83,172,0.18));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.lesson-card:hover .video-overlay {
  opacity: 1;
  pointer-events: auto;
}
.play-button {
  width: 54px;
  height: 54px;
  background: var(--tg-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 2px 12px var(--tg-accent2, #7f53ac33);
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}
.play-button:hover {
  background: var(--tg-accent2);
  transform: scale(1.1);
}
.duration-badge {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 2;
  backdrop-filter: blur(4px);
}
.difficulty-badge {
  position: absolute;
  top: 12px;
  left: 14px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--tg-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(94,129,244,0.12);
}
.difficulty-badge.intermediate {
  background: #ffc107;
  color: #23262f;
}
.difficulty-badge.advanced {
  background: #dc3545;
  color: #fff;
}
.lesson-info {
  flex: 1 1 auto;
  padding: 20px 18px 10px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.lesson-number {
  position: absolute;
  top: -18px;
  right: 18px;
  background: var(--tg-accent2);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(127,83,172,0.12);
}
.lesson-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
  letter-spacing: 0.01em;
}
.lesson-description {
  color: #cccccc !important;
  font-size: 1.08rem;
  margin-bottom: 16px;
  line-height: 1.6;
  font-weight: 400;
}
.lesson-meta, .instructor {
  color: #bdbdbd;
  font-size: 0.98rem;
}
.lesson-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.btn-watch {
  background: var(--tg-accent);
  color: #fff;
  font-size: 1.13rem;
  font-weight: 700;
  border-radius: 22px;
  padding: 14px 0;
  width: 100%;
  margin-top: 10px;
  box-shadow: 0 2px 8px rgba(255,119,0,0.10);
  border: none;
  transition: background 0.18s;
}
.btn-watch:hover {
  background: var(--tg-accent2);
}
/* Улучшения для touch-устройств */
.btn-watch:active {
  transform: scale(0.98);
  transition: transform 0.1s;
}
/* Bookmark styles removed */
.no-results {
  text-align: center;
  padding: 60px 10px;
  color: var(--tg-muted);
}
.no-results i {
  font-size: 3rem;
  color: #ddd;
  margin-bottom: 16px;
}
.no-results h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--tg-text-light);
}
.no-results p {
  font-size: 1rem;
}
.footer {
  text-align: center;
  padding: 18px 0 8px 0;
  color: var(--tg-muted);
  font-size: 0.95rem;
}

/* Уведомления */
.notification {
  position: fixed;
  top: 18px;
  right: 18px;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(30,34,40,0.18);
  z-index: 1000;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.98;
  transform: translateX(400px);
  transition: transform 0.3s;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}
.notification-content i {
  font-size: 1.2rem;
}

/* Адаптивность - УЛУЧШЕНА ЧИТАЕМОСТЬ ДЛЯ ANDROID */
@media (max-width: 600px) {
  .container {
    padding: 0 16px 32px 16px;
    max-width: 100vw;
  }
  .header {
    padding: 20px 0 12px 0;
  }
  .main-title {
    font-size: 1.8rem;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 800;
    line-height: 1.2;
    color: var(--tg-accent);
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  .subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--tg-text);
  }
  .filters-section {
    border-radius: 16px;
    padding: 10px 6px 8px 6px;
    margin: 80px 0 14px 0; /* ещё больше отступ сверху */
  }
  .filter-label {
    font-size: 0.92rem;
    margin-right: 6px;
  }
  .filter-btn {
    font-size: 0.95rem;
    min-width: 70px;
    padding: 7px 10px;
    min-height: 32px;
    border-radius: 16px;
  }
  .search-box {
    max-width: 100%;
  }
  .search-box input {
    font-size: 1.2rem;
    padding: 18px 22px 18px 55px;
    border-radius: 30px;
    min-height: 56px;
    font-weight: 500;
    border: 3px solid rgba(255, 119, 0, 0.4);
  }
  .lessons-container {
    padding: 20px 8px 20px 8px;
    border-radius: 20px;
  }
  .lessons-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .lesson-card {
    min-height: 260px;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 25px rgba(30,34,40,0.15);
    border: 1px solid rgba(255, 119, 0, 0.2);
    margin-bottom: 14px;
  }
  .video-preview {
    height: 220px;
    border-radius: 20px 20px 0 0;
  }
  .video-preview img,
  .video-preview video {
    border-radius: 20px 20px 0 0;
  }
  .lesson-info {
    padding: 20px 16px 16px 16px;
    border-radius: 0 0 20px 20px;
  }
  .lesson-title {
    font-size: 1.08rem;
    margin-bottom: 7px;
  }
  .lesson-description {
    font-size: 0.98rem;
    margin-bottom: 10px;
  }
  .lesson-meta {
    font-size: 1rem;
    margin-bottom: 16px;
    gap: 12px;
    font-weight: 600;
  }
  .lesson-number {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    font-weight: 800;
    top: -20px;
    right: 16px;
  }
  .btn-watch {
    font-size: 1.01rem;
    padding: 12px 0;
    border-radius: 18px;
    font-weight: 700;
    min-height: 56px;
    box-shadow: 0 6px 15px rgba(255, 119, 0, 0.3);
  }
  .difficulty-badge, .duration-badge {
    font-size: 1rem;
    padding: 8px 14px;
    border-radius: 15px;
    font-weight: 700;
  }
  .no-results {
    padding: 40px 16px;
    font-size: 1.1rem;
  }
  .footer {
    padding: 20px 0 8px 0;
    font-size: 1rem;
  }
} 

/* Адаптивность для всех устройств */

/* Для очень больших экранов */
@media (min-width: 1400px) {
  .container {
    max-width: 1200px;
    padding: 0 40px 40px 40px;
  }
  
  .lessons-grid {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 30px;
  }
  
  .lesson-card {
    min-height: 520px;
  }
  
  .video-preview {
    height: 240px;
  }
}

/* Для больших экранов и ноутбуков */
@media (min-width: 1024px) and (max-width: 1399px) {
  .lessons-grid {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
  }
}

/* Для планшетов в ландшафтном режиме */
@media (min-width: 769px) and (max-width: 1023px) {
  .container {
    max-width: 100%;
    padding: 0 20px 32px 20px;
  }
  
  .main-title {
    font-size: 1.8rem;
  }
  
  .filters-container {
    gap: 12px 20px;
  }
  
  .lessons-grid {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
  }
  
  .lesson-card {
    min-height: 440px;
  }
  
  .video-preview {
    height: 200px;
  }
}

/* Для планшетов в портретном режиме */
@media (min-width: 601px) and (max-width: 768px) {
  .container {
    padding: 0 20px 32px 20px;
  }
  
  .main-title {
    font-size: 1.8rem;
  }
  
  .filters-section {
    padding: 20px 16px 16px 16px;
    border-radius: 20px;
  }
  
  .filters-container {
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
  }
  
  .filter-group {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .filter-label {
    font-size: 1.1rem;
    font-weight: 600;
  }
  
  .filter-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
  }
  
  .filter-btn {
    font-size: 0.95rem;
    padding: 10px 14px;
    min-height: 44px;
    border-radius: 22px;
  }
  
  .search-box {
    max-width: 100%;
  }
  
  .search-box input {
    font-size: 1rem;
    padding: 12px 12px 12px 40px;
    min-height: 44px;
  }
  
  .lessons-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
  }
  
  .lesson-card {
    min-height: 420px;
  }
  
  .video-preview {
    height: 200px;
  }
}

/* Для мобильных устройств */
@media (max-width: 600px) {
  /* Фильтры */
  .filters-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }
  .filter-label {
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
  }
  .filter-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
  }
  .filter-btn {
    font-size: 0.9rem;
    padding: 10px 0;
    min-height: 40px;
    border-radius: 14px;
    text-align: center;
    background: rgba(255,255,255,0.08);
  }
  .filter-btn.active {
    background: var(--tg-accent);
  }
  .search-box {
    width: 100%;
    position: relative;
    box-sizing: border-box;
  }
  .search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #bdbdbd;
    font-size: 1.1rem;
  }
  .search-box input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 16px 10px 42px;
    font-size: 0.95rem;
    min-height: 40px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: none;
    color: #fff;
  }
  .search-box input::placeholder {
    color: #bdbdbd;
  }
}

/* Для очень маленьких мобильных устройств */
@media (max-width: 400px) {
  .container {
    padding: 0 12px 20px 12px;
  }
  
  .back-btn {
    left: 12px;
    padding: 6px 14px;
    font-size: 0.9rem;
  }
  
  .main-title {
    font-size: 1.4rem;
  }
  
  .filters-section {
    padding: 16px 12px 12px 12px;
  }
  
  .filter-buttons {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .filter-btn {
    font-size: 0.95rem;
    padding: 10px 12px;
    min-height: 44px;
  }
  
  .lessons-container {
    padding: 16px 4px 16px 4px;
  }
  
  .lesson-card {
    min-height: 300px;
  }
  
  .video-preview {
    height: 180px;
  }
  
  .lesson-info {
    padding: 14px 12px 12px 12px;
  }
  
  .lesson-title {
    font-size: 1.1rem;
  }
  
  .lesson-description {
    font-size: 0.95rem;
    min-height: 36px;
  }
  
  .btn-watch {
    font-size: 1rem;
    padding: 12px 0;
    min-height: 44px;
  }
}

/* Для экранов с низкой высотой (ландшафтный режим на мобильных) */
@media (max-height: 500px) and (orientation: landscape) {
  .header {
    padding: 8px 0 4px 0;
  }
  
  .filters-section {
    margin-bottom: 8px;
  }
  
  .lesson-card {
    min-height: auto;
  }
  
  .video-preview {
    height: 120px;
  }
} 

/* Специальная сетка для фильтров на мобильных */
@media (max-width: 600px) {
  /* Улучшенные иконки в фильтрах */
  .filter-btn i {
    margin-right: 6px;
    font-size: 1.1em;
  }
  
  /* Специальная сетка для фильтров сложности */
  .filter-group:first-child .filter-buttons {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
  }
  
  .filter-group:first-child .filter-btn:first-child {
    grid-column: 1 / -1;
  }
  
  /* Специальная сетка для фильтров длительности */
  .filter-group:nth-child(2) .filter-buttons {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
  }
  
  .filter-group:nth-child(2) .filter-btn:first-child {
    grid-column: 1 / -1;
  }
} 