/*
 * watch.css
 * 동영상 시청 페이지 전용 스타일
 */

/* 메인 레이아웃 (기존 main과 다름) */
.watch-container {
  display: flex;
  flex-wrap: wrap; /* 화면이 좁아지면 줄바꿈 */
  justify-content: center;
  padding: 24px;
  gap: 24px;
}

/* 1. 왼쪽: 동영상 플레이어 섹션 */
.video-player-section {
  flex: 1; /* 남는 공간 모두 차지 */
  min-width: 500px; /* 최소 너비 */
  max-width: 1280px;
}

.video-player {
  width: 100%;
  aspect-ratio: 16 / 9; /* 16:9 비율 유지 */
  background-color: #eee;
  border-radius: 12px;
  overflow: hidden;
}

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

.watch-title {
  font-size: 20px;
  font-weight: 600;
  margin: 12px 0;
}

.watch-info-bar {
  display: flex;
  flex-wrap: wrap; /* 버튼 많아지면 줄바꿈 */
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 12px;
}

.channel-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.channel-info .channel-icon {
  font-size: 36px;
}
.channel-name {
  font-weight: 600;
  margin: 0;
}
.channel-subs {
  font-size: 12px;
  color: gray;
  margin: 0;
}
.subscribe-btn {
  background-color: #222;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}

.action-buttons {
  display: flex;
  gap: 8px;
}
.action-buttons button {
  background-color: #eee;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
}

.description-box {
  background-color: #eee;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.5;
}

/* 2. 오른쪽: 플레이리스트 섹션 */
.playlist-section {
  width: 100%; /* 모바일에서 전체 너비 */
  max-width: 400px; /* 데스크탑에서 최대 너비 */
  flex-shrink: 0;
}

.playlist-header {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 12px;
}

.playlist-videos {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.playlist-video-card {
  display: flex;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
  border-radius: 8px;
  padding: 8px;
}
.playlist-video-card:hover {
  background-color: #e5e5e5;
}

.playlist-video-card img {
  width: 160px; /* 썸네일 너비 고정 */
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
}

.playlist-video-card .video-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.playlist-video-card .video-channel,
.playlist-video-card .video-views {
  font-size: 12px;
}

/* * 다크모드 (watch.css)
 * 기존 style.css의 다크모드와 연동됩니다.
 */
body.dark-mode .subscribe-btn {
  background-color: #f1f1f1;
  color: #222;
}

body.dark-mode .action-buttons button {
  background-color: #383838;
}

body.dark-mode .description-box {
  background-color: #383838;
}

body.dark-mode .playlist-video-card:hover {
  background-color: #383838;
}

/*
 * watch.css
 * (추가) 댓글 섹션 스타일
 */

.comments-section {
  margin-top: 24px;
}

.comments-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.comments-header h3 {
  margin: 0;
  font-size: 18px;
}

.comments-header button {
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
}

.comment-input-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.comment-input-area .channel-icon {
  font-size: 36px;
}

.comment-input-area input {
  flex: 1;
  border: none;
  border-bottom: 1px solid #ddd;
  padding: 8px 4px;
  font-size: 14px;
  background: none;
}
.comment-input-area input:focus {
  outline: none;
  border-bottom: 2px solid #222;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comment-item {
  display: flex;
  gap: 12px;
}

.comment-text {
  flex: 1;
}

.comment-author {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 4px 0;
}
.comment-author .comment-date {
  font-weight: 400;
  color: gray;
  margin-left: 8px;
}

.comment-body {
  font-size: 14px;
  margin: 0 0 8px 0;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.comment-actions button {
  font-size: 13px;
  padding: 0;
  gap: 6px;
}
.comment-actions button:hover {
  background-color: #eee;
  border-radius: 4px;
}

/*
 * (추가) 댓글 섹션 다크모드
 */

body.dark-mode .comment-input-area input {
  border-bottom: 1px solid #555;
  color: #f1f1f1;
}
body.dark-mode .comment-input-area input:focus {
  border-bottom: 2px solid #f1f1f1;
}

body.dark-mode .comment-actions button:hover {
  background-color: #383838;
}