/* =========================================================
   MitraVision — style.css
   Replikasi tampilan dark-theme dari prototipe React/Tailwind
   ========================================================= */

:root {
  --yt-bg: #0f0f0f;
  --yt-surface: #181818;
  --yt-card: #202020;
  --yt-chip: #272727;
  --yt-border: #303030;
  --yt-text: #f1f1f1;
  --yt-muted: #aaa;
  --mv-brand: #3b82f6;
  --mv-teal: #14b8a6;
  --gray-950: var(--yt-bg);
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-500: var(--yt-muted);
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: var(--yt-text);
  --blue-500: var(--mv-brand);
  --blue-400: #60a5fa;
  --emerald-500: var(--mv-teal);

  --yellow-500: #eab308;
  --yellow-950: #422006;

  --red-500: #ef4444;
  --red-600: #dc2626;

  --thumb-blue: #1e40af;
  --thumb-emerald: #065f46;
  --thumb-orange: #9a3412;
  --thumb-red: #991b1b;
  --thumb-indigo: #3730a3;
  --thumb-teal: #115e59;

  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;
}

body.light {
  --gray-950: #ffffff;
  --gray-900: #f8f8f8;
  --gray-800: #eeeeee;
  --gray-700: #dddddd;
  --gray-500: #6b7280;
  --gray-400: #5f6368;
  --gray-300: #374151;
  --gray-200: #1f2937;
  --gray-100: #0f0f0f;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--yt-bg);
  color: var(--yt-text);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
}

i[data-lucide] {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ NAVBAR ============ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(15,15,15,.98);
  border-bottom: 1px solid var(--yt-border);
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mv-topbar {}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.icon-btn {
  padding: 8px;
  border-radius: var(--radius-full);
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background-color: var(--gray-800);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--blue-500);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-accent {
  color: var(--blue-500);
}

.navbar-search {
  flex: 1;
  max-width: 640px;
  padding: 0 16px;
  display: none;
}

.search-wrap {
  width: 100%;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  background-color: #121212;
  border: 1px solid var(--yt-border);
  color: var(--yt-text);
  padding: 8px 16px;
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--blue-500);
  background-color: var(--gray-900);
}

.search-input::placeholder {
  color: var(--gray-500);
}

.search-btn {
  background-color: #222;
  border: 1px solid var(--yt-border);
  border-left: 0;
  padding: 8px 20px;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
}

.search-btn:hover {
  background-color: var(--gray-700);
}

.search-btn i {
  color: var(--gray-400);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(96,165,250,.22);
  background: rgba(59,130,246,.12);
  color: var(--blue-400);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.upload-btn {
  display: none;
  align-items: center;
  gap: 8px;
  background-color: var(--gray-800);
  border: 1px solid var(--gray-700);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.upload-btn i {
  width: 18px;
  height: 18px;
}

.upload-btn:hover {
  background-color: var(--gray-700);
}

.bell-btn {
  position: relative;
}

.bell-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background-color: var(--red-500);
  border: 2px solid var(--gray-900);
  border-radius: var(--radius-full);
}

.avatar-wrap {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(to top right, var(--blue-500), var(--emerald-500));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gray-800);
}

.avatar i {
  width: 18px;
  height: 18px;
  color: white;
}

.premium-badge-icon {
  width: 16px;
  height: 16px;
  color: var(--yellow-500);
  margin-left: -12px;
  margin-top: 16px;
  background-color: var(--gray-900);
  border-radius: var(--radius-full);
}

/* ============ BODY LAYOUT ============ */

.body-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ============ SIDEBAR ============ */

.sidebar {
  display: none;
  flex-direction: column;
  background-color: #111827;
  border-right: 1px solid var(--yt-border);
  overflow-y: auto;
  transition: width 0.3s ease-in-out;
  width: 0;
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  z-index: 45;
}

.mv-sidebar {}

.sidebar-open {
  width: 220px;
}

.sidebar-closed {
  width: 80px;
}

.sidebar-section {
  padding: 8px;
}

.sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: var(--yt-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-open .sidebar-item {
  justify-content: flex-start;
  padding: 12px;
}

.sidebar-item:hover {
  background-color: rgba(255,255,255,.06);
  color: white;
}

.sidebar-item.active {
  background-color: rgba(255,255,255,.08);
  color: white;
}

.sidebar-item i {
  flex-shrink: 0;
}

.sidebar-label {
  display: none;
  margin-left: 16px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-open .sidebar-label {
  display: inline-block;
}

.sidebar-heading {
  display: none;
  color: var(--yt-muted);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 8px 12px;
}

.sidebar-open .sidebar-heading {
  display: block;
}

.sidebar-divider {
  border-top: 1px solid var(--yt-border);
  margin: 8px 0;
}

.sidebar-footer {
  display: none;
}

.sidebar-footer p {
  margin: 0;
}

/* ============ MAIN CONTENT ============ */

.main-content {
  flex: 1;
  overflow-y: auto;
  background-color: var(--yt-bg);
  margin-left: 220px;
}

.body-layout.sidebar-collapsed .main-content {
  margin-left: 80px;
}

.watch-page-shell {
  min-height: calc(100vh - 56px);
  background: var(--yt-bg);
}

.mv-content {}

.route-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 24px 0;
}

.route-links a,
.route-links button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--gray-700);
  background: linear-gradient(180deg, rgba(17,24,39,.96), rgba(31,41,55,.96));
  color: var(--gray-100);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.route-links button {
  cursor: pointer;
}

.route-links a:hover,
.route-links button:hover {
  background: var(--gray-800);
}

.section-copy {
  padding: 16px 24px 0;
}

.section-copy h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.section-copy p {
  margin: 0;
  color: var(--gray-400);
  line-height: 1.6;
}

.category-bar {
  position: sticky;
  top: 56px;
  z-index: 40;
  background-color: rgba(15,15,15,.96);
  backdrop-filter: blur(8px);
  padding: 12px 24px;
  border-bottom: 1px solid var(--yt-border);
  display: flex;
  gap: 12px;
  overflow-x: auto;
}

.mv-chipbar {}

.category-bar::-webkit-scrollbar {
  display: none;
}

.category-pill {
  white-space: nowrap;
  padding: 6px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  background-color: var(--yt-chip);
  color: var(--yt-text);
  border: 1px solid var(--yt-border);
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.category-pill:hover {
  background-color: var(--gray-700);
}

.category-pill.active {
  background-color: var(--gray-100);
  color: var(--gray-900);
  border-color: var(--gray-100);
}

.video-grid {
  padding: 20px 24px 28px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.mv-video-grid {}

.empty-state {
  text-align: center;
  color: var(--yt-muted);
  padding: 48px 24px;
  font-size: 0.95rem;
}

.empty-state-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 24px;
  border: 1px solid var(--yt-border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(24,24,24,.98), rgba(17,17,17,.98));
  display: grid;
  gap: 12px;
  justify-items: center;
}

.empty-state-card p {
  margin: 0;
  color: var(--yt-muted);
  line-height: 1.6;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(59,130,246,.12);
  color: var(--blue-400);
}

.empty-state-icon i {
  width: 26px;
  height: 26px;
}

.ad-grid {
  padding: 0 24px 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.ad-card {
  padding: 14px;
  border: 1px solid var(--gray-800);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17,24,39,.9), rgba(31,41,55,.9));
}

.ad-card .ad-kicker {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ad-card strong {
  display: block;
  margin-bottom: 4px;
}

.ad-card p {
  margin: 0 0 10px;
  color: var(--gray-400);
  font-size: 0.9rem;
}

.ad-card a {
  color: var(--blue-400);
  font-size: 0.9rem;
  text-decoration: none;
}

.hero-panel {
  margin: 0 24px 16px;
  padding: 22px;
  border: 1px solid rgba(59,130,246,.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.22), transparent 40%),
    linear-gradient(135deg, rgba(17,24,39,.96), rgba(5,6,8,.96));
  display: grid;
  grid-template-columns: 1.5fr .9fr;
  gap: 18px;
}

.hero-copy h1 {
  font-size: clamp(2rem, 3vw, 3.5rem);
  line-height: 1.02;
  margin: 10px 0 12px;
}

.hero-copy p {
  margin: 0;
  color: var(--gray-300);
  line-height: 1.65;
}

.hero-desc {
  margin-top: 10px !important;
  color: var(--gray-400) !important;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(96,165,250,.28);
  color: var(--blue-400);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.hero-stats div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15,23,42,.75);
  border: 1px solid rgba(148,163,184,.12);
}

.hero-stats strong {
  display: block;
  font-size: 1.1rem;
}

.hero-stats span {
  color: var(--gray-400);
  font-size: 0.8rem;
}

.hero-rail {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.auth-pill {
  margin-top: 14px;
}

.rail-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(5,6,8,.4);
  border: 1px solid rgba(255,255,255,.06);
}

.rail-card span {
  display: block;
  color: var(--gray-500);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rail-card strong {
  display: block;
  margin-top: 4px;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, var(--blue-500), #2563eb);
  color: white;
}

.ghost-btn {
  border-color: var(--gray-700);
  color: var(--gray-100);
  background: rgba(17,24,39,.6);
}

.hero-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(15,23,42,.72);
  border: 1px solid rgba(148,163,184,.16);
}

.hero-card-badge {
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fde68a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-card h3 {
  margin: 10px 0 10px;
  font-size: 1.05rem;
}

.hero-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--gray-300);
  line-height: 1.7;
}

.section-block {
  margin-top: 18px;
}

.section-head {
  padding: 0 24px 12px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.section-head p {
  margin: 0;
  color: var(--gray-400);
}

.mini-grid {
  padding: 0 24px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mini-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--gray-800);
  background: rgba(17,24,39,.8);
  text-decoration: none;
  color: inherit;
}

.mini-card strong {
  font-size: 0.95rem;
}

.mini-card span {
  color: var(--gray-400);
  font-size: 0.82rem;
}

.subscribe-chip {
  margin-top: 8px;
  justify-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59,130,246,.14);
  color: var(--blue-400);
  border: 1px solid rgba(59,130,246,.22);
  font-size: 0.72rem;
  font-weight: 700;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--gray-100);
  background: var(--gray-950);
}

.page-shell a {
  color: var(--blue-400);
  text-decoration: none;
}

.detail-shell {
  max-width: 760px;
  padding: 28px;
  border: 1px solid var(--gray-800);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(17,24,39,.96), rgba(5,6,8,.96));
  text-align: left;
}

.detail-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59,130,246,.12);
  color: var(--blue-400);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-shell h1 {
  margin: 14px 0 10px;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.detail-shell p {
  margin: 0 0 10px;
  color: var(--gray-300);
  line-height: 1.7;
}

.detail-meta {
  color: var(--gray-400) !important;
}

.watch-layout {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 420px);
  gap: 20px;
  align-items: start;
}

.mv-watch-layout {}

.watch-main {
  display: grid;
  gap: 16px;
}

.watch-layout .watch-main,
.watch-layout .watch-side {
  min-width: 0;
}

.watch-main {
  position: relative;
}

.watch-head {
  padding: 2px 4px 0;
}

.watch-head h1 {
  margin: 10px 0 6px;
  font-size: clamp(1.9rem, 3vw, 2.9rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.watch-head #videoSummary {
  max-width: 68ch;
  color: var(--gray-300);
  line-height: 1.7;
}

.watch-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.watch-toolbar .watch-action {
  border-radius: 999px;
  padding-inline: 16px;
}

.watch-card {
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

#commentCard .admin-card {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}

#commentInput {
  border-radius: 14px;
  border: 1px solid var(--yt-border);
  background: rgba(255,255,255,.03);
  color: var(--yt-text);
  padding: 12px 14px;
  outline: none;
}

#commentInput:focus {
  border-color: rgba(59,130,246,.72);
  box-shadow: 0 0 0 3px rgba(59,130,246,.16);
}

#commentList .admin-row {
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
}

#commentList .admin-row + .admin-row {
  margin-top: 10px;
}

.related-row {
  transition: transform .15s ease, background-color .15s ease;
}

.related-row:hover {
  transform: translateY(-1px);
}

.related-copy strong {
  line-height: 1.35;
}

.related-copy span:last-child {
  color: var(--gray-400);
}

.watch-player-wrap {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--yt-border);
  background: #000;
  aspect-ratio: 16 / 9;
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
}

.mv-player {}

.watch-player {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: cover;
}

.watch-player-landscape {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  min-height: 360px;
}

.watch-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--yt-text);
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  font-weight: 700;
  text-align: center;
  padding: 24px;
}

.watch-head {
  padding: 0 4px;
}

.watch-channel-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.watch-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
  color: var(--gray-300);
}

.watch-stats span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}

.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.watch-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--gray-700);
  background: rgba(17,24,39,.8);
  color: var(--gray-100);
  text-decoration: none;
  font-weight: 700;
}

.watch-side {
  display: grid;
  gap: 16px;
}

.watch-card {
  padding: 18px;
  border: 1px solid var(--yt-border);
  border-radius: 20px;
  background: var(--yt-surface);
}

.watch-card-title {
  margin-bottom: 12px;
  color: var(--gray-400);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.related-list {
  display: grid;
  gap: 10px;
}

.related-row {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 10px;
  align-items: start;
  text-decoration: none;
  color: inherit;
  padding: 8px;
  border-radius: 14px;
}

.related-row:hover {
  background: rgba(255,255,255,.04);
}

.related-thumb-small {
  width: 168px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  background: #222;
}

.related-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.related-copy strong,
.related-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-channel {
  display: flex;
  gap: 12px;
  align-items: center;
}

.watch-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue-500), var(--emerald-500));
  color: white;
  font-weight: 800;
}

.watch-channel p {
  margin: 4px 0 0;
  color: var(--gray-400);
}

.watch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.watch-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.watch-list span {
  color: var(--gray-400);
}

.related-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.mv-related {}

.related-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--yt-border);
  background: var(--yt-surface);
  text-decoration: none;
  color: inherit;
}

.related-card strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.35;
}

.related-card span {
  color: var(--gray-400);
  font-size: 0.82rem;
}

.library-shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 20px;
}

.library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.library-kicker {
  margin: 0 0 6px;
  color: var(--yt-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
}

.library-head h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.library-subtitle {
  margin: 8px 0 0;
  color: var(--yt-muted);
  line-height: 1.6;
}

.library-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.library-tabs .category-pill {
  border: 1px solid var(--yt-border);
}

.library-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.library-stat {
  padding: 14px 16px;
  border: 1px solid var(--yt-border);
  border-radius: 16px;
  background: var(--yt-surface);
}

.library-stat strong {
  display: block;
  font-size: 1.25rem;
}

.library-stat span {
  display: block;
  margin-top: 4px;
  color: var(--yt-muted);
  font-size: 0.85rem;
}

.library-section {
  display: grid;
  gap: 14px;
}

.library-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.library-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.library-list {
  display: grid;
  gap: 10px;
}

.library-item,
.library-channel-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--yt-border);
  border-radius: 16px;
  background: var(--yt-surface);
}

.library-thumb-wrap {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  min-width: 160px;
  border-radius: 12px;
  overflow: hidden;
  background: #222;
}

.library-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.library-copy {
  min-width: 0;
}

.library-copy h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.4;
}

.library-copy h3 a {
  color: inherit;
  text-decoration: none;
}

.library-copy p {
  margin: 4px 0 0;
  color: var(--yt-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.library-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.related-thumb {
  border-radius: 14px;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: end start;
  padding: 10px;
  color: white;
  font-size: 0.76rem;
  font-weight: 700;
}

.admin-shell {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.admin-hero {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.2fr 1fr;
  align-items: start;
}

.profile-wrap,
.channel-wrap,
.monetize-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.admin-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--gray-800);
  background: rgba(17,24,39,.9);
}

.admin-card h3 {
  margin: 0 0 8px;
}

.admin-card p {
  margin: 0;
  color: var(--gray-400);
  line-height: 1.6;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.admin-form-grid input,
.admin-card textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--gray-700);
  background: rgba(5,6,8,.8);
  color: var(--gray-100);
  outline: none;
}

.admin-form-grid input::placeholder,
.admin-card textarea::placeholder {
  color: var(--gray-500);
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(5,6,8,.45);
}

.admin-row strong {
  display: block;
  margin-bottom: 4px;
}

.admin-row p {
  margin: 0;
  color: var(--gray-400);
}

.admin-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: start;
}

/* ============ VIDEO CARD ============ */

.video-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mv-video-card:hover .thumb img {
  transform: scale(1.04);
}

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  border: 0;
}

.mv-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #222;
}

.mv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-card:hover .thumb-overlay {
  opacity: 1;
}

.play-circle {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 12px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-circle i {
  width: 32px;
  height: 32px;
  color: white;
  fill: white;
}

.premium-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: rgba(234, 179, 8, 0.9);
  color: var(--yellow-950);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 4px;
}

.premium-tag i {
  width: 14px;
  height: 14px;
}

.duration-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
  background-color: rgba(0, 0, 0, 0.7);
  color: var(--gray-100);
}

.duration-tag.live {
  background-color: var(--red-600);
  color: white;
}

.mv-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0,0,0,.85);
  color: #fff;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
}

.video-info {
  display: flex;
  gap: 12px;
  padding-right: 8px;
}

.mv-video-meta {}

.mv-more {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(15,15,15,.96);
  border-top: 1px solid var(--yt-border);
}

.bottom-nav-item {
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--yt-muted);
  text-decoration: none;
  font-size: 0.72rem;
  padding: 6px 4px;
  border-radius: 12px;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: var(--yt-text);
  background: rgba(59,130,246,.12);
}

.channel-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 18px;
}

.channel-tabs .watch-action.active {
  background: var(--gray-100);
  color: var(--gray-950);
}

.shorts-shell {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0;
}

.shorts-feed {
  display: grid;
  gap: 0;
  scroll-snap-type: y mandatory;
  min-height: calc(100vh - 56px);
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
}

.shorts-grid {
  display: grid;
  gap: 20px;
  scroll-snap-type: y mandatory;
}

.short-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  align-items: center;
  min-height: calc(100svh - 56px);
  scroll-snap-align: start;
  padding: 0;
}

.short-player {
  position: relative;
  width: 100%;
  height: calc(100svh - 56px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 0;
  overflow: hidden;
  background: #0b0b0b;
  border: 0;
  box-shadow: none;
}

.short-media {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  display: block;
  background: #000;
}

.short-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}

.short-media {
  position: relative;
  z-index: 2;
}

.short-info {
  position: absolute;
  left: 18px;
  bottom: 22px;
  z-index: 3;
  max-width: min(78vw, 460px);
  display: grid;
  gap: 6px;
  text-shadow: 0 2px 12px rgba(0,0,0,.8);
}

.short-info h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.short-info p {
  margin: 0;
  color: var(--gray-300);
  font-size: 0.9rem;
}

.short-cta {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: var(--yt-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.12);
}

.short-actions {
  position: absolute;
  right: 18px;
  bottom: 96px;
  z-index: 3;
  display: grid;
  gap: 10px;
}

.short-actions .watch-action {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(15,15,15,.7);
  border-color: rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
}

.short-placeholder {
  display: grid;
  place-items: center;
}

.short-placeholder-card {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(15,15,15,.72);
  border: 1px solid var(--yt-border);
  text-align: center;
}

.short-placeholder-card p {
  margin: 6px 0 0;
  color: var(--yt-muted);
}

.short-unmute {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 4;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(59,130,246,.92);
  border: 1px solid rgba(255,255,255,.16);
  color: var(--yt-text);
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
  min-width: 96px;
}

.short-unmute:hover {
  background: rgba(37,99,235,.96);
}

.short-unmute.hidden {
  display: none;
}

[hidden] {
  display: none !important;
}

@media (min-width: 900px) {
  .short-item {
    min-height: calc(100svh - 56px);
  }
  .short-player {
    width: 100%;
    height: calc(100svh - 56px);
  }
}

@media (max-width: 899px) {
  .shorts-shell {
    padding: 0;
  }
  .short-item {
    min-height: calc(100svh - 56px);
    padding: 0;
  }
  .short-player {
    width: 100%;
    max-width: 100%;
    height: calc(100svh - 56px);
    border-radius: 0;
  }
  .short-unmute {
    top: auto;
    bottom: 18px;
    left: 18px;
    right: auto;
    min-width: 120px;
    background: rgba(17, 24, 39, .9);
  }
}

@media (max-width: 899px) {
  .watch-player-landscape {
    min-height: 220px;
  }
}

.short-card {
  position: relative;
  min-height: min(84vh, 880px);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--gray-800);
  background: linear-gradient(135deg, rgba(17,24,39,.96), rgba(5,6,8,.96));
  display: grid;
  align-items: end;
  scroll-snap-align: start;
}

.short-card iframe,
.short-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.short-overlay {
  position: relative;
  z-index: 2;
  padding: 18px;
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.78));
}

.short-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-toggle {
  color: var(--gray-100);
}

.feed-skeleton-grid {
  padding: 20px 24px 28px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.skeleton-card {
  display: grid;
  gap: 10px;
}

.skeleton-thumb,
.skeleton-line {
  background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 37%, #1a1a1a 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 12px;
}

.skeleton-thumb {
  aspect-ratio: 16 / 9;
}

.skeleton-line {
  height: 14px;
  width: 100%;
  border-radius: 999px;
}

.skeleton-line.short {
  width: 60%;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.video-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(59,130,246,.85), rgba(20,184,166,.72));
  color: white;
}

.ad-badge {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

@media (max-width: 1023px) {
  .sidebar { display: none; }
  .body-layout { display: block; overflow: visible; }
  .main-content { overflow: visible; padding-bottom: 92px; margin-left: 0; }
  .navbar { position: sticky; top: 0; }
  .category-bar { top: 56px; }
}

.video-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: #222;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-700);
}

.video-avatar i {
  width: 16px;
  height: 16px;
  color: var(--gray-400);
}

.video-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.video-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-100);
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.video-card:hover .video-title {
  color: var(--blue-400);
}

.video-creator {
  font-size: 0.75rem;
  color: var(--yt-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.video-creator i {
  width: 14px;
  height: 14px;
  color: var(--blue-500);
}

.video-stats {
  font-size: 0.75rem;
  color: var(--yt-muted);
  margin-top: 2px;
}

@media (max-width: 960px) {
  .watch-layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .watch-toolbar {
    gap: 8px;
  }
  .watch-toolbar .watch-action {
    flex: 1 1 auto;
  }
  .related-row {
    grid-template-columns: 120px 1fr;
  }
  .related-thumb-small {
    width: 120px;
  }
  .library-item,
  .library-channel-row {
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .library-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .short-item {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: calc(100vh - 56px - 80px);
  }
  .short-actions {
    right: 12px;
    bottom: 92px;
  }
  .short-info {
    left: 12px;
    right: 12px;
    max-width: none;
  }
}

/* Thumbnail color variants */
.thumb-blue { background-color: var(--thumb-blue); }
.thumb-emerald { background-color: var(--thumb-emerald); }
.thumb-orange { background-color: var(--thumb-orange); }
.thumb-red { background-color: var(--thumb-red); }
.thumb-indigo { background-color: var(--thumb-indigo); }
.thumb-teal { background-color: var(--thumb-teal); }

/* ============ RESPONSIVE ============ */

@media (min-width: 640px) {
  .brand-name { display: inline; }
  .sidebar { display: flex; }
  .upload-btn { display: flex; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .feed-skeleton-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .navbar-search { display: block; }
  .upload-btn { display: inline-flex; }
  .sidebar { display: flex; }
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feed-skeleton-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .navbar-search { display: flex; }
}

@media (min-width: 1280px) {
  .video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .feed-skeleton-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

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

@media (max-width: 720px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .library-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .sidebar-closed,
  .sidebar-open {
    width: 0;
  }
  .watch-page-shell {
    padding-bottom: 88px;
  }
  .library-item,
  .library-channel-row {
    grid-template-columns: 1fr;
  }
  .library-thumb-wrap {
    min-width: 0;
  }
  .shorts-shell {
    padding: 16px 12px 24px;
  }
  .short-player {
    width: 100%;
    max-width: 100%;
    border-radius: 18px;
  }
}

/* ============ VIDEO MODAL ============ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop[hidden] {
  display: none;
}

[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-container {
  background-color: var(--yt-surface);
  border: 1px solid var(--yt-border);
  border-radius: 1rem;
  width: 100%;
  max-width: 860px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8);
  animation: slideUp 0.25s ease;
}

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

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--yt-border);
}

.modal-title-wrap {
  overflow: hidden;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-100);
  margin: 0;
  line-height: 1.4;
}

.modal-creator {
  font-size: 0.8rem;
  color: var(--blue-400);
  margin: 4px 0 0;
}

.modal-close {
  flex-shrink: 0;
  color: var(--gray-400);
}

.modal-close:hover {
  color: white;
  background-color: rgba(255,255,255,.06);
}

.modal-video-wrap {
  background-color: #000;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.modal-video {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.modal-meta {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  font-size: 0.8rem;
  color: var(--yt-muted);
  border-top: 1px solid var(--yt-border);
}

.modal-views::before { content: "👁 "; }
.modal-time::before  { content: "🕐 "; }
