/* ╔══════════════════════════════════════════════════╗
   ║              Topics Page CSS                     ║
   ║   نمای موضوعی جلسات                              ║
   ╚══════════════════════════════════════════════════╝ */

/* ════════════════════════════════════════
   Hero
   ════════════════════════════════════════ */

.topics-hero {
  position: relative;
  padding: 52px 0 74px;
  overflow: hidden;
  color: white;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d3a5c 50%, #4a5c8a 100%);
}

.topics-hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image:
    radial-gradient(circle at 25% 40%, #e74c3c 0%, transparent 40%),
    radial-gradient(circle at 50% 60%, #27ae60 0%, transparent 40%),
    radial-gradient(circle at 75% 30%, #e67e22 0%, transparent 40%);
}

.topics-hero-content {
  position: relative;
  text-align: center;
  animation: fadeInUp 0.7s ease backwards;
}

.topics-hero-icon {
  font-size: 3em;
  display: block;
  margin-bottom: 14px;
}

.topics-hero-title {
  font-size: clamp(1.8em, 4.5vw, 2.5em);
  font-weight: 900;
  margin-bottom: 10px;
}

.topics-hero-subtitle {
  font-size: clamp(0.9em, 2.2vw, 1.05em);
  font-weight: 300;
  opacity: 0.78;
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.85;
}

.topics-hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  line-height: 0;
}

.topics-hero-wave svg {
  width: 100%;
  height: 50px;
}

/* ════════════════════════════════════════
   جستجو
   ════════════════════════════════════════ */

.topics-search {
  position: relative;
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease backwards;
}

.topics-search input {
  width: 100%;
  padding: 16px 24px 16px 50px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95em;
  color: var(--text);
  background: var(--bg-white);
  outline: none;
  transition: var(--transition);
}

.topics-search input:focus {
  border-color: #4a5c8a;
  box-shadow: 0 0 0 4px rgba(74, 92, 138, 0.1);
}

.topics-search input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ════════════════════════════════════════
   فیلتر تگ‌ها
   ════════════════════════════════════════ */

.topics-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  animation: fadeInUp 0.5s ease backwards;
  animation-delay: 0.08s;
}

.topic-tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--bg-white);
  font-family: inherit;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.topic-tag-btn:hover {
  border-color: var(--tag-color, #4a5c8a);
  color: var(--tag-color, #4a5c8a);
}

.topic-tag-btn.active {
  background: var(--tag-color, #4a5c8a);
  border-color: var(--tag-color, #4a5c8a);
  color: white;
}

.topic-tag-count {
  background: rgba(0, 0, 0, 0.07);
  padding: 1px 8px;
  border-radius: 50px;
  font-size: 0.85em;
  font-weight: 700;
}

.topic-tag-btn.active .topic-tag-count {
  background: rgba(255, 255, 255, 0.22);
}

/* ════════════════════════════════════════
   آمار
   ════════════════════════════════════════ */

.topics-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 0.88em;
  color: var(--text-muted);
  font-weight: 500;
}

.stats-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.4;
}

/* ════════════════════════════════════════
   گروه ترم
   ════════════════════════════════════════ */

.topic-group {
  margin-bottom: 28px;
  animation: fadeInUp 0.5s ease backwards;
}

.topic-group:last-child {
  margin-bottom: 0;
}

.topic-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.topic-group-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.topic-group-term {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--text-muted);
  padding: 2px 10px;
  background: var(--bg);
  border-radius: 50px;
}

.topic-group-title {
  font-size: 0.95em;
  font-weight: 800;
  color: var(--text);
}

.topic-group-count {
  font-size: 0.78em;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: auto;
}

.topic-group-link {
  font-size: 0.78em;
  font-weight: 700;
  color: var(--text-muted);
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 50px;
  transition: var(--transition);
}

.topic-group-link:hover {
  color: var(--text);
  border-color: var(--text-secondary);
}

/* ════════════════════════════════════════
   جلسات در گروه
   ════════════════════════════════════════ */

.topic-group-sessions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 12px;
  border-right: 2px solid var(--border);
  margin-right: 4px;
}

.topic-session-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-white);
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  transition: var(--transition);
}

.topic-session-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.topic-session-num {
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82em;
  flex-shrink: 0;
}

.topic-session-content {
  flex: 1;
  min-width: 0;
}

.topic-session-fa {
  font-size: 0.92em;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.6;
}

.topic-session-en {
  font-size: 0.76em;
  color: var(--text-muted);
  font-weight: 400;
  direction: ltr;
  display: inline-block;
  line-height: 1.5;
  margin-bottom: 6px;
}

.topic-session-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.topic-session-tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 50px;
  font-size: 0.65em;
  font-weight: 600;
  background: color-mix(in srgb, var(--tag-color) 12%, white);
  color: var(--tag-color);
  border: 1px solid color-mix(in srgb, var(--tag-color) 22%, white);
}

/* هایلایت جستجو */
.search-highlight {
  background: #fff3bf;
  color: var(--text);
  border-radius: 3px;
  padding: 0 2px;
}

/* بدون نتیجه */
.topics-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 0.95em;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ════════════════════════════════════════
   Responsive
   ════════════════════════════════════════ */

@media (max-width: 768px) {
  .topics-hero {
    padding: 40px 0 58px;
  }

  .topics-hero-icon {
    font-size: 2.2em;
  }

  .topics-tags {
    gap: 6px;
  }

  .topic-tag-btn {
    padding: 7px 14px;
    font-size: 0.78em;
  }

  .topic-group-header {
    padding: 12px 14px;
    gap: 8px;
  }

  .topic-group-link {
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }

  .topic-group-count {
    margin-right: 0;
  }

  .topic-group-sessions {
    padding-right: 8px;
  }

  .topic-session-item {
    padding: 12px 14px;
    gap: 10px;
  }

  .topic-session-num {
    min-width: 30px;
    height: 30px;
    font-size: 0.75em;
  }
}

@media (max-width: 420px) {
  .topic-session-tags {
    gap: 3px;
  }

  .topic-session-tag {
    font-size: 0.6em;
    padding: 1px 7px;
  }
}

@supports not (background: color-mix(in srgb, red 10%, white)) {
  .topic-session-tag {
    background: var(--bg);
    border-color: var(--border);
  }
}