.details-page {
  min-height: 100vh;
  background-color: var(--bg-color);
}

.details-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  color: white;
}

.details-hero {
  min-height: 75vh;
  height: auto;
  position: relative;
  background-size: cover;
  background-position: top center;
  display: flex;
  align-items: flex-end;
}

.details-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, rgba(20, 20, 20, 0.7) 0%, rgba(20, 20, 20, 0.2) 50%, rgba(20, 20, 20, 0.7) 100%),
    linear-gradient(to top, var(--bg-color) 0%, transparent 30%);
  z-index: 1;
}

.details-content {
  position: relative;
  z-index: 2;
  padding: 100px 10px 10px 10px;
  width: 100%;
}

.back-button {
  position: relative;
  z-index: 110;
  cursor: pointer;
  background: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.8;
  transition: opacity 0.3s, transform 0.3s;
}

.back-button:hover {
  opacity: 1;
  transform: translateX(-5px);
}

.details-title {
  font-size: 4.5rem;
  font-weight: 900;
  margin-bottom: 20px;
  line-height: 1.1;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  color: white;
}

.details-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: #ccc;
}

.details-meta > * + * {
  margin-left: 20px;
}

.meta-tag {
  background-color: #333;
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: bold;
}

.meta-tag.premium {
  background-color: var(--primary-color);
}

.details-description {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 40px;
  color: #ddd;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

.details-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.details-actions > * + * {
  margin-left: 15px;
}

.icon-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s, transform 0.2s;
}

.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.icon-btn.report:hover {
  background-color: rgba(229, 9, 20, 0.3);
  border-color: var(--primary-color);
}

.telegram-btn {
  background-color: #0088CC;
  color: white;
  border: 1px solid #0088CC;
  height: 50px;
  border-radius: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  font-weight: bold;
  font-size: 14px;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.telegram-btn:hover {
  background-color: #0099e6;
  transform: scale(1.05);
}

/* Tabs & Bottom Content */
.details-bottom {
  padding: 0 10px 10px;
  position: relative;
  z-index: 2;
}

.details-tabs {
  display: flex;
  gap: 30px;
  border-bottom: 1px solid #333;
  margin-bottom: 30px;
}

.details-tabs > * + * {
  margin-left: 30px;
}

.tab-btn {
  background: none;
  color: #999;
  font-size: 1.2rem;
  font-weight: bold;
  padding: 15px 0;
  border-bottom: 3px solid transparent;
  transition: color 0.3s;
}

.tab-btn.active {
  color: white;
  border-bottom-color: var(--primary-color);
}

.tab-btn:hover:not(.active) {
  color: #ccc;
}

.tab-content {
  color: #e5e5e5;
}

.storyline-tab p {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 800px;
}

/* Casts */
.casts-list {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 20px;
}

.casts-list > * + * {
  margin-left: 20px;
}

.cast-card {
  text-align: center;
  min-width: 120px;
}

.cast-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
  border: 2px solid #333;
}

.cast-name {
  font-weight: bold;
  font-size: 1rem;
}

.cast-role {
  color: #999;
  font-size: 0.9rem;
}

/* Related */
.related-list {
  display: flex;
  overflow-x: auto;
  gap: 20px;
  padding-bottom: 20px;
}

.related-list > * + * {
  margin-left: 20px;
}

.related-card {
  cursor: pointer;
  min-width: 150px;
  width: 150px;
}

.related-img-container {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  transition: transform 0.3s ease;
  margin-bottom: 10px;
}

.related-card:hover .related-img-container {
  transform: scale(1.05);
  z-index: 5;
}

.related-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card.is-channel {
  min-width: 250px;
  width: 250px;
}

.related-card.is-channel .related-img-container {
  height: 140px; /* 16:9 ratio approximately */
}

.related-img-container:hover .hover-icons,
.related-img-container:hover span.video-item-content {
  opacity: 1;
}

/* Episodes */
.season-selector {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 10px;
}

.season-selector > * + * {
  margin-left: 15px;
}

.season-selector::-webkit-scrollbar {
  height: 6px;
}
.season-selector::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 10px;
}

.season-btn {
  flex-shrink: 0;
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--card-border);
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.2s;
}

.season-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.episodes-list {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 20px;
}

.episodes-list > * + * {
  margin-left: 15px;
}

.episode-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: var(--panel-bg);
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  min-width: 200px;
}

.episode-card:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.episode-img-wrapper {
  position: relative;
  width: 100%;
  height: 110px;
}

.episode-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.episode-hover-actions {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.episode-card:hover .episode-hover-actions {
  opacity: 1;
}

.episode-action-btn {
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}

.episode-action-btn:hover {
  transform: scale(1.1);
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.episode-info h4 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.episode-info p {
  color: #999;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .details-hero {
    min-height: 40vh;
    height: auto;
  }
  .details-content {
    padding: 85px 15px 15px 15px;
  }
  .details-title {
    font-size: 1.6rem;
    margin-bottom: 12px;
  }
  .details-meta {
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
    margin-bottom: 15px;
  }
  .details-meta > * + * {
    margin-left: 10px;
  }
  .details-description {
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
  }
  .details-actions {
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
  }
  .details-actions > * + * {
    margin-left: 10px;
  }
  .details-actions .btn-play {
    flex: 1 1 100%; /* Play button takes full row on mobile */
    justify-content: center;
  }
  .details-actions .icon-btn {
    width: 42px;
    height: 42px;
  }
  .telegram-btn {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
  .telegram-text {
    display: none;
  }
  .details-bottom {
    padding: 0 15px 15px;
  }
  .details-tabs {
    gap: 15px;
    margin-bottom: 20px;
  }
  .details-tabs > * + * {
    margin-left: 15px;
  }
  .tab-btn {
    font-size: 1rem;
    padding: 10px 0;
  }
  .episode-card {
    min-width: 170px;
    padding: 10px;
  }
  .episode-img-wrapper {
    height: 90px;
  }
  .episode-info h4 {
    font-size: 1rem;
  }
  .episode-info p {
    font-size: 0.8rem;
  }
  .casts-list, .related-list, .episodes-list {
    gap: 12px;
  }
  .casts-list > * + *, .related-list > * + *, .episodes-list > * + * {
    margin-left: 12px;
  }
  .cast-card {
    min-width: 90px;
  }
  .cast-img {
    width: 80px;
    height: 80px;
  }
  .cast-name {
    font-size: 0.85rem;
  }
  .cast-role {
    font-size: 0.75rem;
  }
  .related-card {
    min-width: 120px;
    width: 120px;
  }
  .related-img-container {
    height: 180px;
  }
  .related-card.is-channel {
    min-width: 200px;
    width: 200px;
  }
  .related-card.is-channel .related-img-container {
    height: 112px;
  }
}