/* ============================================================
   renewed_video.css  –  YouTube-inspired video page
   Designed to closely match YouTube's dark-mode aesthetic
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Light Theme (default, matches renewed_base.html) */
  --yt-bg: #f9f9f9;
  --yt-surface: #ffffff;
  --yt-surface-hover: #f2f2f2;
  --yt-surface-light: #e5e5e5;
  --yt-border: #e5e5e5;
  --yt-text: #0f0f0f;
  --yt-text-secondary: #606060;
  --yt-text-muted: #909090;
  --yt-blue: #3ea6ff;
  --yt-subscribe: #0f0f0f;
  --yt-subscribe-text: #ffffff;
  --yt-pill-bg: rgba(0, 0, 0, .05);
  --yt-pill-hover: rgba(0, 0, 0, .1);
  --yt-pill-active: rgba(0, 0, 0, .15);
  --yt-overlay: rgba(0, 0, 0, .5);
  --yt-red: #ff4e45;
  --yt-green: #2ba640;
  --yt-orange: #ff8c00;
  --yt-yellow: #ffd600;
  --yt-radius: 12px;
  --yt-radius-pill: 18px;
  --yt-radius-full: 9999px;
  --yt-font: 'Roboto', 'Noto Sans JP', system-ui, sans-serif;
  --yt-transition: 150ms ease;
}

/* Dark Theme (activated by renewed_base.html's data-theme toggle) */
[data-theme="dark"] {
  --yt-bg: #0f0f0f;
  --yt-surface: #272727;
  --yt-surface-hover: #3f3f3f;
  --yt-surface-light: #3e3e3e;
  --yt-border: #3f3f3f;
  --yt-text: #f1f1f1;
  --yt-text-secondary: #aaaaaa;
  --yt-text-muted: #717171;
  --yt-blue: #3ea6ff;
  --yt-subscribe: #f1f1f1;
  --yt-subscribe-text: #0f0f0f;
  --yt-pill-bg: rgba(255, 255, 255, .1);
  --yt-pill-hover: rgba(255, 255, 255, .2);
  --yt-pill-active: rgba(255, 255, 255, .3);
  --yt-overlay: rgba(0, 0, 0, .7);
}

/* ---------- Base Overrides ---------- */
.vp-page,
.vp-page *,
.vp-page *::before,
.vp-page *::after {
  box-sizing: border-box;
}

.vp-page {
  font-family: var(--yt-font);
  max-width: 1800px;
  margin: 0 auto;
  padding: 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  color: var(--yt-text);
}

@media (min-width: 1024px) {
  .vp-page {
    flex-direction: row;
    gap: 24px;
    padding: 0 24px 24px;
  }
}

.vp-main {
  flex: 1;
  min-width: 0;
  max-width: 1100px;
}

/* ========== VIDEO PLAYER ========== */
.vp-player-wrap {
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 12px;
  aspect-ratio: 16 / 9;
  background: #000;
  margin-left: -24px;
  margin-right: -24px;
}

@media (min-width: 640px) {
  .vp-player-wrap {
    border-radius: var(--yt-radius);
    margin-left: 0;
    margin-right: 0;
  }
}

.vp-player-wrap iframe,
.vp-player-wrap video,
.vp-player-wrap .video-js {
  width: 100%;
  height: 100%;
  display: block;
}

/* ========== PLAYLIST BAR ========== */
.vp-playlist-bar {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--yt-surface);
  border-radius: var(--yt-radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vp-playlist-bar .pl-info {
  font-size: 14px;
  color: var(--yt-text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vp-playlist-bar .pl-label {
  font-weight: 500;
  color: var(--yt-text);
}

.vp-playlist-bar a {
  color: var(--yt-blue);
  text-decoration: none;
}

.vp-playlist-bar a:hover {
  text-decoration: underline;
}

.vp-playlist-bar .pl-count {
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}

.pl-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pl-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--yt-text);
  transition: background var(--yt-transition);
  text-decoration: none;
}

.pl-nav-btn:hover {
  background: var(--yt-pill-hover);
}

.pl-nav-btn.disabled {
  color: var(--yt-text-muted);
  cursor: default;
  pointer-events: none;
}

/* ========== TITLE ========== */
.vp-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  margin: 0 0 12px 0;
  color: var(--yt-text);
}

/* ========== CHANNEL + ACTIONS ROW ========== */
/* YouTube stacks channel info and action buttons on one row */
.vp-channel-actions-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .vp-channel-actions-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Channel group (avatar + name + subscribe) */
.vp-channel-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.vp-avatar-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.vp-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.vp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.vp-avatar-deco {
  position: absolute;
  pointer-events: none;
  user-select: none;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  transform-origin: center;
}

.vp-channel-text {
  min-width: 0;
}

.vp-channel-text a {
  text-decoration: none;
  color: inherit;
}

.vp-channel-name {
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  color: var(--yt-text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.vp-channel-name:hover {
  color: var(--yt-text-secondary);
}

.vp-channel-handle {
  font-size: 12px;
  color: var(--yt-text-muted);
  line-height: 18px;
}

/* Subscribe / Follow button - YouTube's signature pill btn */
.vp-subscribe-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 36px;
  border-radius: var(--yt-radius-full);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--yt-transition);
  font-family: inherit;
}

.vp-subscribe-btn--follow {
  background: var(--yt-subscribe);
  color: var(--yt-subscribe-text);
}

.vp-subscribe-btn--follow:hover {
  opacity: 0.85;
}

.vp-subscribe-btn--following {
  background: var(--yt-pill-bg);
  color: var(--yt-text);
}

.vp-subscribe-btn--following:hover {
  background: var(--yt-pill-hover);
}

.vp-subscribe-btn .material-icons {
  font-size: 18px;
}

/* Edit button (for own videos) */
.vp-edit-link {
  text-decoration: none;
}

/* Action buttons row (right side: like, share, save, etc.) */
.vp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* YouTube-style pill action button */
.vp-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 36px;
  border-radius: var(--yt-radius-full);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  background: var(--yt-pill-bg);
  color: var(--yt-text);
  transition: background var(--yt-transition);
  white-space: nowrap;
  font-family: inherit;
}

.vp-pill-btn:hover {
  background: var(--yt-pill-hover);
}

.vp-pill-btn .material-icons {
  font-size: 20px;
}

.vp-pill-btn .hide-mobile {
  display: none;
}

@media (min-width: 640px) {
  .vp-pill-btn .hide-mobile {
    display: inline;
  }
}

/* Like/dislike combo (YouTube segmented pill) */
.vp-rating-group {
  display: inline-flex;
  border-radius: var(--yt-radius-full);
  overflow: hidden;
  background: var(--yt-pill-bg);
}

.vp-rate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 36px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  color: var(--yt-text);
  transition: background var(--yt-transition);
  position: relative;
  font-family: inherit;
}

.vp-rate-btn:hover {
  background: var(--yt-pill-hover);
}

/* Divider between grouped pills */
.vp-rate-btn+.vp-rate-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background: var(--yt-border);
}

.vp-rate-btn .material-icons {
  font-size: 20px;
}

.vp-rate-btn .rate-label {
  display: none;
}

@media (min-width: 640px) {
  .vp-rate-btn .rate-label {
    display: inline;
  }
}

.vp-rate-btn .rate-count {
  font-variant-numeric: tabular-nums;
}

/* Rated highlight states */
.vp-rate-btn.rated-audio {
  color: var(--yt-blue);
}

.vp-rate-btn.rated-visual {
  color: var(--yt-green);
}

.vp-rate-btn.rated-idea {
  color: var(--yt-yellow);
}

/* Sparkle */
.rate-sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  opacity: .8;
  animation: sparkle-pop .5s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}

@keyframes sparkle-pop {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(var(--dx), var(--dy)) scale(0);
    opacity: 0;
  }
}

/* Dropdown menus (share / more) */
.vp-dropdown-wrap {
  position: relative;
}

.vp-dropdown {
  position: absolute;
  z-index: 30;
  margin-top: 8px;
  width: 240px;
  background: var(--yt-surface);
  border-radius: var(--yt-radius);
  box-shadow: 0 4px 32px rgba(0, 0, 0, .4);
  right: 0;
  padding: 8px 0;
  transform-origin: top right;
}

.vp-dropdown.hidden {
  display: none;
}

.vp-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  background: none;
  color: var(--yt-text);
  transition: background var(--yt-transition);
  font-family: inherit;
}

.vp-dropdown-item:hover {
  background: var(--yt-pill-hover);
}

.vp-dropdown-item .material-icons {
  font-size: 20px;
  color: var(--yt-text-secondary);
}

.vp-dropdown-item--danger {
  color: var(--yt-red);
}

.vp-dropdown-item--danger .material-icons {
  color: var(--yt-red);
}

/* ========== MULTI-AUTHOR ========== */
.vp-multi-authors .author-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text-secondary);
  margin-bottom: 8px;
}

.vp-avatar-stack {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.vp-avatar-stack a {
  margin-left: -10px;
  position: relative;
  display: block;
}

.vp-avatar-stack a:first-child {
  margin-left: 0;
}

.vp-avatar-stack a>img:first-child {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--yt-bg);
  transition: transform var(--yt-transition);
}

.vp-avatar-stack a:hover>img:first-child {
  transform: scale(1.15);
  z-index: 10;
}

.vp-author-names {
  font-size: 14px;
  color: var(--yt-text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vp-author-names a {
  font-weight: 500;
  text-decoration: none;
  color: inherit;
}

.vp-author-names a:hover {
  color: var(--yt-blue);
}

.vp-multi-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 8px;
}

@media (min-width: 640px) {
  .vp-multi-right {
    flex-direction: row;
    align-items: center;
    margin-top: 0;
  }
}

/* ========== TAGS ========== */
.vp-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.vp-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--yt-radius-full);
  white-space: nowrap;
  transition: background var(--yt-transition);
  text-decoration: none;
  background: var(--yt-pill-bg);
  color: var(--yt-blue);
}

.vp-tag:hover {
  background: var(--yt-pill-hover);
}

.vp-tag--source {
  color: #ff7b72;
}

.vp-tag--char {
  color: #79c0ff;
}

/* Character Tag with protruding image — image breaks out of the left side of the pill */
.vp-tags {
  overflow: visible;
}

.vp-tag--char-img {
  position: relative;
  overflow: visible;
  padding-left: 44px;
  color: #79c0ff;
}

.vp-tag-char-img {
  position: absolute;
  left: -8px;
  bottom: 0;
  width: 52px;
  height: 40px;
  object-fit: cover;
  object-position: top center;
  clip-path: inset(0 0 0 0);
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  z-index: 1;
  transition: transform 0.2s ease;
  transform: scale(1.3);
  transform-origin: bottom center;
}

.vp-tag--char-img:hover .vp-tag-char-img {
  transform: scale(1.4) translateY(-2px);
}

.vp-tag--char-img span {
  position: relative;
  z-index: 2;
}

@media (min-width: 640px) {
  .vp-tag--char-img {
    padding-left: 48px;
  }

  .vp-tag-char-img {
    left: -10px;
    width: 56px;
    height: 44px;
  }
}

.vp-tag--normal,
.vp-tag--fixed {
  color: var(--yt-blue);
}

.vp-tag .tag-link {
  flex-grow: 1;
  text-decoration: none;
  color: inherit;
}

.vp-tag-remove {
  margin-left: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--yt-text-muted);
  transition: color var(--yt-transition);
  display: flex;
}

.vp-tag-remove:hover {
  color: var(--yt-text);
}

.vp-tag-add-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--yt-pill-bg);
  color: var(--yt-text-secondary);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: background var(--yt-transition);
}

.vp-tag-add-btn:hover {
  background: var(--yt-pill-hover);
}

/* Tag add section */
.vp-add-tag-section {
  margin-bottom: 16px;
  overflow: hidden;
  transition: max-height .3s ease, opacity .3s ease;
  max-height: 0;
  opacity: 0;
}

.vp-add-tag-section.open {
  max-height: 200px;
  opacity: 1;
}

.vp-add-tag-form {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.vp-add-tag-form .tag-input-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

.vp-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  background: var(--yt-bg);
  color: var(--yt-text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--yt-transition);
}

.vp-input:focus {
  outline: none;
  border-color: var(--yt-blue);
}

.vp-tag-suggestions {
  position: fixed;
  z-index: 9999;
  margin-top: 4px;
  background: var(--yt-surface);
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
  font-size: 14px;
  max-height: 200px;
  overflow-y: auto;
}

.vp-tag-suggestions.hidden {
  display: none;
}

.vp-tag-suggestions .sug-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--yt-text);
}

.vp-tag-suggestions .sug-item:hover {
  background: var(--yt-pill-hover);
}

/* ========== DESCRIPTION BOX (YouTube-style card) ========== */
.vp-desc-card {
  background: var(--yt-surface);
  border-radius: var(--yt-radius);
  padding: 12px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: background var(--yt-transition);
}

.vp-desc-card:hover {
  background: var(--yt-surface-hover);
}

.vp-desc-stats {
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vp-desc-stats span {
  white-space: nowrap;
}

.vp-desc-container {
  position: relative;
  max-height: 68px;
  overflow: hidden;
  transition: max-height .3s ease;
}

.vp-desc-container.expanded {
  max-height: 5000px;
}

.vp-desc-text {
  font-size: 14px;
  color: var(--yt-text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 20px;
}

.vp-desc-empty {
  font-size: 14px;
  color: var(--yt-text-muted);
  text-align: center;
  padding: 8px 0;
}

.vp-desc-fade {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(to top, var(--yt-surface), transparent);
  pointer-events: none;
}

.vp-desc-fade.visible {
  display: block;
}

.vp-desc-toggle {
  display: none;
  margin-top: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--yt-text-muted);
  font-weight: 600;
  padding: 0;
  font-family: inherit;
}

.vp-desc-toggle:hover {
  color: var(--yt-text);
}

.vp-desc-toggle.visible {
  display: inline;
}

.vp-desc-meta {
  margin-top: 12px;
  font-size: 12px;
  color: var(--yt-text-muted);
}

/* ========== EVENT VOTE ========== */
.vp-event {
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(255, 214, 0, 0.08);
  border: 1px solid rgba(255, 214, 0, 0.3);
  border-radius: var(--yt-radius);
}

.vp-event h3 {
  font-weight: 600;
  font-size: 16px;
  color: var(--yt-yellow);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vp-event .voted-msg {
  text-align: center;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--yt-text-secondary);
}

.vp-event textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  background: var(--yt-bg);
  color: var(--yt-text);
  margin-bottom: 12px;
  resize: vertical;
  font-family: inherit;
}

.vp-event textarea:focus {
  outline: none;
  border-color: var(--yt-blue);
}

.vp-event .login-prompt {
  padding: 12px;
  background: var(--yt-surface);
  border-radius: 8px;
  text-align: center;
  color: var(--yt-text-secondary);
  font-size: 14px;
}

.vp-event .login-prompt a {
  color: var(--yt-blue);
  text-decoration: none;
}

.vp-event .login-prompt a:hover {
  text-decoration: underline;
}

/* ========== YouTube Notice ========== */
.vp-yt-notice {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--yt-surface);
  border-radius: var(--yt-radius);
}

.vp-yt-notice p {
  font-size: 12px;
  color: var(--yt-text-muted);
  text-align: center;
  line-height: 1.6;
}

.vp-yt-notice a {
  color: var(--yt-blue);
  text-decoration: none;
}

.vp-yt-notice a:hover {
  text-decoration: underline;
}

/* ========== COMMENTS (YouTube-style) ========== */
.vp-comments {
  margin-bottom: 24px;
}

.vp-comments h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--yt-text);
}

.vp-comments h2 .count {
  font-weight: 400;
  color: var(--yt-text-secondary);
  font-size: 16px;
}

/* Comment input (YouTube: avatar on left, text input below) */
.vp-comment-form {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 32px;
}

.vp-comment-form .form-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  display: none;
}

@media (min-width: 640px) {
  .vp-comment-form .form-avatar {
    display: block;
  }
}

.vp-comment-form .form-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vp-comment-form textarea {
  width: 100%;
  padding: 4px 0;
  border: none;
  border-bottom: 1px solid var(--yt-border);
  background: transparent;
  color: var(--yt-text);
  font-size: 14px;
  resize: none;
  font-family: inherit;
  line-height: 20px;
}

.vp-comment-form textarea:focus {
  outline: none;
  border-bottom-color: var(--yt-text);
  border-bottom-width: 2px;
}

.vp-comment-form textarea::placeholder {
  color: var(--yt-text-muted);
}

.vp-comment-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.vp-login-prompt {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--yt-surface);
  border-radius: var(--yt-radius);
  font-size: 14px;
  color: var(--yt-text-muted);
  text-align: center;
}

.vp-login-prompt a {
  color: var(--yt-blue);
  text-decoration: none;
}

.vp-login-prompt a:hover {
  text-decoration: underline;
}

/* Comment list */
.vp-comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vp-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.vp-comment-item.advert {
  background: rgba(255, 140, 0, 0.06);
  border-radius: var(--yt-radius);
  padding: 12px;
  border-left: 3px solid var(--yt-orange);
}

.vp-comment-item.support {
  background: rgba(62, 166, 255, 0.06);
  border-radius: var(--yt-radius);
  padding: 12px;
  border-left: 3px solid var(--yt-blue);
}

.vp-comment-avatar {
  flex-shrink: 0;
  position: relative;
  width: 40px;
  height: 40px;
  display: block;
  text-decoration: none;
}

.vp-comment-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.vp-comment-body {
  flex: 1;
  min-width: 0;
}

.vp-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.vp-comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vp-comment-meta .author {
  font-weight: 500;
  font-size: 13px;
  color: var(--yt-text);
  text-decoration: none;
}

.vp-comment-meta .author:hover {
  color: var(--yt-text-secondary);
}

.vp-comment-meta .timestamp {
  font-size: 12px;
  color: var(--yt-text-muted);
}

.vp-comment-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--yt-text-muted);
  padding: 4px;
  border-radius: 50%;
  display: flex;
  transition: background var(--yt-transition);
}

.vp-comment-delete:hover {
  background: var(--yt-pill-hover);
  color: var(--yt-red);
}

.vp-comment-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.vp-comment-badge.advert-badge {
  background: rgba(255, 140, 0, .2);
  color: var(--yt-orange);
}

.vp-comment-badge.support-badge {
  background: rgba(62, 166, 255, .2);
  color: var(--yt-blue);
}

.vp-comment-text {
  font-size: 14px;
  color: var(--yt-text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 20px;
}

.vp-comment-text.advert-text {
  color: var(--yt-orange);
}

.vp-comment-text.support-text {
  color: var(--yt-blue);
}

.vp-comment-empty {
  text-align: center;
  color: var(--yt-text-muted);
  padding: 24px 0;
  font-size: 14px;
}

/* ========== SIDEBAR ========== */
.vp-sidebar {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1024px) {
  .vp-sidebar {
    width: 402px;
  }
}

/* Ad card */
.vp-ad-card {
  background: var(--yt-surface);
  padding: 12px;
  border-radius: var(--yt-radius);
  border: 1px solid rgba(255, 140, 0, .2);
}

.vp-ad-card .ad-label {
  font-size: 12px;
  text-align: center;
  color: var(--yt-orange);
  font-weight: 500;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.vp-ad-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.vp-ad-inner {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.vp-ad-thumb {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  transition: opacity var(--yt-transition);
}

.vp-ad-card a:hover .vp-ad-thumb {
  opacity: .85;
}

.vp-ad-info {
  flex: 1;
  min-width: 0;
}

.vp-ad-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
  line-height: 20px;
}

.vp-ad-meta {
  font-size: 12px;
  color: var(--yt-text-muted);
  margin-bottom: 2px;
}

.vp-ad-points {
  font-size: 12px;
  color: var(--yt-orange);
  font-weight: 600;
}

.vp-ad-comment {
  background: var(--yt-pill-bg);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 4px;
}

.vp-ad-comment p {
  font-size: 12px;
  color: var(--yt-text-secondary);
  font-style: italic;
}

/* Shinobi ad */
.vp-shinobi-ad {
  background: var(--yt-surface);
  padding: 12px;
  border-radius: var(--yt-radius);
}

.vp-shinobi-ad .ad-small-label {
  font-size: 11px;
  text-align: center;
  color: var(--yt-text-muted);
  margin-bottom: 8px;
}

.vp-shinobi-ad .admax-container {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar playlist */
.vp-sidebar-playlist {
  background: var(--yt-surface);
  border-radius: var(--yt-radius);
  overflow: hidden;
}

.vp-sidebar-pl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
}

.vp-sidebar-pl-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--yt-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vp-sidebar-pl-header .pl-pos {
  font-size: 12px;
  color: var(--yt-text-muted);
}

.vp-sidebar-pl-list {
  display: flex;
  flex-direction: column;
  max-height: 360px;
  overflow-y: auto;
}

.vp-sidebar-pl-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  text-decoration: none;
  color: inherit;
  transition: background var(--yt-transition);
}

.vp-sidebar-pl-item:hover {
  background: var(--yt-pill-hover);
}

.vp-sidebar-pl-item.current {
  background: var(--yt-pill-bg);
}

.vp-sidebar-pl-item .pl-num {
  font-size: 12px;
  color: var(--yt-text-muted);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.vp-sidebar-pl-item img {
  width: 100px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.vp-sidebar-pl-item .pl-item-info {
  flex: 1;
  min-width: 0;
}

.vp-sidebar-pl-item .pl-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 20px;
}

.vp-sidebar-pl-item .pl-item-author {
  font-size: 12px;
  color: var(--yt-text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== RECOMMENDED VIDEOS (YouTube layout) ========== */
.vp-rec-heading {
  font-size: 16px;
  font-weight: 500;
  color: var(--yt-text);
  margin-bottom: 8px;
}

.vp-rec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vp-rec-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  transition: background var(--yt-transition);
}

.vp-rec-item:hover {
  background: var(--yt-pill-hover);
}

.vp-rec-item img {
  width: 168px;
  height: 94px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.vp-rec-info {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
}

.vp-rec-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 20px;
  margin-bottom: 4px;
}

.vp-rec-author {
  font-size: 12px;
  color: var(--yt-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vp-rec-views {
  font-size: 12px;
  color: var(--yt-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.vp-rec-empty {
  font-size: 14px;
  color: var(--yt-text-muted);
  text-align: center;
  padding: 24px 0;
}

.vp-beta-notice {
  padding: 12px;
  background: var(--yt-surface);
  border-radius: var(--yt-radius);
}

.vp-beta-notice p {
  font-size: 12px;
  color: var(--yt-text-muted);
  text-align: center;
  line-height: 1.6;
}

.vp-beta-notice a {
  color: var(--yt-blue);
  text-decoration: none;
}

.vp-beta-notice a:hover {
  text-decoration: underline;
}

/* ========== MODALS ========== */
.vp-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.vp-modal.open {
  display: flex;
}

.vp-modal-overlay {
  position: absolute;
  inset: 0;
  background: var(--yt-overlay);
  backdrop-filter: blur(4px);
}

.vp-modal-content {
  position: relative;
  width: 100%;
  max-width: 448px;
  background: var(--yt-surface);
  border-radius: var(--yt-radius);
  box-shadow: 0 8px 48px rgba(0, 0, 0, .5);
  overflow: hidden;
  animation: modal-in .2s ease-out;
}

@keyframes modal-in {
  from {
    transform: scale(.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.vp-modal-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vp-modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--yt-text);
}

.vp-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--yt-text-muted);
  padding: 4px;
  border-radius: 50%;
  display: flex;
  transition: background var(--yt-transition);
}

.vp-modal-close:hover {
  background: var(--yt-pill-hover);
  color: var(--yt-text);
}

.vp-modal-body {
  padding: 0 24px 20px;
}

.vp-modal-footer {
  padding: 16px 24px;
  background: var(--yt-bg);
  border-top: 1px solid var(--yt-border);
}

.vp-modal-body label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text-secondary);
  margin-bottom: 8px;
}

.vp-modal-body input[type="number"],
.vp-modal-body input[type="text"],
.vp-modal-body textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  background: var(--yt-bg);
  color: var(--yt-text);
  font-family: inherit;
}

.vp-modal-body input:focus,
.vp-modal-body textarea:focus {
  outline: none;
  border-color: var(--yt-blue);
}

.vp-modal-body .hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--yt-text-muted);
}

/* Playlist modal list */
.vp-pl-modal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.vp-pl-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  transition: background var(--yt-transition);
}

.vp-pl-modal-item:hover {
  background: var(--yt-pill-hover);
}

.vp-pl-modal-item label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.vp-pl-modal-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--yt-blue);
}

.vp-pl-modal-item .pl-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vp-pl-modal-item .pl-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  color: var(--yt-text-muted);
  display: flex;
  transition: all var(--yt-transition);
}

.vp-pl-modal-item .pl-del-btn:hover {
  color: var(--yt-red);
  background: var(--yt-pill-hover);
}

.vp-new-pl-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vp-points-display {
  font-weight: 700;
  color: var(--yt-orange);
}

/* ========== BUTTONS (YouTube pill) ========== */
.vp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  height: 36px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--yt-radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--yt-transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.vp-btn--primary {
  background: var(--yt-blue);
  color: #000;
}

.vp-btn--primary:hover {
  opacity: .85;
}

.vp-btn--secondary {
  background: var(--yt-pill-bg);
  color: var(--yt-text);
}

.vp-btn--secondary:hover {
  background: var(--yt-pill-hover);
}

.vp-btn--danger {
  background: rgba(255, 78, 69, .15);
  color: var(--yt-red);
}

.vp-btn--danger:hover {
  background: rgba(255, 78, 69, .25);
}

.vp-btn--orange {
  background: var(--yt-orange);
  color: #000;
}

.vp-btn--orange:hover {
  opacity: .85;
}

.vp-btn--full {
  width: 100%;
}

.vp-btn--lg {
  height: 40px;
  font-weight: 600;
}

.vp-btn--sm {
  font-size: 12px;
  height: 32px;
  padding: 0 12px;
}

/* ========== UTILITY ========== */
.hidden {
  display: none !important;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shield-icon {
  font-size: 16px;
  color: var(--yt-yellow);
  vertical-align: middle;
}

.shield-icon-sm {
  font-size: 14px;
}

.spin {
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.vp-loader {
  text-align: center;
  padding: 32px 0;
  color: var(--yt-text-muted);
}

.vp-loader .material-icons {
  font-size: 32px;
}

/* Alert toasts */
.vp-alert-container {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: auto;
  max-width: 480px;
}

.vp-alert {
  padding: 12px 24px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 14px;
  background: var(--yt-surface);
  color: var(--yt-text);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
  transition: all .3s ease;
  transform: translateY(8px);
  opacity: 0;
}

.vp-alert.show {
  transform: translateY(0);
  opacity: 1;
}

.vp-alert.success {
  border-left: 4px solid var(--yt-green);
}

.vp-alert.error {
  border-left: 4px solid var(--yt-red);
}

.vp-alert.info {
  border-left: 4px solid var(--yt-blue);
}

/* ========== Scrollbar (YouTube-style) ========== */
.vp-page ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.vp-page ::-webkit-scrollbar-track {
  background: transparent;
}

.vp-page ::-webkit-scrollbar-thumb {
  background: var(--yt-surface-light);
  border-radius: 4px;
}

.vp-page ::-webkit-scrollbar-thumb:hover {
  background: var(--yt-text-muted);
}