/* ============================================================================
   Custom video-view module stylesheet
   Targets the `vv-*` class vocabulary used in
     template/blocks/view_video/video_view_video_view.tpl
   Dark theme tuned to match the existing site (green logo accent).
   ============================================================================ */

:root {
  --vv-bg:          #0f0f0f;
  --vv-surface:     #1a1a1a;
  --vv-surface-2:   #222;
  --vv-surface-hi:  #2a2a2a;
  --vv-border:      #2c2c2c;
  --vv-text:        #e8e8e8;
  --vv-text-dim:    #a9a9a9;
  --vv-text-mute:   #777;
  --vv-accent:      #7fba3e;
  --vv-accent-hi:   #9bd85c;
  --vv-accent-dim:  #5f8f2d;
  --vv-gold:        #f5c518;
  --vv-danger:      #e05a5a;
  --vv-radius:      8px;
  --vv-radius-lg:   12px;
  --vv-gap:         12px;
}

/* ---------- Icon default sizing (kills the 300x150 SVG fallback) ---------- */
.vv-player-section svg,
.vv-info-bar svg,
.vv-actions-row svg,
.vv-uploader svg,
.vv-source-row svg,
.vv-body-section svg,
.vv-screenshots-section svg,
.vv-report-section svg,
.vv-comments-section svg,
.vv-share-overlay svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  vertical-align: middle;
}

/* ---------- Full-width flex items (the page wrap .content is display:flex) ---------- */
.vv-player-section,
.vv-info-bar,
.vv-uploader,
.vv-source-row,
.vv-body-section,
.vv-screenshots-section,
.vv-report-section,
.vv-comments-section {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}

/* ---------- SECTION 1: player wrapper ---------- */
.vv-player-section {
  margin: 0 0 16px;
}

.vv-player-box {
  background: #000;
}
.vv-player-box .player,
.vv-player-box .player-holder {
  width: 100%;
}
.vv-player-box .player-wrap {
  position: relative;
}
.vv-player-box .player-wrap #kt_player,
.vv-player-box .player-wrap .fp-player,
.vv-player-box .player-wrap video,
.vv-player-box .player-wrap iframe {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

/* Cap player height so portrait/vertical videos don't overflow the viewport —
   without this, a 9:16 video sized to fill the page width renders far taller
   than the screen. Browsers supporting aspect-ratio recompute width from the
   clamped height automatically; padding-bottom above remains the fallback. */
@supports (aspect-ratio: 1 / 1) {
  .vv-player-box .player-wrap,
  .vv-player-box .no-player,
  .vv-player-box .embed-wrap {
    aspect-ratio: var(--vv-ratio);
    height: auto !important;
    max-height: 85vh;
    padding-bottom: 0 !important;
    width: auto !important;
    max-width: 100%;
    margin: 0 auto;
  }
  .vv-player-box .player-wrap #kt_player,
  .vv-player-box .player-wrap .fp-player,
  .vv-player-box .player-wrap video,
  .vv-player-box .player-wrap iframe,
  .vv-player-box .no-player img,
  .vv-player-box .embed-wrap iframe {
    position: static !important;
  }
}
@media (max-width: 720px) {
  @supports (aspect-ratio: 1 / 1) {
    .vv-player-box .player-wrap,
    .vv-player-box .no-player,
    .vv-player-box .embed-wrap {
      max-height: 70vh;
    }
  }
}
.vv-player-box .no-player,
.vv-player-box .embed-wrap {
  position: relative;
}
.vv-player-box .no-player img,
.vv-player-box .embed-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.vv-player-box .no-player .message {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  color: #fff;
  padding: 0 16px;
  z-index: 2;
}

.vv-under-ad {
  margin: 12px 0 0;
}
.vv-under-ad .link-offer img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
  border-radius: var(--vv-radius);
}

/* ---------- SECTION 2: info bar (title, meta, actions) ---------- */
.vv-info-bar {
  padding: 16px 0 14px;
  border-bottom: 1px solid var(--vv-border);
  margin: 0 0 16px;
}

.vv-title {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--vv-text);
  word-wrap: break-word;
}

.vv-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 14px;
  color: var(--vv-text-dim);
  font-size: 13px;
}
.vv-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.vv-meta-row svg { width: 15px; height: 15px; opacity: .75; }

/* ---------- Actions row (like / dislike / favorite / playlist / share / download / report) ---------- */
.vv-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Vote group — like + rating bar + dislike as a single pill */
.vv-vote-group {
  display: inline-flex;
  align-items: center;
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  border-radius: 999px;
  padding: 2px 4px;
  gap: 2px;
}
/* Neutralise KVS theme rules on .rate-like/.rate-dislike/.like/.dislike
   that zero font-size, set icomoon font, clip to 21x20, and inject a
   ::before glyph — which otherwise overlaps our inline SVG + count. */
.vv-vote-btn.rate-like,
.vv-vote-btn.rate-dislike,
.vv-vote-btn.like,
.vv-vote-btn.dislike {
  font-family: inherit !important;
  font-size: 13px !important;
  line-height: 1 !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  position: relative !important;
  color: var(--vv-text-dim);
}
.vv-vote-btn.rate-like::before,
.vv-vote-btn.rate-dislike::before,
.vv-vote-btn.like::before,
.vv-vote-btn.dislike::before {
  content: none !important;
  display: none !important;
  background: none !important;
}
.vv-vote-btn.rate-like:hover::before,
.vv-vote-btn.rate-dislike:hover::before {
  content: none !important;
  display: none !important;
}
.vv-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--vv-text-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.vv-vote-btn:hover { color: var(--vv-text); background: var(--vv-surface-hi); }
.vv-vote-btn.vv-like:hover     { color: var(--vv-accent); }
.vv-vote-btn.vv-dislike:hover  { color: var(--vv-danger); }
.vv-vote-btn.disabled {
  cursor: not-allowed;
  opacity: .5;
}
.vv-vote-btn.disabled:hover { background: transparent; color: var(--vv-text-dim); }
.vv-vote-sep {
  width: 1px;
  align-self: stretch;
  background: var(--vv-border);
  margin: 6px 0;
}
.vv-rating-wrap {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  min-width: 60px;
}
.vv-rating-bar {
  width: 60px;
  height: 4px;
  background: var(--vv-surface-hi);
  border-radius: 2px;
  overflow: hidden;
}
.vv-rating-fill {
  height: 100%;
  background: var(--vv-accent);
  transition: width .3s;
}

/* Standalone action buttons — favorite, watch-later, share, download, report, playlist toggle */
.vv-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--vv-surface);
  color: var(--vv-text-dim);
  border: 1px solid var(--vv-border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s, background .15s;
}
.vv-action-btn:hover {
  color: var(--vv-text);
  background: var(--vv-surface-hi);
  border-color: var(--vv-accent-dim);
}
.vv-action-btn.vv-active {
  color: var(--vv-accent);
  border-color: var(--vv-accent-dim);
}
.vv-action-btn svg { width: 16px; height: 16px; }

/* Dropdown wrappers (playlist / download) */
.vv-drop-wrap {
  position: relative;
}
.vv-drop-wrap .fav-drop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
  list-style: none;
  margin: 0;
  padding: 6px 0;
}
.vv-drop-wrap.vv--open .fav-drop { display: block; }
.vv-drop-wrap .fav-drop li {
  display: block;
  list-style: none;
}
.vv-drop-wrap .fav-drop li.hidden { display: none; }
.vv-drop-wrap .fav-drop a,
.vv-drop-wrap .fav-drop span > a {
  display: block;
  padding: 8px 14px;
  color: var(--vv-text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color .15s, background .15s;
}
.vv-drop-wrap .fav-drop a:hover {
  color: var(--vv-text);
  background: var(--vv-surface-hi);
}
.vv-drop-wrap .fav-drop span {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vv-drop-wrap .fav-drop span .delete {
  color: var(--vv-danger);
  font-size: 11px;
  padding: 4px 10px;
}

.btn-holder.hidden { display: none; }

/* ---------- SECTION 3: uploader card ---------- */
.vv-uploader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--vv-border);
  margin: 0 0 16px;
}
.vv-uploader__avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--vv-surface-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--vv-text-mute);
}
.vv-uploader__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vv-uploader__avatar svg {
  width: 28px;
  height: 28px;
}
.vv-uploader__info {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  min-width: 0;
  flex: 1;
}
.vv-uploader__subs {
  flex-basis: 100%;
}
.vv-uploader__name {
  color: var(--vv-text);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.vv-uploader__name:hover { color: var(--vv-accent); }
.vv-uploader__subs {
  color: var(--vv-text-dim);
  font-size: 12px;
}
.vv-uploader__follow {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--vv-accent);
  color: #0a0a0a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.vv-uploader__follow:hover {
  background: var(--vv-accent-hi);
  color: #000;
}

/* ---------- SECTION 4: source / models chips ---------- */
.vv-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.vv-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  color: var(--vv-text-dim);
  font-size: 13px;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.vv-source-chip:hover {
  color: var(--vv-text);
  border-color: var(--vv-accent-dim);
}
.vv-source-chip svg { width: 15px; height: 15px; }
.vv-source-chip--gold {
  color: var(--vv-gold);
  border-color: rgba(245, 197, 24, .4);
}
.vv-source-chip--gold:hover {
  color: #fff;
  border-color: var(--vv-gold);
  background: rgba(245, 197, 24, .08);
}

/* ---------- SECTION 5: description + tags ---------- */
.vv-body-section {
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius-lg);
  padding: 14px 16px;
  margin: 0 0 16px;
}

.vv-description {
  margin: 0 0 10px;
}
.vv-description__text {
  color: var(--vv-text);
  font-size: 14px;
  line-height: 1.55;
  max-height: 4.8em;
  overflow: hidden;
  white-space: pre-wrap;
  word-wrap: break-word;
  transition: max-height .2s;
}
.vv-description__text.vv--expanded {
  max-height: none;
}
.vv-desc-toggle {
  background: transparent;
  border: none;
  color: var(--vv-accent);
  padding: 6px 0 0;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.vv-desc-toggle:hover { color: var(--vv-accent-hi); }
.vv-desc-toggle.vv--hidden { display: none; }

.vv-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px dashed var(--vv-border);
}
.vv-body-section .vv-tags-row:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.vv-tag {
  display: inline-flex;
  padding: 5px 11px;
  background: var(--vv-surface-hi);
  color: var(--vv-text-dim);
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.vv-tag:hover {
  color: #0a0a0a;
  background: var(--vv-accent);
}

/* ---------- SECTION 6: screenshots (collapsible) ---------- */
.vv-screenshots-section {
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius-lg);
  margin: 0 0 16px;
  overflow: hidden;
}
.vv-section-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.vv-section-hdr:hover { background: var(--vv-surface-hi); }
.vv-section-hdr__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--vv-text);
  font-size: 14px;
}
.vv-chevron {
  transition: transform .2s;
  color: var(--vv-text-dim);
}
.vv-screenshots-section.vv--open .vv-chevron { transform: rotate(180deg); }
.vv-section-body {
  display: none;
  padding: 4px 16px 14px;
}
.vv-screenshots-section.vv--open .vv-section-body { display: block; }
.vv-section-body .block-screenshots {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 8px !important;
  margin: 0 !important;
  justify-content: stretch !important;
}
.vv-section-body .block-screenshots .screen-img,
.vv-section-body .block-screenshots a.item,
.vv-section-body .block-screenshots span.item {
  width: auto !important;
  margin: 0 !important;
  padding-bottom: 56.25% !important;
  position: relative !important;
  display: block !important;
  border-radius: 6px;
  overflow: hidden;
}
.vv-section-body .block-screenshots .screen-img img,
.vv-section-body .block-screenshots a.item img,
.vv-section-body .block-screenshots span.item img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

/* ---------- SECTION 7: report ---------- */
.vv-report-section {
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius-lg);
  padding: 16px;
  margin: 0 0 16px;
}
.vv-report-section .field-label {
  display: block;
  color: var(--vv-text);
  font-weight: 600;
  margin: 0 0 8px;
  font-size: 13px;
}
.vv-report-section .block-radios .row {
  margin: 0 0 6px;
}
.vv-report-section .block-textarea {
  margin: 12px 0 0;
}
.vv-report-section .textarea {
  width: 100%;
  background: var(--vv-bg);
  border: 1px solid var(--vv-border);
  color: var(--vv-text);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: inherit;
  resize: vertical;
}

/* ---------- SECTION 8: comments ---------- */
.vv-comments-section {
  margin: 0 0 24px;
}
.vv-section-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--vv-text);
}

/* ---------- Share modal ---------- */
.vv-share-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.vv-share-overlay.vv--open {
  display: flex;
}
.vv-share-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--vv-surface);
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius-lg);
  padding: 20px 22px 22px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .55);
}
.vv-share-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--vv-text-dim);
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
}
.vv-share-close:hover { color: var(--vv-text); background: var(--vv-surface-hi); }
.vv-share-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--vv-text);
}
.vv-share-copy-row {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
}
.vv-share-url-input {
  flex: 1;
  min-width: 0;
  background: var(--vv-bg);
  border: 1px solid var(--vv-border);
  color: var(--vv-text);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
}
.vv-share-copy-btn {
  background: var(--vv-accent);
  color: #0a0a0a;
  border: 0;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.vv-share-copy-btn:hover { background: var(--vv-accent-hi); }
.vv-share-copy-btn.vv--copied { background: var(--vv-accent-dim); }

.vv-share-social {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}
.vv-share-social-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: opacity .15s;
}
.vv-share-social-btn:hover { opacity: .88; color: #fff; }
.vv-share-social-btn svg { width: 18px; height: 18px; }
.vv-share-wa { background: #25d366; }
.vv-share-tg { background: #229ed9; }

.vv-share-extras > div {
  margin: 0 0 12px;
}
.vv-share-extras label {
  display: block;
  color: var(--vv-text-dim);
  font-size: 12px;
  margin: 0 0 4px;
}
.vv-share-extras .textfield {
  width: 100%;
  background: var(--vv-bg);
  border: 1px solid var(--vv-border);
  color: var(--vv-text);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
}

.vv-share-embed-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
}
.vv-share-embed-sizes .embed-button {
  display: inline-flex;
  padding: 5px 10px;
  border: 1px solid var(--vv-border);
  border-radius: 4px;
  color: var(--vv-text-dim);
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.vv-share-embed-sizes .embed-button:hover {
  color: var(--vv-accent);
  border-color: var(--vv-accent-dim);
}
.vv-share-custom-size {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 720px) {
  .vv-title { font-size: 18px; }
  .vv-meta-row { gap: 10px; font-size: 12px; }
  .vv-actions-row { gap: 6px; }
  .vv-action-btn { padding: 7px 10px; font-size: 12px; }
  .vv-vote-btn { padding: 6px 9px; font-size: 12px; }
  .vv-uploader__follow { padding: 7px 12px; font-size: 12px; }
  .vv-section-body .block-screenshots {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .vv-share-panel { padding: 16px; }
  .vv-share-social { flex-direction: column; }
}

@media (max-width: 480px) {
  .vv-actions-row .vv-action-btn {
    font-size: 0;
    padding: 9px 11px;
    gap: 0;
  }
  .vv-actions-row .vv-action-btn svg {
    width: 16px;
    height: 16px;
  }
  .vv-vote-btn { font-size: 12px; }
}
