/* ============================================
   ANIVORA — DETAIL PAGE
============================================ */

/* ============================================
   BACKDROP
============================================ */
.detail-backdrop {
  width: 100%;
  height: 420px;
  position: relative;
  overflow: hidden;
}
.detail-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-backdrop-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(10,10,15,0.28) 0%,
    rgba(10,10,15,1) 100%);
}

/* ============================================
   MAIN CONTAINER
============================================ */
.detail-main {
  padding: 0 16px;
  max-width: 1280px;
  margin: 0 auto;
}

/* ============================================
   TOP ROW (POSTER + INFO بالا)
============================================ */
.detail-top {
  display: flex;
  gap: 24px;
  margin-top: -120px;
  position: relative;
  z-index: 2;
  align-items: flex-start;
}
.detail-poster {
  width: 180px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border-hover);
  aspect-ratio: 2/3;
  background: var(--bg-card);
}
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  flex: 1;
  min-width: 0;
  padding-top: 70px;
}

/* ============================================
   GENRES ROW (بالای عنوان) — بزرگ‌تر
============================================ */
.detail-genres-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.detail-genres-row .tag {
  font-size: 13px;
  padding: 5px 14px;
  font-weight: 600;
  border-radius: 20px;
}

/* ============================================
   TITLE + JP TITLE — بزرگ‌تر
============================================ */
.detail-title {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.15;
  margin-bottom: 8px;
}
.detail-jp-title {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* ============================================
   STATS ROW — بزرگ‌تر
============================================ */
.detail-stats-row {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.detail-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.detail-stat-value {
  font-size: 16px;
  font-weight: 700;
}
.detail-stat-value svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   EXTRA ROW (حذف شده)
============================================ */
.detail-extra-row {
  display: none;
}

/* ============================================
   ACTIONS ROW
============================================ */
.detail-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  position: relative;
  align-items: stretch;
  justify-content: flex-start;
  margin-top: 20px;
  padding-top: 16px;
  padding-left: 0;
  border-top: 1px solid var(--border);
}
.detail-actions-row .btn {
  height: 50px;
  padding: 0 24px;
  font-size: 14px;
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.detail-actions-row .btn-primary {
  padding: 0 28px;
}
.detail-actions-row .btn-icon {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  padding: 0;
}

/* ============================================
   DESCRIPTION
============================================ */
.detail-desc {
  margin-top: 28px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 800px;
}
.detail-desc.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-more-btn {
  color: var(--accent);
  font-size: 13px;
  margin-top: 6px;
  font-weight: 500;
  transition: var(--transition);
}
.read-more-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ============================================
   TABS
============================================ */
.detail-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-top: 36px;
  overflow-x: auto;
  scrollbar-width: none;
}
.detail-tabs::-webkit-scrollbar { display: none; }

/* ============================================
   SEASON BLOCK
============================================ */
.season-block {
  margin-bottom: 28px;
}

/* ============================================
   EPISODES GRID
============================================ */
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.episode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.episode-row:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.ep-thumb {
  width: 90px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--bg-elevated);
}
.ep-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ep-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,15,0.55);
  opacity: 0;
  color: #fff;
  transition: var(--transition);
}
.episode-row:hover .ep-play { opacity: 1; }

.ep-info {
  flex: 1;
  min-width: 0;
}
.ep-number {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.ep-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-duration {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.ep-watched {
  color: var(--accent);
}

/* ============================================
   CHARACTERS / STAFF
============================================ */
.detail-person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: var(--transition);
}
.detail-person-card:hover {
  border-color: var(--border-hover);
}
.detail-person-card img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.detail-person-name {
  font-size: 13.5px;
  font-weight: 600;
}
.detail-person-role {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================
   REVIEWS
============================================ */
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}
.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.review-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.review-user {
  font-size: 13.5px;
  font-weight: 600;
}
.review-date {
  font-size: 11px;
  color: var(--text-muted);
}
.review-score {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 13px;
  color: var(--gold);
}
.review-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ============================================
   SIDEBAR EPISODE THUMBNAILS (Watch Page)
============================================ */
.sidebar-ep-thumb {
  width: 70px;
  height: 40px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-elevated);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-ep-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sidebar-ep-thumb svg {
  color: var(--text-muted);
}

/* ============================================
   UP NEXT CARDS (Watch Page)
============================================ */
.up-next-thumb {
  width: 100%;
  height: 110px;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.up-next-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.up-next-thumb svg {
  color: var(--text-muted);
}

/* ============================================
   SEASON DROPDOWN
============================================ */
.season-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.season-dropdown {
  position: relative;
  flex-shrink: 0;
}

.season-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  min-width: 140px;
  justify-content: space-between;
  height: 44px;
}
.season-dropdown-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
}

.season-chevron {
  color: var(--text-muted);
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}
.season-dropdown.open .season-chevron {
  transform: rotate(-90deg);
  color: var(--accent);
}
.season-dropdown.open .season-dropdown-btn {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.season-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  padding: 6px;
  z-index: 100;
  display: none;
  animation: fadeUp 0.15s ease both;
  max-height: 320px;
  overflow-y: auto;
}
.season-dropdown.open .season-dropdown-menu {
  display: block;
}

.season-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.season-dropdown-item:hover {
  background: var(--bg-elevated);
  color: var(--accent);
}
.season-dropdown-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
}

.season-dropdown-item .season-ep-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.season-dropdown-item.active .season-ep-count {
  background: rgba(108,99,255,0.2);
  color: var(--accent);
}

/* ★ badge مربع کوچیک کنار dropdown */
.season-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  flex-shrink: 0;
  text-align: center;
}

/* ★ موبایل */
@media (max-width: 768px) {
  .season-header-row {
    gap: 8px;
  }
  .season-dropdown-btn {
    padding: 8px 14px;
    font-size: 13px;
    min-width: 120px;
    height: 40px;
  }
  .season-dropdown-item {
    padding: 9px 11px;
    font-size: 13px;
  }
  .season-count-badge {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
}
/* ============================================
   DETAIL — ABOUT TAB
============================================ */
.detail-about-wrap {
  max-width: 800px;
}

.detail-about-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-about-title-bar {
  display: block;
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.detail-about-text {
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   DETAIL — RECOMMENDED TAB
============================================ */
.detail-recommended-wrap {
  max-width: 100%;
}

.detail-recommended-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ★ Flexbox — کارت‌ها کنار هم، نه زیر هم */
.detail-recommended-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.detail-recommended-grid .anime-card {
  width: 158px;
  flex-shrink: 0;
}
/* ★ موبایل — کارت‌های Recommended: ۳ تا در هر ردیف */
@media (max-width: 768px) {
  .detail-about-title,
  .detail-recommended-title {
    font-size: 14px;
    margin-bottom: 12px;
  }
  .detail-about-text {
    font-size: 13px;
    line-height: 1.75;
  }
  .detail-recommended-grid {
    gap: 8px;
  }
  .detail-recommended-grid .anime-card {
    width: calc(33.333% - 6px);
    max-width: none;
    flex-shrink: 0;
  }
/* ★ موبایل — کارت‌های Recommended: ۳ تا در هر ردیف */
@media (max-width: 768px) {
  .detail-about-title,
  .detail-recommended-title {
    font-size: 14px;
    margin-bottom: 12px;
  }
  .detail-about-text {
    font-size: 13px;
    line-height: 1.75;
  }
  .detail-recommended-grid {
    gap: 8px;
  }
  .detail-recommended-grid .anime-card {
    width: calc(33.333% - 6px);
    max-width: none;
    flex-shrink: 0;
  }

  /* متن‌های کارت متناسب با اندازه کوچیک‌تر */
  .detail-recommended-grid .anime-card .card-body {
    padding: 6px;
  }

  /* ★ عنوان فقط یک خط با ... */
  .detail-recommended-grid .anime-card .card-title {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    margin-bottom: 4px;
  }

  .detail-recommended-grid .anime-card .card-meta-item {
    font-size: 9.5px;
  }
  .detail-recommended-grid .anime-card .status-badge {
    font-size: 8px !important;
    padding: 1px 4px !important;
  }
  .detail-recommended-grid .anime-card .card-genres {
    gap: 3px;
    margin-top: 4px;
  }
  .detail-recommended-grid .anime-card .card-genre-tag {
    font-size: 8.5px;
    padding: 1px 4px;
  }
  .detail-recommended-grid .anime-card .card-score {
    font-size: 9.5px;
    padding: 2px 5px;
  }
  .detail-recommended-grid .anime-card .card-type {
    font-size: 9px;
    padding: 1px 5px;
  }
}