@import url('../components/open-topics-overlay-trigger.css');
@import url('../components/video-topic-marker.css');

/* עמוד צפייה – full width, סגנון YouTube */

body.page-videos-watch .watch-page-wrap {
  background: #fff !important;
  min-height: 60vh;
  padding-bottom: 2rem;
  width: 100%;
}

body.page-videos-watch .watch-page-container {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

/* סרטון בפרטיות «קישור» – רוחב מלא */
body.page-videos-watch .watch-page-wrap.watch-page-link-privacy .watch-page-container {
  max-width: none;
  padding-left: 1rem;
  padding-right: 1rem;
}

body.page-videos-watch #video-page {
  margin: 0 !important;
  align-items: flex-start;
  width: 100%;
}

@media (min-width: 992px) {
  body.page-videos-watch #video-page {
    gap: 1.5rem;
    display: flex !important;
    flex-wrap: nowrap !important;
  }
  /* מומלצים בצד שמאל, סרטון מימין (LTR) */
  body.page-videos-watch #video-page .watch-page-sidebar {
    order: 1;
  }
  body.page-videos-watch #video-page .watch-page-main {
    order: 2;
  }
  /* RTL: אותו סדר ויזואלי – מומלצים בשמאל, סרטון בימין */
  body.page-videos-watch[dir="rtl"] #video-page .watch-page-sidebar,
  body[dir="rtl"].page-videos-watch #video-page .watch-page-sidebar {
    order: 2;
  }
  body.page-videos-watch[dir="rtl"] #video-page .watch-page-main,
  body[dir="rtl"].page-videos-watch #video-page .watch-page-main {
    order: 1;
  }
  body.page-videos-watch .watch-page-container {
    padding: 1rem 2rem;
  }
}

/* ---- עמודה ראשית (וידאו + כותרת + פעולות + תיאור) ---- */
body.page-videos-watch #video-page .watch-page-main {
  display: flex !important;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

/* וידאו – רוחב מלא, יחס 16:9, פינות עדינות */
body.page-videos-watch #video-page #video-screen {
  margin: 0 !important;
}

body.page-videos-watch #video-page #video-screen .col {
  padding: 0 !important;
}

body.page-videos-watch #video-page .video-frame {
  position: relative;
  width: 100%;
  border-radius: 12px !important;
  overflow: hidden;
  background: #000 !important;
  box-shadow: none !important;
  border: none !important;
}

body.page-videos-watch #video-page .video-frame.horizontal {
  aspect-ratio: 16 / 9;
  min-height: 200px;
}

body.page-videos-watch #video-page .video-frame iframe,
body.page-videos-watch #video-page .video-frame video,
body.page-videos-watch #video-page .video-frame img {
  border-radius: 12px !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  display: block;
}

/* כותרת – מתחת לווידאו, כמו YouTube */
body.page-videos-watch #video-page #video-title {
  margin: 0 !important;
  padding: 0 !important;
}

body.page-videos-watch #video-page #video-title .col {
  padding: 0 !important;
}

body.page-videos-watch #video-page #video-title h4 {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  color: #0f0f0f !important;
  line-height: 1.4;
}

/* שורת פעולות – ערוץ משמאל, כפתורים מימין (בלי כרטיס) */
body.page-videos-watch #video-page #video-menu {
  margin: 0 !important;
  padding: 0.75rem 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.page-videos-watch #video-page #video-menu .row {
  margin: 0 !important;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

body.page-videos-watch #video-page #video-menu .row > [class*="col-"] {
  flex: 0 1 auto;
}

body.page-videos-watch #video-page #video-menu #upper {
  margin-bottom: 0 !important;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

body.page-videos-watch #video-page #video-menu .avatar {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
}

body.page-videos-watch #video-page #video-menu .avatar img {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  object-fit: cover;
}

body.page-videos-watch #video-page #video-menu .avatar .user-stats {
  display: flex !important;
  flex-direction: column;
  gap: 0.1rem;
}

body.page-videos-watch #video-page #video-menu .avatar .user-stats .user-profile {
  font-weight: 600 !important;
  font-size: 1rem !important;
  color: #0f0f0f !important;
  text-decoration: none !important;
}

body.page-videos-watch #video-page #video-menu .avatar .user-stats .user-profile:hover {
  color: var(--primary) !important;
}

body.page-videos-watch #video-page #video-menu .avatar .user-stats span {
  font-size: 0.8rem !important;
  color: #606060 !important;
}

body.page-videos-watch #video-page #video-menu #video-more {
  flex-wrap: wrap;
  gap: 0.25rem;
}

body.page-videos-watch #video-page #video-menu #video-more .btn {
  margin: 0 !important;
}

/* כפתורים עדינים – מינימליסטיים */
body.page-videos-watch #video-page #video-menu .btn,
body.page-videos-watch #video-page #video-menu a[class*="btn"] {
  height: auto !important;
  min-height: 36px !important;
  border-radius: 18px !important;
  font-weight: 400 !important;
  font-size: 0.8125rem !important;
  padding: 0.35rem 0.65rem !important;
  background: transparent !important;
  border: none !important;
  color: #606060 !important;
  box-shadow: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}

body.page-videos-watch #video-page #video-menu .btn:hover,
body.page-videos-watch #video-page #video-menu a[class*="btn"]:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #0f0f0f !important;
}

body.page-videos-watch #video-page #video-menu .btn-primary-s,
body.page-videos-watch #video-page #video-menu a.btn-primary-s {
  background: rgba(204, 0, 0, 0.9) !important;
  color: #fff !important;
}

/* If both triggers exist, keep topics first and move viewer comments below it */
body.page-videos-watch #openTopicsOverlayTrigger ~ .add-note-trigger {
  top: 148px !important;
}

/* Topics side drawer over video (instead of full-screen modal) */
body.page-videos-watch #topicsListOverlay.topics-side-panel {
  position: absolute;
  top: 52px;
  bottom: 56px;
  left: 0;
  width: min(360px, 88%);
  z-index: 15;
  background: rgba(0, 0, 0, 0.86);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  border-radius: 0 10px 10px 0;
  color: #fff;
  transform: translateX(-102%);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 180ms ease;
}

body.page-videos-watch #topicsListOverlay.topics-side-panel.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

body.page-videos-watch #topicsListOverlay .topics-side-panel__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  min-height: 0;
}

body.page-videos-watch #topicsListOverlay .topics-side-panel__head b {
  color: #fff;
  font-size: 0.95rem;
}

body.page-videos-watch #topicsListOverlay .topics-side-panel__list {
  margin-top: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  align-content: start;
  justify-items: stretch;
  grid-auto-rows: max-content;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
  padding-bottom: 6px;
}

body.page-videos-watch #topicsListOverlay .topics-side-panel__item {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: 9px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

body.page-videos-watch #topicsListOverlay .topics-side-panel__item:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateX(-1px);
}

body.page-videos-watch #topicsListOverlay .topics-side-panel__item-name {
  flex: 1 1 0%;
  min-width: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.page-videos-watch #topicsListOverlay .topics-side-panel__item-time {
  flex: 0 0 auto;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.9);
}

body.page-videos-watch #topicsListOverlay .topics-side-panel__list::-webkit-scrollbar {
  width: 9px;
}

body.page-videos-watch #topicsListOverlay .topics-side-panel__list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
}

body.page-videos-watch #topicsListOverlay .topics-side-panel__list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.22);
}

/* Add-note drawer over video (same shell as topics drawer, different heading/form content). */
body.page-videos-watch #addNoteOverlay.add-note-overlay {
  position: absolute;
  top: 52px;
  bottom: 56px;
  left: 0;
  right: auto;
  width: min(360px, 88%);
  z-index: 16;
  background: rgba(0, 0, 0, 0.86);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 0;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  border-radius: 0 10px 10px 0;
  color: #fff;
  padding: 14px 12px;
  box-sizing: border-box;
}

body.page-videos-watch #addNoteOverlay.add-note-overlay:not([hidden]) {
  animation: add-note-drawer-slide-in 220ms ease both;
}

body.page-videos-watch #addNoteOverlay.add-note-overlay #features-questions {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  color: #fff;
}

body.page-videos-watch #addNoteOverlay.add-note-overlay #question-form {
  height: 100%;
  display: flex;
  flex-direction: column;
}

body.page-videos-watch #addNoteOverlay.add-note-overlay #question-form .row.mb-3 {
  margin-bottom: 0.75rem !important;
}

body.page-videos-watch #addNoteOverlay.add-note-overlay #question-form .stream-form {
  min-height: 180px;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

body.page-videos-watch #addNoteOverlay.add-note-overlay #question-form .stream-form::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

body.page-videos-watch #addNoteOverlay.add-note-overlay #thanks {
  color: #fff;
}

@keyframes add-note-drawer-slide-in {
  from {
    transform: translateX(-102%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

body.page-videos-watch #video-page #video-menu .btn-primary-s:hover,
body.page-videos-watch #video-page #video-menu a.btn-primary-s:hover {
  background: rgba(180, 0, 0, 0.95) !important;
  color: #fff !important;
}

body.page-videos-watch #video-page #video-menu .btn .material-symbols-outlined,
body.page-videos-watch #video-page #video-menu a[class*="btn"] .material-symbols-outlined {
  font-size: 1.15rem !important;
  margin-left: 2px !important;
  opacity: 0.9;
}

/* שורת מדדים – מתחת לפעולות, בעמודה הראשית */
body.page-videos-watch #video-page .watch-page-metrics-row {
  margin: 0 !important;
  padding: 0.6rem 0 0.75rem !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.page-videos-watch #video-page .watch-page-metrics-row .col {
  padding: 0 !important;
}

body.page-videos-watch #video-page .watch-page-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

body.page-videos-watch #video-page .watch-page-metrics-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s, opacity 0.15s;
}

body.page-videos-watch #video-page .watch-page-metrics-link:hover {
  color: var(--primary);
  opacity: 0.85;
}

body.page-videos-watch #video-page .watch-page-metrics-link .material-symbols-outlined {
  font-size: 1.2rem;
}

body.page-videos-watch #video-page .watch-page-metrics-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}

body.page-videos-watch #video-page .watch-page-metrics-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #606060;
  cursor: help;
}

body.page-videos-watch #video-page .watch-page-metrics-label {
  font-weight: 500;
}

body.page-videos-watch #video-page .watch-page-metrics-value {
  font-weight: 600;
  color: #0f0f0f;
}

/* בלוק תיאור – רקע אפור עדין כמו YouTube */
body.page-videos-watch #video-page #video-description {
  margin: 0 !important;
}

body.page-videos-watch #video-page #video-description .col {
  padding: 0 !important;
}

body.page-videos-watch #video-page #video-description .wrapper.border-box-shadow {
  background: #f9f9f9 !important;
  border-radius: 12px !important;
  border: none !important;
  box-shadow: none !important;
  padding: 1rem 1rem !important;
}

body.page-videos-watch #video-page #video-description .wrapper .stats {
  display: flex !important;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 1.25rem;
  color: #606060 !important;
  font-size: 0.875rem !important;
  margin-bottom: 0.75rem !important;
  line-height: 1.5;
}

body.page-videos-watch #video-page #video-description .wrapper .stats span {
  display: inline-flex !important;
  align-items: baseline;
  margin: 0 !important;
  gap: 0.25em;
}

body.page-videos-watch #video-page #video-description .wrapper .stats span:not(:last-child)::after {
  content: "•";
  margin-inline-start: 1.25rem;
  margin-inline-end: 0;
  color: #909090;
}

body.page-videos-watch #video-page #video-description .wrapper .stats b {
  color: #0f0f0f !important;
  font-weight: 600 !important;
  margin-inline-end: 0.35em;
  margin-inline-start: 0.35em;
}

body.page-videos-watch #video-page #video-description .wrapper p,
body.page-videos-watch #video-page #video-description .wrapper .ellipsis {
  color: #0f0f0f !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

body.page-videos-watch #video-page #video-description .wrapper .b-toggle {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #606060 !important;
  cursor: pointer;
  margin-top: 0.25rem !important;
}

body.page-videos-watch #video-page #video-description .wrapper .b-toggle:hover {
  color: #0f0f0f !important;
}

/* הערות על הסרטון – מתחת לתיאור, מעל תגובות */
body.page-videos-watch #video-page .watch-page-questions-section {
  margin: 0 !important;
}

body.page-videos-watch #video-page .watch-page-questions-section .col {
  padding: 0 !important;
}

body.page-videos-watch #video-page .watch-page-questions-block {
  background: #f9f9f9 !important;
  border-radius: 12px;
  padding: 1.25rem 1rem;
}

body.page-videos-watch #video-page .watch-page-questions-title {
  margin: 0 0 1rem 0 !important;
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f0f0f;
  display: flex;
  align-items: center;
}

body.page-videos-watch #video-page .watch-page-questions-title .material-symbols-outlined {
  color: #606060;
  font-size: 1.35rem;
}

body.page-videos-watch #video-page .watch-page-questions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.page-videos-watch #video-page .watch-page-questions-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

body.page-videos-watch #video-page .watch-page-questions-item:hover {
  background: #f0f0f0;
  border-color: #e0e0e0;
}

body.page-videos-watch #video-page .watch-page-questions-time {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #606060;
  min-width: 2.5rem;
}

body.page-videos-watch #video-page .watch-page-questions-content {
  font-size: 0.9rem;
  color: #0f0f0f;
  line-height: 1.4;
}

/* תגובות */
body.page-videos-watch #video-page #video-comments {
  margin: 0 !important;
}

body.page-videos-watch #video-page #video-comments .col {
  padding: 0 !important;
}

body.page-videos-watch #video-page #video-comments .comments {
  margin-top: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* ---- סרגל צד (מומלצים) בסגנון YouTube ---- */
body.page-videos-watch #video-page .watch-page-sidebar {
  position: sticky;
  top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

body.page-videos-watch #video-page .watch-page-sidebar .stream-block.block-shadow {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

body.page-videos-watch #video-page .watch-page-sidebar .stream-block .container-fluid {
  padding: 0 !important;
}

body.page-videos-watch #video-page .watch-page-sidebar .stream-block .row:first-child {
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: none;
}

body.page-videos-watch #video-page .watch-page-sidebar .stream-block h6 {
  margin: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: #0f0f0f !important;
}

body.page-videos-watch #video-page .watch-page-sidebar .stream-block small {
  font-size: 0.75rem !important;
  color: #606060 !important;
}

body.page-videos-watch #video-page .watch-page-sidebar .stream-block .row {
  margin-bottom: 0;
}

/* רשימת סרטונים מומלצים – שורה לכל סרטון (תמונה + כותרת) */
body.page-videos-watch #video-page .watch-page-sidebar [data-container] {
  display: flex !important;
  flex-direction: column;
  gap: 0.5rem !important;
}

body.page-videos-watch #video-page .watch-page-sidebar .video-card {
  display: flex !important;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  transition: opacity 0.15s;
}

body.page-videos-watch #video-page .watch-page-sidebar .video-card:hover {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  opacity: 0.85;
}

body.page-videos-watch #video-page .watch-page-sidebar .video-card .card-img {
  position: relative;
  flex-shrink: 0;
  width: 168px !important;
  min-width: 168px;
  aspect-ratio: 16 / 9;
  border-radius: 8px !important;
  overflow: hidden;
  background: #f0f0f0;
}

body.page-videos-watch #video-page .watch-page-sidebar .video-card .card-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

/* משך הסרטון על התמונה הממוזערת – רקע וטקסט ברורים */
body.page-videos-watch #video-page .watch-page-sidebar .video-visual a .card-duration,
body.page-videos-watch #video-page .watch-page-sidebar .video-card .card-img small[data-type="duration"],
body.page-videos-watch #video-page .watch-page-sidebar .video-card .card-img .body-12 {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.92) !important;
  color: #fff !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  padding: 3px 6px !important;
  border-radius: 4px !important;
  line-height: 1.2;
}

body.page-videos-watch #video-page .watch-page-sidebar .video-card .card-info {
  flex: 1;
  min-width: 0;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

body.page-videos-watch #video-page .watch-page-sidebar .video-card .card-info a.title {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.page-videos-watch #video-page .watch-page-sidebar .video-card .card-info a.user,
body.page-videos-watch #video-page .watch-page-sidebar .video-card .card-info small {
  font-size: 0.75rem !important;
  color: #606060 !important;
}

body.page-videos-watch #video-page .watch-page-sidebar .order-list-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.page-videos-watch #video-page .watch-page-sidebar .order-list-item:last-child {
  border-bottom: none;
}

body.page-videos-watch #video-page .watch-page-sidebar .order-list-item:hover {
  background: transparent;
}

@media (max-width: 991.98px) {
  body.page-videos-watch #video-page .watch-page-sidebar {
    position: static;
  }

  body.page-videos-watch .watch-page-container {
    padding: 1rem !important;
  }
}
