/* ==========================================================================
   AVStream - Player & Watch Page Styles
   ========================================================================== */

.watch-container {
  padding-top: 24px;
  padding-bottom: 60px;
}

.watch-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

/* ==========================================================================
   Player Area & Theater Mode
   ========================================================================== */

.player-wrapper {
  position: relative;
  width: 100%;
  background: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-medium);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
}

.player-element {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  object-fit: contain;
}

/* Theater Mode Active */
body.theater-mode .watch-layout {
  display: block;
}

body.theater-mode .watch-main {
  max-width: 100%;
}

body.theater-mode .player-wrapper {
  border-radius: 0;
  border-left: none;
  border-right: none;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  max-height: 80vh;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

body.theater-mode .player-container {
  padding-top: 0;
  height: 75vh;
  min-height: 480px;
  max-height: 800px;
}

body.theater-mode .watch-details-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  margin-top: 24px;
}

/* ==========================================================================
   Player Source Bar & Notification
   ========================================================================== */

.player-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-top: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.source-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.source-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.source-pill.cdn {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.source-pill.embed {
  background: rgba(0, 210, 255, 0.15);
  color: var(--secondary);
  border: 1px solid rgba(0, 210, 255, 0.3);
}

.player-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Video Details & Actions
   ========================================================================== */

.video-info-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 16px;
}

.video-title-watch {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.video-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 16px;
  flex-wrap: wrap;
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Description Section */
.video-description-box {
  margin-top: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.description-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  transition: all 0.2s ease;
}

.tag-pill:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

/* ==========================================================================
   Sidebar: Related Videos
   ========================================================================== */

.related-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.related-item {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 8px;
  transition: all 0.2s ease;
}

.related-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateX(4px);
}

.related-thumb-wrap {
  position: relative;
  width: 120px;
  height: 68px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}

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

.related-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.related-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.related-item:hover .related-title {
  color: var(--accent);
}

.related-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }
  .related-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .related-list {
    grid-template-columns: 1fr;
  }
  .video-title-watch {
    font-size: 1.15rem;
  }
  .meta-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .actions-right {
    width: 100%;
    justify-content: flex-start;
  }
}
