/* ==========================================================================
   YTClone Theme — Main Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Sizing */
  --ytc-header-height: 56px;
  --ytc-sidebar-width-full: 240px;
  --ytc-sidebar-width-mini: 72px;
  --ytc-max-content: 1280px;

  /* Border radius */
  --ytc-radius-sm: 2px;
  --ytc-radius-md: 8px;
  --ytc-radius-lg: 12px;
  --ytc-radius-full: 9999px;

  /* Typography */
  --ytc-font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ytc-font-size-xs: 11px;
  --ytc-font-size-sm: 12px;
  --ytc-font-size-base: 14px;
  --ytc-font-size-md: 15px;
  --ytc-font-size-lg: 16px;
  --ytc-font-size-xl: 20px;
  --ytc-font-size-2xl: 24px;

  /* Transitions */
  --ytc-transition: 0.2s ease;
}

/* Dark theme (default) */
[data-theme="dark"],
:root {
  --ytc-bg: #0f0f0f;
  --ytc-bg-2: #1a1a1a;
  --ytc-bg-3: #272727;
  --ytc-bg-hover: #3d3d3d;
  --ytc-surface: #212121;
  --ytc-surface-2: #2d2d2d;
  --ytc-border: #3d3d3d;
  --ytc-text: #f1f1f1;
  --ytc-text-secondary: #aaa;
  --ytc-text-muted: #717171;
  --ytc-text-link: #3ea6ff;
  --ytc-primary: #ff0000;
  --ytc-primary-hover: #cc0000;
  --ytc-subscribe-bg: #ff0000;
  --ytc-subscribe-text: #fff;
  --ytc-subscribe-subscribed-bg: #272727;
  --ytc-subscribe-subscribed-text: #f1f1f1;
  --ytc-icon-color: #f1f1f1;
  --ytc-chip-bg: #272727;
  --ytc-chip-text: #f1f1f1;
  --ytc-chip-active-bg: #f1f1f1;
  --ytc-chip-active-text: #0f0f0f;
  --ytc-header-bg: #0f0f0f;
  --ytc-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --ytc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --ytc-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --ytc-overlay: rgba(0, 0, 0, 0.7);
  --ytc-input-bg: #121212;
  --ytc-input-border: #3d3d3d;
  --ytc-input-focus: #1a73e8;
  --ytc-like-active: #3ea6ff;
  --ytc-duration-bg: rgba(0, 0, 0, 0.8);
}

/* Light theme */
[data-theme="light"] {
  --ytc-bg: #f9f9f9;
  --ytc-bg-2: #ffffff;
  --ytc-bg-3: #f2f2f2;
  --ytc-bg-hover: #e5e5e5;
  --ytc-surface: #ffffff;
  --ytc-surface-2: #f2f2f2;
  --ytc-border: #e0e0e0;
  --ytc-text: #0f0f0f;
  --ytc-text-secondary: #606060;
  --ytc-text-muted: #909090;
  --ytc-text-link: #065fd4;
  --ytc-primary: #ff0000;
  --ytc-primary-hover: #cc0000;
  --ytc-subscribe-bg: #0f0f0f;
  --ytc-subscribe-text: #fff;
  --ytc-subscribe-subscribed-bg: #f2f2f2;
  --ytc-subscribe-subscribed-text: #0f0f0f;
  --ytc-icon-color: #0f0f0f;
  --ytc-chip-bg: #f2f2f2;
  --ytc-chip-text: #0f0f0f;
  --ytc-chip-active-bg: #0f0f0f;
  --ytc-chip-active-text: #fff;
  --ytc-header-bg: #ffffff;
  --ytc-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  --ytc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --ytc-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --ytc-overlay: rgba(0, 0, 0, 0.5);
  --ytc-input-bg: #ffffff;
  --ytc-input-border: #ccc;
  --ytc-input-focus: #1a73e8;
  --ytc-like-active: #065fd4;
  --ytc-duration-bg: rgba(0, 0, 0, 0.8);
}

/* --------------------------------------------------------------------------
   Reset / Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--ytc-font-size-base);
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ytc-font);
  background-color: var(--ytc-bg);
  color: var(--ytc-text);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

ul,
ol {
  list-style: none;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--ytc-input-focus);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   SVG Icons
   -------------------------------------------------------------------------- */
.ytc-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

.ytc-icon-xs  { width: 14px; height: 14px; }
.ytc-icon-sm  { width: 16px; height: 16px; }
.ytc-icon-md  { width: 24px; height: 24px; }
.ytc-icon-lg  { width: 40px; height: 40px; }
.ytc-icon-xl  { width: 64px; height: 64px; }
.ytc-icon-404 { width: 96px; height: 96px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.ytc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--ytc-header-height);
  background: var(--ytc-header-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 8px;
  border-bottom: 1px solid transparent;
}

[data-theme="light"] .ytc-header {
  border-bottom-color: var(--ytc-border);
}

/* Left */
.ytc-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 164px;
}

/* Center */
.ytc-header-center {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 640px;
  gap: 8px;
}

/* Right */
.ytc-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Icon button base */
.ytc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ytc-icon-color);
  transition: background var(--ytc-transition);
  position: relative;
}

.ytc-icon-btn:hover {
  background: var(--ytc-bg-hover);
}

/* Logo */
.ytc-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ytc-text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.ytc-logo-svg {
  width: 90px;
  height: 20px;
}

.ytc-logo-img {
  height: 28px;
  width: auto;
}

.ytc-logo-text {
  font-size: 18px;
  font-weight: 700;
}

/* Search */
.ytc-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

.ytc-search-form {
  display: flex;
  align-items: center;
  flex: 1;
  height: 40px;
}

.ytc-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  border: 1px solid var(--ytc-input-border);
  border-right: none;
  border-radius: var(--ytc-radius-full) 0 0 var(--ytc-radius-full);
  background: var(--ytc-input-bg);
  height: 100%;
  overflow: hidden;
  transition: border-color var(--ytc-transition);
}

.ytc-search-input-wrap:focus-within {
  border-color: var(--ytc-input-focus);
}

.ytc-search-input {
  flex: 1;
  padding: 0 12px;
  height: 100%;
  background: transparent;
  color: var(--ytc-text);
  font-size: var(--ytc-font-size-md);
  caret-color: var(--ytc-input-focus);
}

.ytc-search-input::placeholder {
  color: var(--ytc-text-muted);
}

.ytc-search-clear {
  width: 32px;
  height: 32px;
}

.ytc-search-btn {
  width: 64px;
  height: 100%;
  background: var(--ytc-bg-3);
  border: 1px solid var(--ytc-input-border);
  border-left: none;
  border-radius: 0 var(--ytc-radius-full) var(--ytc-radius-full) 0;
  color: var(--ytc-icon-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ytc-transition);
  flex-shrink: 0;
}

.ytc-search-btn:hover {
  background: var(--ytc-bg-hover);
}

/* Search suggestions */
.ytc-search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 64px;
  background: var(--ytc-surface);
  border: 1px solid var(--ytc-border);
  border-radius: var(--ytc-radius-md);
  box-shadow: var(--ytc-shadow-md);
  z-index: 200;
  overflow: hidden;
}

.ytc-search-suggestions li {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--ytc-font-size-base);
}

.ytc-search-suggestions li:hover {
  background: var(--ytc-bg-hover);
}

/* Sign in button */
.ytc-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--ytc-input-focus);
  border-radius: var(--ytc-radius-full);
  color: var(--ytc-text-link);
  font-size: var(--ytc-font-size-base);
  font-weight: 500;
  transition: background var(--ytc-transition);
  white-space: nowrap;
}

.ytc-signin-btn:hover {
  background: rgba(62, 166, 255, 0.1);
}

/* Notification badge */
.ytc-notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--ytc-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

/* User avatar small */
.ytc-user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* User dropdown */
.ytc-user-menu-wrap {
  position: relative;
}

.ytc-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--ytc-surface);
  border: 1px solid var(--ytc-border);
  border-radius: var(--ytc-radius-md);
  box-shadow: var(--ytc-shadow-md);
  z-index: 200;
  overflow: hidden;
}

.ytc-user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--ytc-border);
}

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

.ytc-dropdown-name {
  display: block;
  font-weight: 500;
  font-size: var(--ytc-font-size-base);
}

.ytc-dropdown-email {
  display: block;
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
}

.ytc-dropdown-items li a {
  display: block;
  padding: 12px 16px;
  font-size: var(--ytc-font-size-base);
  transition: background var(--ytc-transition);
}

.ytc-dropdown-items li a:hover {
  background: var(--ytc-bg-hover);
}

.ytc-dropdown-divider {
  height: 1px;
  background: var(--ytc-border);
  margin: 4px 0;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.ytc-layout {
  display: flex;
  padding-top: var(--ytc-header-height);
  min-height: 100vh;
  position: relative;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.ytc-sidebar {
  position: fixed;
  top: var(--ytc-header-height);
  left: 0;
  bottom: 0;
  z-index: 90;
  background: var(--ytc-bg);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--ytc-transition), transform var(--ytc-transition);
  scrollbar-width: thin;
}

.ytc-sidebar-full {
  width: var(--ytc-sidebar-width-full);
}

.ytc-sidebar-mini {
  width: var(--ytc-sidebar-width-mini);
}

.ytc-sidebar-hidden {
  width: 0;
  transform: translateX(-100%);
}

.ytc-sidebar-inner {
  padding: 12px 0;
  min-height: 100%;
}

/* Sidebar nav */
.ytc-sidebar-nav {
  padding: 0;
}

.ytc-sidebar-item {
  border-radius: var(--ytc-radius-md);
  overflow: hidden;
}

.ytc-sidebar-link {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 12px;
  height: 40px;
  border-radius: var(--ytc-radius-md);
  color: var(--ytc-text);
  font-size: var(--ytc-font-size-base);
  font-weight: 400;
  transition: background var(--ytc-transition);
  white-space: nowrap;
  overflow: hidden;
}

.ytc-sidebar-link:hover {
  background: var(--ytc-bg-hover);
}

.ytc-sidebar-item.ytc-active .ytc-sidebar-link {
  background: var(--ytc-bg-3);
  font-weight: 500;
}

.ytc-sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--ytc-icon-color);
}

.ytc-sidebar-label {
  transition: opacity var(--ytc-transition), width var(--ytc-transition);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mini sidebar: hide labels */
.ytc-sidebar-mini .ytc-sidebar-label,
.ytc-sidebar-mini .ytc-sidebar-section-title,
.ytc-sidebar-mini .ytc-sidebar-copyright,
.ytc-sidebar-mini .ytc-sidebar-full-only {
  display: none;
}

.ytc-sidebar-mini .ytc-sidebar-link {
  justify-content: center;
  padding: 0;
  gap: 0;
  height: 56px;
  flex-direction: column;
}

.ytc-sidebar-mini .ytc-sidebar-link::after {
  content: attr(data-label);
  font-size: 10px;
  margin-top: 4px;
}

/* Sidebar section */
.ytc-sidebar-section {
  padding: 4px 0;
}

.ytc-sidebar-section-title {
  font-size: var(--ytc-font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ytc-text-secondary);
  padding: 4px 20px;
  margin-bottom: 4px;
}

.ytc-sidebar-divider {
  height: 1px;
  background: var(--ytc-border);
  margin: 12px 0;
}

.ytc-sidebar-text-link {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  height: 28px;
}

.ytc-sidebar-copyright {
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-muted);
  padding: 8px 20px 4px;
}

/* Sidebar overlay (mobile) */
.ytc-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--ytc-overlay);
  z-index: 89;
}

/* Subscriptions in sidebar */
.ytc-sidebar-subscriptions {
  padding: 0 12px;
}

.ytc-sidebar-sub-channel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 8px;
  border-radius: var(--ytc-radius-md);
  transition: background var(--ytc-transition);
}

.ytc-sidebar-sub-channel:hover {
  background: var(--ytc-bg-hover);
}

.ytc-sidebar-sub-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.ytc-sidebar-loading {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-muted);
  padding: 8px 20px;
}

/* --------------------------------------------------------------------------
   Main content area
   -------------------------------------------------------------------------- */
.ytc-main {
  flex: 1;
  min-width: 0;
  padding-top: 24px;
  margin-left: var(--ytc-sidebar-width-full);
  transition: margin-left var(--ytc-transition);
}

.ytc-sidebar-mini  ~ .ytc-main { margin-left: var(--ytc-sidebar-width-mini); }
.ytc-sidebar-hidden ~ .ytc-main { margin-left: 0; }

/* --------------------------------------------------------------------------
   Category Chips
   -------------------------------------------------------------------------- */
.ytc-chips-row {
  position: sticky;
  top: var(--ytc-header-height);
  z-index: 50;
  background: var(--ytc-bg);
  padding: 12px 24px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ytc-chips-wrap {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  padding-bottom: 12px;
}

.ytc-chips-wrap::-webkit-scrollbar { display: none; }

.ytc-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--ytc-radius-full);
  background: var(--ytc-chip-bg);
  color: var(--ytc-chip-text);
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--ytc-transition), color var(--ytc-transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.ytc-chip:hover {
  background: var(--ytc-bg-hover);
}

.ytc-chip-active {
  background: var(--ytc-chip-active-bg) !important;
  color: var(--ytc-chip-active-text) !important;
}

/* --------------------------------------------------------------------------
   Video Grid
   -------------------------------------------------------------------------- */
.ytc-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px 16px;
  padding: 16px 24px 32px;
}

.ytc-col-full {
  grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   Video Card
   -------------------------------------------------------------------------- */
.ytc-video-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.ytc-thumb-wrap {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--ytc-radius-md);
  overflow: hidden;
  background: var(--ytc-bg-3);
}

.ytc-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.ytc-thumb-wrap:hover .ytc-thumb {
  transform: scale(1.05);
}

.ytc-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ytc-text-muted);
}

.ytc-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: var(--ytc-duration-bg);
  color: #fff;
  font-size: var(--ytc-font-size-xs);
  font-weight: 500;
  padding: 1px 4px;
  border-radius: var(--ytc-radius-sm);
  pointer-events: none;
}

.ytc-thumb-hover-preview {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ytc-card-info {
  display: flex;
  gap: 12px;
  padding: 12px 0 4px;
}

.ytc-card-avatar {
  flex-shrink: 0;
  margin-top: 2px;
}

.ytc-card-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.ytc-avatar-placeholder {
  background: var(--ytc-bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ytc-card-meta {
  flex: 1;
  min-width: 0;
}

.ytc-card-title {
  font-size: var(--ytc-font-size-base);
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ytc-card-title a {
  color: var(--ytc-text);
}

.ytc-card-title a:hover {
  color: var(--ytc-text);
}

.ytc-card-channel {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  margin-bottom: 2px;
}

.ytc-card-channel a:hover {
  color: var(--ytc-text);
}

.ytc-card-stats {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
}

.ytc-dot {
  font-size: 10px;
}

.ytc-card-menu {
  flex-shrink: 0;
  align-self: flex-start;
  opacity: 0;
  transition: opacity var(--ytc-transition);
  color: var(--ytc-text-secondary);
}

.ytc-video-card:hover .ytc-card-menu {
  opacity: 1;
}

/* Verified badge */
.ytc-verified {
  display: inline-flex;
  align-items: center;
  color: var(--ytc-text-muted);
}

/* --------------------------------------------------------------------------
   Compact Video Card (sidebar / related)
   -------------------------------------------------------------------------- */
.ytc-video-card-compact {
  display: flex;
  gap: 8px;
  flex-direction: row;
  align-items: flex-start;
  padding: 4px 0;
}

.ytc-compact-thumb-wrap {
  position: relative;
  display: block;
  width: 168px;
  min-width: 168px;
  aspect-ratio: 16 / 9;
  border-radius: var(--ytc-radius-sm);
  overflow: hidden;
  background: var(--ytc-bg-3);
}

.ytc-compact-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ytc-compact-thumb-wrap:hover .ytc-compact-thumb {
  transform: scale(1.04);
}

.ytc-duration-sm {
  font-size: 10px;
}

.ytc-compact-meta {
  flex: 1;
  min-width: 0;
}

.ytc-compact-title {
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.ytc-compact-title a {
  color: var(--ytc-text);
}

.ytc-compact-channel {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-secondary);
  margin-bottom: 2px;
}

.ytc-compact-stats {
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-secondary);
}

/* --------------------------------------------------------------------------
   Watch Page
   -------------------------------------------------------------------------- */
.ytc-watch-layout {
  display: flex;
  gap: 24px;
  padding: 0 24px 40px;
  max-width: var(--ytc-max-content);
  margin: 0 auto;
}

.ytc-watch-primary {
  flex: 1;
  min-width: 0;
  max-width: 854px;
}

.ytc-watch-secondary {
  width: 402px;
  min-width: 280px;
  flex-shrink: 0;
}

/* Player */
.ytc-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--ytc-radius-md);
  overflow: hidden;
}

.ytc-player {
  width: 100%;
  height: 100%;
}

/* Video info */
.ytc-video-info {
  padding: 12px 0 8px;
}

.ytc-video-title {
  font-size: var(--ytc-font-size-xl);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--ytc-text);
}

.ytc-video-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.ytc-video-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
}

/* Actions */
.ytc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ytc-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--ytc-radius-full);
  background: var(--ytc-bg-3);
  color: var(--ytc-text);
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  transition: background var(--ytc-transition);
  height: 36px;
}

.ytc-action-btn:hover {
  background: var(--ytc-bg-hover);
}

/* Like/dislike group */
.ytc-reaction-group {
  display: flex;
  align-items: center;
  background: var(--ytc-bg-3);
  border-radius: var(--ytc-radius-full);
  height: 36px;
  overflow: hidden;
}

.ytc-reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 100%;
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  color: var(--ytc-text);
  transition: background var(--ytc-transition);
}

.ytc-reaction-btn:hover {
  background: var(--ytc-bg-hover);
}

.ytc-reaction-btn[aria-pressed="true"] {
  color: var(--ytc-like-active);
}

.ytc-reaction-divider {
  width: 1px;
  height: 20px;
  background: var(--ytc-border);
}

/* Channel row */
.ytc-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ytc-border);
}

.ytc-channel-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

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

.ytc-channel-text {
  min-width: 0;
}

.ytc-channel-name {
  font-size: var(--ytc-font-size-base);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ytc-subscriber-count {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
}

/* Subscribe button */
.ytc-subscribe-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: var(--ytc-radius-full);
  background: var(--ytc-subscribe-bg);
  color: var(--ytc-subscribe-text);
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  transition: background var(--ytc-transition), color var(--ytc-transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.ytc-subscribe-btn:hover {
  background: var(--ytc-primary-hover);
}

.ytc-subscribe-btn.ytc-subscribed {
  background: var(--ytc-subscribe-subscribed-bg);
  color: var(--ytc-subscribe-subscribed-text);
}

/* Description box */
.ytc-description-box {
  background: var(--ytc-bg-3);
  border-radius: var(--ytc-radius-md);
  padding: 12px;
  margin: 16px 0;
  overflow: hidden;
}

.ytc-description-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  margin-bottom: 8px;
}

.ytc-description-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ytc-tag {
  color: var(--ytc-text-link);
  font-size: var(--ytc-font-size-sm);
}

.ytc-description-text {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text);
  line-height: 1.6;
  max-height: 4.8em;
  overflow: hidden;
  transition: max-height 0.3s ease;
  white-space: pre-wrap;
  word-break: break-word;
}

.ytc-description-box.ytc-expanded .ytc-description-text {
  max-height: none;
}

.ytc-desc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  color: var(--ytc-text);
  padding: 4px 0;
}

.ytc-desc-toggle .ytc-icon {
  transition: transform var(--ytc-transition);
}

.ytc-description-box.ytc-expanded .ytc-desc-toggle .ytc-icon {
  transform: rotate(180deg);
}

/* Autoplay toggle */
.ytc-autoplay-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 12px;
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
}

.ytc-toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.ytc-toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ytc-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--ytc-bg-3);
  border-radius: var(--ytc-radius-full);
  cursor: pointer;
  transition: background var(--ytc-transition);
}

.ytc-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ytc-text-muted);
  top: 3px;
  left: 3px;
  transition: transform var(--ytc-transition), background var(--ytc-transition);
}

.ytc-toggle-input:checked + .ytc-toggle-slider {
  background: var(--ytc-like-active);
}

.ytc-toggle-input:checked + .ytc-toggle-slider::before {
  transform: translateX(18px);
  background: #fff;
}

.ytc-up-next-label {
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  color: var(--ytc-text-secondary);
  padding-bottom: 8px;
}

.ytc-related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Share modal */
.ytc-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ytc-overlay);
}

.ytc-modal-inner {
  background: var(--ytc-surface);
  border-radius: var(--ytc-radius-lg);
  padding: 24px;
  min-width: 320px;
  max-width: 500px;
  width: 90vw;
  box-shadow: var(--ytc-shadow-lg);
}

.ytc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ytc-modal-title {
  font-size: var(--ytc-font-size-lg);
  font-weight: 500;
}

.ytc-share-url-wrap {
  display: flex;
  gap: 8px;
}

.ytc-share-url-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--ytc-input-bg);
  border: 1px solid var(--ytc-border);
  border-radius: var(--ytc-radius-sm);
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text);
}

/* --------------------------------------------------------------------------
   Comments Section
   -------------------------------------------------------------------------- */
.ytc-comments-section {
  padding: 24px 0;
}

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

.ytc-comments-count {
  font-size: var(--ytc-font-size-lg);
  font-weight: 500;
}

.ytc-comments-sort {
  position: relative;
}

.ytc-comments-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--ytc-radius-sm);
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  color: var(--ytc-text);
  transition: background var(--ytc-transition);
}

.ytc-comments-sort-btn:hover {
  background: var(--ytc-bg-hover);
}

.ytc-sort-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--ytc-surface);
  border: 1px solid var(--ytc-border);
  border-radius: var(--ytc-radius-md);
  box-shadow: var(--ytc-shadow-md);
  z-index: 100;
  overflow: hidden;
}

.ytc-sort-option {
  padding: 10px 16px;
  font-size: var(--ytc-font-size-base);
  cursor: pointer;
  transition: background var(--ytc-transition);
}

.ytc-sort-option:hover,
.ytc-sort-option.ytc-sort-active {
  background: var(--ytc-bg-hover);
}

/* Comment form */
.ytc-comment-form-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 32px;
}

.ytc-comment-form-avatar {
  flex-shrink: 0;
}

.ytc-comment-input-wrap {
  flex: 1;
}

.ytc-comment-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ytc-border);
  padding: 8px 0;
  font-size: var(--ytc-font-size-base);
  color: var(--ytc-text);
  resize: none;
  transition: border-color var(--ytc-transition);
  min-height: 36px;
}

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

.ytc-comment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.ytc-comment-form-actions-hidden {
  display: none;
}

.ytc-comment-login-prompt {
  margin-bottom: 24px;
}

/* Comment list */
.ytc-comment {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.ytc-comment-avatar {
  flex-shrink: 0;
}

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

.ytc-comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ytc-comment-author {
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
}

.ytc-comment-date {
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-muted);
}

.ytc-comment-text {
  font-size: var(--ytc-font-size-base);
  line-height: 1.6;
  color: var(--ytc-text);
  word-break: break-word;
}

.ytc-comment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.ytc-comment-like-btn,
.ytc-comment-dislike-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--ytc-radius-full);
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-secondary);
  transition: background var(--ytc-transition);
}

.ytc-comment-like-btn:hover,
.ytc-comment-dislike-btn:hover {
  background: var(--ytc-bg-hover);
}

.ytc-reply {
  margin-left: 40px;
}

.ytc-replies-toggle {
  margin-top: 8px;
  color: var(--ytc-text-link);
}

.ytc-replies {
  margin-top: 12px;
}

.ytc-comments-empty {
  color: var(--ytc-text-secondary);
  font-size: var(--ytc-font-size-base);
  padding: 16px 0;
}

.ytc-comments-disabled {
  color: var(--ytc-text-secondary);
  padding: 16px 0;
}

/* Avatar sizes */
.ytc-avatar-sm  { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.ytc-avatar-xs  { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* --------------------------------------------------------------------------
   Buttons (global)
   -------------------------------------------------------------------------- */
.ytc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--ytc-radius-full);
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ytc-transition), color var(--ytc-transition), border-color var(--ytc-transition);
  border: none;
  white-space: nowrap;
}

.ytc-btn-primary {
  background: var(--ytc-primary);
  color: #fff;
}

.ytc-btn-primary:hover {
  background: var(--ytc-primary-hover);
}

.ytc-btn-ghost {
  background: transparent;
  color: var(--ytc-text);
  border: 1px solid var(--ytc-border);
}

.ytc-btn-ghost:hover {
  background: var(--ytc-bg-hover);
}

.ytc-btn-sm {
  padding: 4px 10px;
  font-size: var(--ytc-font-size-xs);
  height: 28px;
}

.ytc-btn-lg {
  padding: 12px 24px;
  font-size: var(--ytc-font-size-md);
}

.ytc-btn-full {
  width: 100%;
}

.ytc-btn-subscribe {
  background: var(--ytc-subscribe-bg);
  color: var(--ytc-subscribe-text);
}

/* Load more */
.ytc-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 0 32px;
}

.ytc-load-more-btn {
  padding: 10px 24px;
  background: var(--ytc-bg-3);
  border-radius: var(--ytc-radius-full);
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  color: var(--ytc-text);
  transition: background var(--ytc-transition);
}

.ytc-load-more-btn:hover {
  background: var(--ytc-bg-hover);
}

.ytc-load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ytc-infinite-sentinel {
  height: 1px;
  visibility: hidden;
}

/* --------------------------------------------------------------------------
   Search Page
   -------------------------------------------------------------------------- */
.ytc-search-page {
  padding: 0 24px 40px;
  max-width: var(--ytc-max-content);
  margin: 0 auto;
}

.ytc-search-header {
  padding: 16px 0;
}

.ytc-search-query-label {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  margin-bottom: 12px;
}

.ytc-search-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ytc-search-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--ytc-radius-full);
  background: var(--ytc-chip-bg);
  font-size: var(--ytc-font-size-sm);
  font-weight: 500;
  color: var(--ytc-chip-text);
  transition: background var(--ytc-transition);
  border: 1px solid transparent;
}

.ytc-search-filter-btn:hover {
  background: var(--ytc-bg-hover);
}

.ytc-search-filter-btn.ytc-active {
  background: var(--ytc-chip-active-bg);
  color: var(--ytc-chip-active-text);
}

.ytc-search-video-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ytc-search-video-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.ytc-search-thumb-wrap {
  position: relative;
  width: 246px;
  min-width: 246px;
  aspect-ratio: 16 / 9;
  border-radius: var(--ytc-radius-md);
  overflow: hidden;
  background: var(--ytc-bg-3);
}

.ytc-search-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ytc-search-thumb-wrap:hover .ytc-search-thumb {
  transform: scale(1.04);
}

.ytc-search-video-meta {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.ytc-search-video-title {
  font-size: var(--ytc-font-size-lg);
  font-weight: 400;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.ytc-search-video-stats {
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-muted);
  margin-bottom: 6px;
}

.ytc-search-channel-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  margin-bottom: 8px;
}

.ytc-search-video-desc {
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-muted);
  line-height: 1.5;
}

/* Channel results */
.ytc-channel-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ytc-channel-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 0;
}

.ytc-channel-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.ytc-channel-card-info {
  flex: 1;
  min-width: 0;
}

.ytc-channel-card-name {
  font-size: var(--ytc-font-size-lg);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.ytc-channel-card-subs {
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-muted);
  margin-bottom: 4px;
}

.ytc-channel-card-desc {
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-secondary);
}

.ytc-search-section {
  margin-bottom: 32px;
}

.ytc-search-section-title {
  font-size: var(--ytc-font-size-xl);
  font-weight: 400;
  margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Trending Page
   -------------------------------------------------------------------------- */
.ytc-trending-page {
  padding: 0 24px 40px;
  max-width: var(--ytc-max-content);
  margin: 0 auto;
}

.ytc-trending-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}

.ytc-page-title {
  font-size: var(--ytc-font-size-2xl);
  font-weight: 600;
}

.ytc-period-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--ytc-border);
  padding-bottom: 0;
  margin-bottom: 24px;
}

.ytc-period-tab {
  padding: 12px 16px;
  font-size: var(--ytc-font-size-base);
  font-weight: 500;
  color: var(--ytc-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--ytc-transition), border-color var(--ytc-transition);
}

.ytc-period-tab:hover {
  color: var(--ytc-text);
}

.ytc-period-tab.ytc-active {
  color: var(--ytc-text);
  border-bottom-color: var(--ytc-text);
}

.ytc-trending-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ytc-trending-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.ytc-trending-rank {
  width: 40px;
  min-width: 40px;
  text-align: center;
  font-size: var(--ytc-font-size-2xl);
  font-weight: 700;
  color: var(--ytc-text-muted);
  padding-top: 8px;
}

.ytc-trending-thumb-wrap {
  position: relative;
  width: 246px;
  min-width: 246px;
  aspect-ratio: 16 / 9;
  border-radius: var(--ytc-radius-md);
  overflow: hidden;
  background: var(--ytc-bg-3);
}

.ytc-trending-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ytc-trending-thumb-wrap:hover .ytc-trending-thumb {
  transform: scale(1.04);
}

.ytc-trending-meta { flex: 1; min-width: 0; padding-top: 4px; }

.ytc-trending-title {
  font-size: var(--ytc-font-size-lg);
  font-weight: 400;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.ytc-trending-channel {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  margin-bottom: 4px;
}

.ytc-trending-stats {
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-muted);
}

/* --------------------------------------------------------------------------
   Channel Page
   -------------------------------------------------------------------------- */
.ytc-channel-page {
  max-width: var(--ytc-max-content);
  margin: 0 auto;
  padding-bottom: 40px;
}

.ytc-channel-banner {
  width: 100%;
  height: 0;
  padding-bottom: 16.56%;
  position: relative;
  background: var(--ytc-bg-3);
}

.ytc-channel-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ytc-channel-banner-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--ytc-bg-3), var(--ytc-bg-hover));
}

.ytc-channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.ytc-channel-header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ytc-channel-page-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.ytc-channel-header-info {
  flex: 1;
  min-width: 0;
}

.ytc-channel-page-name {
  font-size: var(--ytc-font-size-2xl);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ytc-channel-header-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  margin: 4px 0;
}

.ytc-channel-slug {
  color: var(--ytc-text-secondary);
}

.ytc-channel-header-desc {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  max-width: 480px;
}

.ytc-channel-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--ytc-border);
  padding: 0 24px;
  margin-bottom: 24px;
}

.ytc-channel-tab {
  padding: 14px 20px;
  font-size: var(--ytc-font-size-base);
  font-weight: 500;
  color: var(--ytc-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--ytc-transition), border-color var(--ytc-transition);
}

.ytc-channel-tab:hover { color: var(--ytc-text); }

.ytc-channel-tab.ytc-active {
  color: var(--ytc-text);
  border-bottom-color: var(--ytc-text);
}

.ytc-channel-content {
  padding: 0 24px;
}

.ytc-channel-about {
  max-width: 600px;
}

.ytc-channel-about-section {
  margin-bottom: 24px;
}

.ytc-channel-about-section h2 {
  font-size: var(--ytc-font-size-lg);
  font-weight: 500;
  margin-bottom: 8px;
}

.ytc-channel-stats-list {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   Subscriptions Page
   -------------------------------------------------------------------------- */
.ytc-subscriptions-page {
  padding: 0 24px 40px;
  max-width: var(--ytc-max-content);
  margin: 0 auto;
}

.ytc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 8px;
}

.ytc-view-toggle {
  display: flex;
  gap: 4px;
}

.ytc-view-toggle .ytc-icon-btn.ytc-active {
  background: var(--ytc-bg-hover);
}

/* List view */
.ytc-video-grid-list {
  grid-template-columns: 1fr;
  max-width: 800px;
}

/* --------------------------------------------------------------------------
   Archive Page
   -------------------------------------------------------------------------- */
.ytc-archive-page {
  padding: 0 24px 40px;
  max-width: var(--ytc-max-content);
  margin: 0 auto;
}

.ytc-archive-header {
  padding: 16px 0 8px;
}

.ytc-archive-title {
  font-size: var(--ytc-font-size-2xl);
  font-weight: 600;
  margin-bottom: 4px;
}

.ytc-archive-desc {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  margin-bottom: 4px;
}

.ytc-archive-count {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-muted);
}

.ytc-archive-sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.ytc-sort-label {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Login / Register Page
   -------------------------------------------------------------------------- */
.ytc-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--ytc-header-height));
  padding: 24px;
}

.ytc-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--ytc-surface);
  border: 1px solid var(--ytc-border);
  border-radius: var(--ytc-radius-lg);
  padding: 32px;
}

.ytc-login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.ytc-auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--ytc-border);
  margin-bottom: 24px;
}

.ytc-auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: var(--ytc-font-size-base);
  font-weight: 500;
  color: var(--ytc-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--ytc-transition), border-color var(--ytc-transition);
  cursor: pointer;
}

.ytc-auth-tab:hover { color: var(--ytc-text); }

.ytc-auth-tab.ytc-active {
  color: var(--ytc-text);
  border-bottom-color: var(--ytc-input-focus);
}

.ytc-auth-panel { display: none; }
.ytc-auth-panel.ytc-active { display: block; }

.ytc-auth-panel-title {
  font-size: var(--ytc-font-size-xl);
  font-weight: 400;
  margin-bottom: 4px;
}

.ytc-auth-panel-subtitle {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  margin-bottom: 24px;
}

.ytc-form-group {
  margin-bottom: 16px;
}

.ytc-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ytc-form-label {
  display: block;
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  margin-bottom: 6px;
}

.ytc-form-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: var(--ytc-input-bg);
  border: 1px solid var(--ytc-input-border);
  border-radius: var(--ytc-radius-md);
  color: var(--ytc-text);
  font-size: var(--ytc-font-size-base);
  transition: border-color var(--ytc-transition);
}

.ytc-form-input:focus {
  border-color: var(--ytc-input-focus);
  outline: none;
}

.ytc-password-wrap {
  position: relative;
}

.ytc-password-wrap .ytc-form-input {
  padding-right: 40px;
}

.ytc-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  color: var(--ytc-text-muted);
}

.ytc-form-hint {
  display: block;
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-muted);
  margin-top: 4px;
}

.ytc-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.ytc-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--ytc-font-size-sm);
  cursor: pointer;
}

.ytc-form-link {
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-link);
}

.ytc-auth-switch {
  text-align: center;
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
  margin-top: 16px;
}

.ytc-auth-switch-link {
  color: var(--ytc-text-link);
  font-weight: 500;
}

.ytc-form-error {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.3);
  border-radius: var(--ytc-radius-sm);
  padding: 10px 12px;
  font-size: var(--ytc-font-size-sm);
  color: #ff4444;
  margin-bottom: 16px;
}

.ytc-form-success {
  background: rgba(0, 200, 0, 0.1);
  border: 1px solid rgba(0, 200, 0, 0.3);
  border-radius: var(--ytc-radius-sm);
  padding: 10px 12px;
  font-size: var(--ytc-font-size-sm);
  color: #00c840;
  margin-bottom: 16px;
}

.ytc-password-strength {
  height: 4px;
  border-radius: 2px;
  margin-top: 6px;
  background: var(--ytc-border);
  overflow: hidden;
  position: relative;
}

.ytc-password-strength::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--strength, 0%);
  background: var(--strength-color, var(--ytc-border));
  transition: width 0.3s ease;
}

/* --------------------------------------------------------------------------
   404 Page
   -------------------------------------------------------------------------- */
.ytc-404-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--ytc-header-height));
  padding: 24px;
  text-align: center;
}

.ytc-404-inner {
  max-width: 500px;
}

.ytc-404-icon {
  color: var(--ytc-primary);
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.ytc-404-title {
  font-size: var(--ytc-font-size-2xl);
  font-weight: 500;
  margin-bottom: 12px;
}

.ytc-404-description {
  font-size: var(--ytc-font-size-base);
  color: var(--ytc-text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.ytc-404-description a {
  color: var(--ytc-text-link);
}

.ytc-404-search {
  margin-bottom: 24px;
}

.ytc-404-search p {
  margin-bottom: 8px;
  font-size: var(--ytc-font-size-sm);
  color: var(--ytc-text-secondary);
}

.ytc-404-search-form {
  display: flex;
  gap: 8px;
}

.ytc-404-home-btn {
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Auth gate (subscriptions logged out)
   -------------------------------------------------------------------------- */
.ytc-auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--ytc-header-height));
  padding: 24px;
}

.ytc-auth-gate-inner {
  text-align: center;
  max-width: 400px;
}

.ytc-auth-gate-icon {
  color: var(--ytc-primary);
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.ytc-auth-gate-title {
  font-size: var(--ytc-font-size-xl);
  font-weight: 500;
  margin-bottom: 8px;
}

.ytc-auth-gate-desc {
  font-size: var(--ytc-font-size-base);
  color: var(--ytc-text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.ytc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--ytc-text-secondary);
}

.ytc-empty-icon {
  color: var(--ytc-text-muted);
  margin-bottom: 16px;
}

.ytc-empty-state h2 {
  font-size: var(--ytc-font-size-xl);
  font-weight: 500;
  color: var(--ytc-text);
  margin-bottom: 8px;
}

.ytc-empty-state p {
  font-size: var(--ytc-font-size-base);
  max-width: 320px;
  line-height: 1.5;
}

.ytc-coming-soon {
  color: var(--ytc-text-secondary);
  padding: 24px 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.ytc-footer {
  padding: 24px;
  border-top: 1px solid var(--ytc-border);
  margin-top: 40px;
  color: var(--ytc-text-muted);
}

.ytc-footer-inner {
  max-width: var(--ytc-max-content);
  margin: 0 auto;
}

.ytc-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 12px;
}

.ytc-footer-links a {
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-muted);
  transition: color var(--ytc-transition);
}

.ytc-footer-links a:hover {
  color: var(--ytc-text);
}

.ytc-footer-copy {
  font-size: var(--ytc-font-size-xs);
  color: var(--ytc-text-muted);
}

/* --------------------------------------------------------------------------
   Plyr overrides
   -------------------------------------------------------------------------- */
.plyr {
  --plyr-color-main: var(--ytc-primary);
  --plyr-font-family: var(--ytc-font);
  border-radius: var(--ytc-radius-md);
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   Home page
   -------------------------------------------------------------------------- */
.ytc-home-page {
  max-width: var(--ytc-max-content);
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Generic post / fallback
   -------------------------------------------------------------------------- */
.ytc-generic-loop {
  padding: 24px;
}

.ytc-post-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--ytc-border);
}

.ytc-post-item h2 a {
  font-size: var(--ytc-font-size-xl);
  font-weight: 500;
  color: var(--ytc-text);
}

.ytc-post-excerpt {
  font-size: var(--ytc-font-size-base);
  color: var(--ytc-text-secondary);
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1280px) {
  .ytc-watch-secondary { width: 360px; }
}

@media (max-width: 1100px) {
  .ytc-watch-layout { flex-direction: column; }
  .ytc-watch-secondary { width: 100%; }
  .ytc-watch-primary { max-width: 100%; }
}

@media (max-width: 900px) {
  .ytc-sidebar { transform: translateX(-100%); }
  .ytc-sidebar.ytc-sidebar-mobile-open { transform: translateX(0); width: var(--ytc-sidebar-width-full); }
  .ytc-sidebar-overlay { display: block; }

  .ytc-main {
    margin-left: 0 !important;
  }

  .ytc-video-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    padding: 12px 16px 24px;
  }

  .ytc-chips-row { padding: 8px 16px 0; }

  .ytc-header-center { max-width: 400px; }
}

@media (max-width: 640px) {
  .ytc-header {
    padding: 0 8px;
  }

  .ytc-header-center {
    max-width: none;
  }

  .ytc-header-left {
    min-width: auto;
  }

  .ytc-logo-text { display: none; }

  .ytc-search-btn { width: 48px; }

  .ytc-video-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px 8px;
    padding: 8px;
  }

  .ytc-watch-layout { padding: 0 8px 40px; }

  .ytc-video-title { font-size: var(--ytc-font-size-lg); }

  .ytc-search-video-item { flex-direction: column; }
  .ytc-search-thumb-wrap { width: 100%; min-width: 0; }

  .ytc-trending-item { flex-direction: column; }
  .ytc-trending-thumb-wrap { width: 100%; min-width: 0; }

  .ytc-login-card { padding: 24px 16px; }

  .ytc-form-row { grid-template-columns: 1fr; }

  .ytc-channel-header { flex-direction: column; align-items: flex-start; }
  .ytc-channel-header-left { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 400px) {
  .ytc-video-grid {
    grid-template-columns: 1fr;
  }
}

/* High-DPI / retina */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .ytc-thumb,
  .ytc-compact-thumb,
  .ytc-search-thumb,
  .ytc-trending-thumb {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print */
@media print {
  .ytc-header,
  .ytc-sidebar,
  .ytc-footer,
  .ytc-actions,
  .ytc-comment-form-wrap,
  .ytc-load-more-wrap {
    display: none !important;
  }

  .ytc-main { margin-left: 0 !important; }
}
