/* Watch Page Styles */

.watch-page {
  background-color: var(--bg-primary);
}

.watch-content {
  flex: 1;
  padding: var(--spacing-xl);
  margin-left: 0; /* No padding on watch page */
  max-width: 100%;
  transition: margin-left 0.2s;
}

/* Hide sidebar on watch page (desktop and mobile) */
@media (min-width: 769px) {
  .watch-page .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  /* Show sidebar when expanded on desktop */
  .watch-page .sidebar.expanded {
    transform: translateX(0);
  }

  /* Adjust margin when sidebar is shown and expanded */
  .watch-page .sidebar.expanded ~ .watch-content {
    margin-left: 240px;
  }
}

/* Mobile: sidebar should follow normal mobile behavior */
@media (max-width: 768px) {
  .watch-page .sidebar {
    transform: translateX(-100%);
  }

  .watch-page .sidebar.open {
    transform: translateX(0);
  }

  .watch-content {
    margin-left: 0 !important;
  }
}

.watch-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--spacing-xl);
  max-width: 1920px;
  margin: 0 auto;
}

.primary-content {
  min-width: 0;
}

.secondary-content {
  position: sticky;
  top: calc(var(--header-height) + var(--spacing-xl));
  height: fit-content;
  max-height: calc(100vh - var(--header-height) - var(--spacing-xl) * 2);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.secondary-content::-webkit-scrollbar {
  width: 8px;
}

.secondary-content::-webkit-scrollbar-thumb {
  background-color: var(--bg-hover);
  border-radius: 4px;
}

/* Video Player */
.video-player-section {
  margin-bottom: var(--spacing-xl);
}

.video-player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: var(--spacing-lg);
}

.video-player-container iframe {
  width: 100%;
  height: 100%;
}

/* Video Info */
.video-info-section {
  padding: var(--spacing-lg) 0;
}

.video-title-large {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: var(--spacing-lg);
  text-align: left;
  color: var(--text-primary);
}

.video-metadata-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--border);
}

.channel-info-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.channel-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.channel-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.channel-name-large {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.subscriber-count {
  font-size: 12px;
  color: var(--text-tertiary);
}

.subscribe-button {
  padding: 10px 16px;
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-left: var(--spacing-md);
}

.subscribe-button:hover {
  background-color: var(--text-secondary);
}

/* Video Actions */
.video-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.action-button-group {
  display: flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  border-radius: 24px;
  overflow: hidden;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.action-button:hover {
  background-color: var(--bg-hover);
}

.action-button svg {
  width: 24px;
  height: 24px;
}

.action-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border);
}

.more-button {
  width: 44px;
  justify-content: center;
  padding: 10px;
}

/* Video Description */
.video-description {
  background-color: var(--bg-tertiary);
  padding: var(--spacing-lg);
  border-radius: 12px;
  margin-bottom: var(--spacing-lg);
}

.description-header {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  font-size: 14px;
  font-weight: 500;
}

.view-count,
.upload-date {
  color: var(--text-primary);
}

.description-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.description-text p {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.description-text p:last-child {
  margin-bottom: 0;
}

/* Video Tags */
.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
}

.video-tag {
  padding: 6px 12px;
  background-color: var(--bg-tertiary);
  color: #3ea6ff;
  border-radius: 16px;
  font-size: 13px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.video-tag:hover {
  background-color: var(--bg-hover);
}

/* Comments Section */
.comments-section {
  margin-top: var(--spacing-xl);
}

.comments-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.comments-count {
  font-size: 20px;
  font-weight: 500;
}

.sort-comments {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.sort-comments svg {
  width: 24px;
  height: 24px;
}

/* Add Comment */
.add-comment {
  display: flex;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
  border-bottom: 1px solid var(--border);
}

.comment-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 14px;
  padding: 8px 0;
  outline: none;
}

.comment-input:focus {
  border-bottom-color: var(--text-primary);
}

.comment-input::placeholder {
  color: var(--text-tertiary);
}

/* Comment Card */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.comment-card {
  display: flex;
  gap: var(--spacing-lg);
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: 4px;
}

.comment-author {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.comment-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.comment-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.comment-action-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 16px;
  transition: background-color 0.2s;
}

.comment-action-button:hover {
  background-color: var(--bg-tertiary);
}

.reply-button {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.2s;
}

.reply-button:hover {
  background-color: var(--bg-tertiary);
}

/* Suggested Videos */
.suggested-videos {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.suggested-video {
  display: flex;
  gap: var(--spacing-sm);
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 8px;
  padding: 4px;
  transition: background-color 0.2s;
}

.suggested-video:hover {
  background-color: var(--bg-tertiary);
}

.suggested-thumbnail {
  position: relative;
  width: 168px;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.suggested-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.0);
}

.suggested-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.suggested-info {
  flex: 1;
  min-width: 0;
  padding: 2px 0;
  text-align: left;
}

.suggested-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.suggested-channel {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.suggested-stats {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 1280px) {
  .watch-grid {
    grid-template-columns: 1fr 350px;
  }

  .suggested-thumbnail {
    width: 140px;
  }
}

@media (max-width: 1024px) {
  .watch-grid {
    grid-template-columns: 1fr;
  }

  .secondary-content {
    position: static;
    max-height: none;
  }

  .suggested-videos {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .suggested-videos::-webkit-scrollbar {
    display: none;
  }

  .suggested-video {
    flex-direction: column;
    min-width: 200px;
  }

  .suggested-thumbnail {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .watch-content {
    padding: var(--spacing-md);
    margin-left: 0;
  }

  .video-title-large {
    font-size: 16px;
  }

  .video-metadata-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-lg);
  }

  .video-actions {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .video-actions::-webkit-scrollbar {
    display: none;
  }

  .action-button {
    white-space: nowrap;
  }

  .channel-info-row {
    width: 100%;
  }

  .subscribe-button {
    margin-left: auto;
  }
}

/* Share Modal */
.share-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.share-modal.active {
  display: flex;
}

.share-modal-content {
  background-color: var(--bg-primary);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border);
}

.share-modal-header h3 {
  font-size: 20px;
  font-weight: 500;
  margin: 0;
  color: var(--text-primary);
}

.share-modal-close {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.share-modal-close:hover {
  background-color: var(--bg-hover);
}

.share-modal-body {
  padding: var(--spacing-lg);
}

.share-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  color: var(--text-primary);
  padding: var(--spacing-md);
  border-radius: 8px;
  transition: background-color 0.2s;
}

.share-option:hover {
  background-color: var(--bg-tertiary);
}

.share-option span {
  font-size: 12px;
  text-align: center;
}

.share-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.share-option:hover .share-icon {
  transform: scale(1.0);
}

.share-icon.facebook {
  background-color: #1877f2;
}

.share-icon.twitter {
  background-color: #0a0a0a;
}

.share-icon.whatsapp {
  background-color: #25d366;
}

.share-icon.telegram {
  background-color: #0088cc;
}

.share-icon.line {
  background-color: #00b900;
}

.share-icon.reddit {
  background-color: #ff4500;
}

.share-icon.linkedin {
  background-color: #0a66c2;
}

.share-icon.instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.share-icon svg {
  width: 28px;
  height: 28px;
}

.share-icon svg path {
  fill: white !important;
}

.share-link-section {
  padding: var(--spacing-md);
  background-color: var(--bg-tertiary);
  border-radius: 8px;
}

.share-input-row {
  display: flex;
  gap: var(--spacing-sm);
}

.share-link-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  padding: 8px;
  outline: none;
  min-width: 0;
  text-overflow: ellipsis;
}

.copy-link-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.copy-link-button:hover {
  background-color: var(--text-secondary);
  transform: scale(1.05);
}

.copy-link-button svg {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .share-options {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
  }

  .share-icon {
    width: 48px;
    height: 48px;
  }

  .share-icon svg {
    width: 24px;
    height: 24px;
  }

  .share-modal-content {
    width: 95%;
    max-height: 85vh;
  }
}

@media (max-width: 480px) {
  .watch-content {
    padding: 0;
  }

  .video-player-container {
    border-radius: 0;
    margin: 0;
    width: 100%;
  }

  .video-info-section,
  .video-description,
  .video-tags {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }

  .action-button span {
    display: none;
  }

  .action-button {
    padding: 10px 12px;
  }

  .share-options {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
  }

  .share-option span {
    font-size: 10px;
  }

  .share-modal-header h3 {
    font-size: 18px;
  }

  .share-input-row {
    flex-direction: column;
  }

  .copy-link-button {
    width: 100%;
    justify-content: center;
  }

  /* Hide embed button on mobile */
  .embed-button-desktop {
    display: none !important;
  }
}

/* ===== Embed Modal (Desktop Only) ===== */
.embed-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
}

.embed-modal.active {
  display: flex;
}

.embed-modal-content {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.embed-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.embed-modal-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.embed-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
}

.embed-modal-close:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.embed-modal-body {
  display: flex;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
}

.embed-preview {
  flex: 1;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.embed-preview iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.embed-code-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.embed-code-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.embed-code-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  padding: var(--spacing-md);
  resize: none;
  min-height: 120px;
  line-height: 1.5;
}

.embed-code-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.embed-copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.embed-copy-button:hover {
  background-color: #c00;
  transform: scale(1.02);
}

.embed-copy-button svg {
  flex-shrink: 0;
}
