/* ===== БАЗОВЫЕ СТИЛИ ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f4f7fc;
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: #1a2639;
}

/* ===== ШАПКА ===== */
.header {
  background: linear-gradient(135deg, #0b1e3d 0%, #1a3668 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  box-shadow: 0 8px 20px rgba(0, 20, 50, 0.25);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
  min-height: 75px;
}

.logo {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.3rem 1.8rem;
  border-radius: 50px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 15px rgba(0, 180, 255, 0.3);
  white-space: nowrap;
}

.logo span {
  background: linear-gradient(to right, #a0e9ff, #6ab0f5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== НАВИГАЦИЯ ===== */
.nav {
  display: flex;
  gap: 1.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.class-dropdown {
  position: relative;
}

.class-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 0.7rem 1.8rem;
  border-radius: 40px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.5px;
}

.class-btn::after {
  content: '▼';
  font-size: 0.7rem;
  margin-left: 0.3rem;
  transition: transform 0.3s;
  opacity: 0.8;
}

.class-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 18px rgba(80, 170, 255, 0.5);
  transform: translateY(-1px);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.2);
  min-width: 280px;
  padding: 0.8rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1);
  z-index: 30;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.class-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.8rem 1.8rem;
  color: #0b1e3d;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: 0.2s;
  border-left: 4px solid transparent;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background: #eef3ff;
  color: #0f3b7a;
  border-left: 4px solid #1a56db;
  padding-left: 2rem;
  font-weight: 600;
}

/* ===== ОСНОВНОЙ КОНТЕЙНЕР ===== */
.container {
  display: flex;
  flex: 1;
  padding: 2rem;
  max-width: 1500px;
  margin: 0 auto;
  width: 100%;
  gap: 1.8rem;
}

/* ===== ЛЕВАЯ ПАНЕЛЬ ===== */
.sidebar-nav {
  flex: 0 0 300px;
  background: white;
  border-radius: 32px;
  box-shadow: 0 15px 30px rgba(0, 20, 40, 0.08);
  padding: 1.8rem 0.8rem 1.8rem 1.2rem;
  display: flex;
  flex-direction: column;
  height: fit-content;
  max-height: calc(100vh - 130px);
  position: sticky;
  top: 100px;
  overflow-y: auto;
}

.sidebar-nav h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0b1e3d;
  margin-bottom: 1.2rem;
  padding-left: 0.8rem;
  border-left: 5px solid #1a56db;
}

.subtopic-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.subtopic-item {
  padding: 0.8rem 1rem;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 500;
  color: #2c3e50;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-size: 0.95rem;
  background: #f9fbff;
  margin-bottom: 0.2rem;
}

.subtopic-item:hover {
  background: #e9f0ff;
  border-color: #b8d1ff;
  color: #0b1e3d;
  transform: translateX(5px);
}

.subtopic-item.active {
  background: #1a56db;
  color: white;
  font-weight: 600;
  border-color: #1a56db;
  box-shadow: 0 8px 16px rgba(26, 86, 219, 0.25);
}

.empty-message {
  color: #7c8aa2;
  font-style: italic;
  padding: 1.5rem 1rem;
  text-align: center;
}

/* ===== ПРАВАЯ ОБЛАСТЬ ===== */
.content-area {
  flex: 1;
  background: white;
  border-radius: 32px;
  padding: 2.5rem 2.8rem;
  box-shadow: 0 20px 35px rgba(0, 20, 40, 0.08);
  min-height: 500px;
  overflow: hidden;
}

.content-area h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #0b1e3d;
  margin-bottom: 1.2rem;
  border-bottom: 4px solid #1a56db;
  display: inline-block;
  padding-bottom: 0.5rem;
}

.topic-description {
  font-size: 1.2rem;
  line-height: 1.7;
  color: #2d3a4f;
  margin-top: 1.8rem;
}

.placeholder-card {
  background: #f0f5ff;
  border-radius: 20px;
  padding: 1.8rem;
  margin-top: 2rem;
  border-left: 6px solid #1a56db;
}

/* ===== СПИСОК РАБОТ ===== */
.works-list {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.work-item {
  background: #f8faff;
  border: 1px solid #dce3f0;
  border-radius: 16px;
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #1a3668;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.work-item:hover {
  background: #eef3ff;
  border-color: #1a56db;
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.15);
  transform: translateX(3px);
}

.work-item.active {
  background: #1a56db;
  color: white;
  border-color: #1a56db;
  box-shadow: 0 6px 16px rgba(26, 86, 219, 0.3);
}

/* ===== КОНТЕЙНЕР ДЛЯ ТРЕНАЖЁРА ===== */
.work-detail {
  margin-top: 2rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.trainer-iframe {
  width: 100%;
  min-height: 700px;
  border: none;
  border-radius: 20px;
  background: #0f172a;
  display: block;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    padding: 1.2rem;
  }

  .sidebar-nav {
    flex: 0 0 auto;
    width: 100%;
    position: static;
    max-height: none;
    margin-bottom: 1rem;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1.2rem 1.5rem;
  }

  .content-area {
    padding: 1.5rem;
  }

  .trainer-iframe {
    min-height: 600px;
  }
}