/*
 * VibesHub Hybrid — light layout
 * Loaded after styles.css so the previous layout stays intact and rollback
 * only requires removing this stylesheet from the HTML pages.
 */

:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --panel: #ffffff;
  --ink: #111113;
  --muted: #6f6f78;
  --line: #e6e5e1;
  --accent: #003090;
  --accent-dark: #00246d;
  --focus: #003090;
  --vh-soft: #f1f1ee;
  --vh-accent-soft: #eef3ff;
  --vh-panel-strong: #fbfbfa;
  --vh-shadow: 0 12px 34px rgb(24 24 27 / 7%);
  --vh-shadow-hover: 0 18px 42px rgb(24 24 27 / 12%);
  --vh-radius: 16px;
  --vh-radius-small: 11px;
}

html {
  background: var(--bg);
}

body {
  background:
    radial-gradient(circle at 12% -10%, rgb(0 48 144 / 5%), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text",
    "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: auto;
}

::selection {
  background: rgb(0 48 144 / 18%);
  color: #111113;
}

a,
button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
select,
textarea {
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(0 48 144 / 16%);
  outline-offset: 2px;
}

/* Top navigation */

.topbar,
.no-header-page .topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 72px;
  border-bottom: 1px solid rgb(230 229 225 / 88%);
  padding-block: 7px;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 60%);
  backdrop-filter: blur(20px) saturate(1.35);
}

.brand-logo {
  width: 96px;
  height: 66px;
}

.sidebar-toggle {
  width: 44px;
  height: 44px;
}

.sidebar-toggle:hover,
.sidebar-toggle[aria-pressed="true"] {
  background: var(--vh-soft);
}

.site-search {
  height: 46px;
  border-color: #deddd9;
  border-radius: 999px;
  padding-inline: 17px;
  background: #f4f4f2;
  box-shadow: inset 0 1px 1px rgb(24 24 27 / 3%);
}

.site-search:focus-within {
  border-color: rgb(0 48 144 / 45%);
  background: #fff;
  box-shadow: 0 0 0 4px rgb(0 48 144 / 7%);
}

.site-search input {
  font-size: 16px;
}

.upload-toggle,
.login-link {
  border-radius: 999px;
  padding-inline: 18px;
  background: #171719;
  box-shadow: 0 5px 14px rgb(17 17 19 / 12%);
}

.upload-toggle:hover,
.login-link:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.account-button,
.logout-button,
.account-create-link {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.account-button:hover,
.logout-button:hover,
.account-create-link:hover {
  border-color: #d2d1cc;
  background: var(--vh-soft);
  color: var(--ink);
}

.account-button.is-avatar-only {
  width: 42px;
  min-width: 42px;
}

.account-menu-panel,
.upload-menu-panel,
.notification-panel,
.guest-auth-dropdown,
.search-history-dropdown {
  border-color: var(--line);
  border-radius: 15px;
  background: rgb(255 255 255 / 98%);
  box-shadow: 0 22px 58px rgb(24 24 27 / 16%);
}

/* Main shell and navigation */

.app-shell {
  grid-template-columns: minmax(0, 1160px) clamp(430px, 31vw, 600px);
  gap: clamp(20px, 2vw, 34px);
  padding-top: 26px;
  padding-right: clamp(18px, 3vw, 42px);
  padding-bottom: 44px;
  padding-left: 250px;
}

.app-shell.guest-mode {
  grid-template-columns: minmax(0, 1160px) clamp(430px, 31vw, 600px);
}

.app-shell.home-mode {
  grid-template-columns: 238px minmax(0, 1fr);
}

.app-shell:not(.home-mode):has(.player-frame.audio-mode:not([hidden])) {
  grid-template-columns: minmax(600px, 1100px) minmax(300px, 480px);
}

.primary-nav,
.app-shell.home-mode .primary-nav {
  top: 96px;
  gap: 4px;
  padding: 0 14px 24px;
  background: transparent;
}

.app-shell:not(.home-mode) .primary-nav {
  top: 96px;
  width: 238px;
  padding: 0 14px 24px;
}

.primary-nav-link,
.you-nav-item,
.subscription-item,
.subscriptions-more {
  border-radius: 12px;
}

.primary-nav-link {
  min-height: 48px;
  padding-inline: 14px;
}

.primary-nav-link,
.you-nav-item {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-nav-link:hover,
.primary-nav-link.active,
.you-nav-item:hover,
.you-nav-item.active,
.subscription-item:hover,
.subscriptions-more:hover {
  background: #ecece9;
}

.primary-nav-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.you-nav-panel {
  margin-top: 10px;
  border-color: var(--line);
}

.subscriptions-panel {
  border-color: var(--line);
}

/* Home feed: YouTube-inspired browsing with a cleaner VibesHub rhythm */

.home-feed {
  gap: 23px;
}

.home-feed-heading {
  align-items: center;
}

.home-feed-heading h1 {
  font-size: clamp(27px, 2.5vw, 38px);
  letter-spacing: -0.035em;
}

.home-category-menu {
  flex-wrap: nowrap;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 7px;
  scrollbar-width: none;
}

.home-category-menu::-webkit-scrollbar {
  display: none;
}

.home-category-menu button {
  flex: 0 0 auto;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding-inline: 17px;
  background: #ececea;
  color: #45454c;
}

.home-category-menu button:hover,
.home-category-menu button:focus-visible {
  background: #dfdfdc;
}

.home-category-menu button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgb(0 48 144 / 22%);
}

.home-video-grid {
  gap: 34px 22px;
}

.personal-mix-card .home-thumb { position: relative; }

.personal-mix-card-overlay {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 2px;
  padding: 34px 14px 13px;
  background: linear-gradient(transparent, rgb(0 0 0 / 78%));
  color: #fff;
}

.personal-mix-card-overlay strong { font-size: 20px; }
.personal-mix-card-overlay small { font-size: 13px; }
.personal-mix-avatar { background: var(--accent, #0645ad); color: #fff; }

/* Keep the personal mix easy to scan on the bright playlist surface. */
.personal-mix-playlist .track-title {
  color: #1b1b20;
  font-size: 16px;
  font-weight: 750;
}

.personal-mix-playlist .track-view-count,
.personal-mix-playlist .track-index {
  color: #666b78;
  font-weight: 650;
}

.personal-mix-playlist .audio-side-heading h3 {
  font-size: 21px;
  font-weight: 800;
}

.personal-mix-playlist .audio-side-heading small,
.personal-mix-playlist .audio-side-heading span {
  color: #5d6370;
  font-weight: 700;
}

.home-feed-load-more {
  display: flex;
  justify-content: center;
  padding: 28px 0 8px;
}

.home-video-card {
  gap: 11px;
  border-radius: var(--vh-radius);
}

.home-thumb {
  overflow: hidden;
  border-radius: 15px;
  background: #e9e9e6;
  box-shadow: 0 1px 2px rgb(24 24 27 / 8%);
}

.home-thumb img {
  transition: transform 260ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.home-video-card-wrap:hover .home-thumb img {
  transform: scale(1.025);
}

.home-video-details {
  gap: 11px;
  margin-top: 11px;
}

.home-video-copy h2 {
  color: #171719;
  font-size: 16px;
  line-height: 1.32;
  font-weight: 800;
  letter-spacing: -0.012em;
}

.home-video-copy p,
.home-video-uploader {
  color: #5b6270;
  font-weight: 650;
}

.home-card-menu-trigger:hover,
.home-card-menu-trigger[aria-expanded="true"] {
  background: #e7e7e4;
}

.home-card-menu {
  border-radius: 13px;
  box-shadow: 0 18px 44px rgb(24 24 27 / 15%);
}

/* Watch page and related media */

.video-player-shell {
  overflow: hidden;
  border-radius: 18px;
  background: #050505;
  box-shadow: 0 18px 42px rgb(17 17 19 / 15%);
}

.video-player-tools {
  padding-top: 14px;
}

.video-timestamps-panel {
  display: grid;
  gap: 13px;
  margin-top: 14px;
  border: 1px solid #e3e2de;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgb(24 24 27 / 6%);
}

.video-timestamps-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.video-timestamps-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.video-timestamps-heading strong {
  font-size: 17px;
}

.video-timestamps-heading span,
.video-timestamps-empty {
  color: var(--muted);
  font-size: 13px;
}

.video-timestamp-editor {
  display: flex;
  gap: 9px;
  min-width: min(460px, 100%);
}

.video-timestamp-editor input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 15px;
  font: inherit;
}

.video-timestamp-editor .secondary-action {
  flex: 0 0 auto;
  min-height: 40px;
  border-radius: 999px;
}

.video-timestamps-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-timestamp-item {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #cbd9f5;
  border-radius: 999px;
  background: var(--vh-accent-soft);
}

.video-timestamp-item > button:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 0;
  padding: 0 12px;
  background: transparent;
  color: #202127;
  cursor: pointer;
  font: inherit;
}

.video-timestamp-item > button:first-child strong {
  color: var(--accent-dark);
  font-size: 13px;
}

.video-timestamp-item > button:first-child span {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-timestamp-item:hover {
  border-color: var(--accent);
  background: #e4edff;
}

.video-timestamp-delete {
  width: 34px;
  border: 0;
  border-left: 1px solid #cbd9f5;
  background: transparent;
  color: #5d6470;
  cursor: pointer;
  font-size: 20px;
}

.video-timestamp-delete:hover {
  background: #d6e3ff;
  color: var(--accent-dark);
}

.video-timestamps-empty {
  margin: 0;
}

.video-timestamps-status {
  min-height: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.video-timestamps-status:not(:empty) {
  min-height: 18px;
}

.video-timestamps-status.error {
  color: #b42318;
}

.video-info {
  margin-top: 5px;
  padding: 15px 4px 0;
}

.video-info h2 {
  font-size: clamp(19px, 1.45vw, 24px);
  letter-spacing: -0.02em;
}

.favorite-button,
.video-player-tools .secondary-action,
.download-all-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding-inline: 15px;
  background: #fff;
  color: #34343a;
}

.favorite-button:hover,
.favorite-button.active,
.video-player-tools .secondary-action:hover,
.download-all-button:hover {
  border-color: #a9c4ff;
  background: var(--vh-accent-soft);
  color: var(--accent-dark);
}

.side-panel {
  gap: 14px;
  max-width: 600px;
}

.library {
  border: 0;
  border-radius: var(--vh-radius);
  background: transparent;
  box-shadow: none;
}

.library-heading {
  padding-inline: 0;
}

.library-heading h2 {
  font-size: 23px;
  letter-spacing: -0.025em;
}

.video-list {
  gap: 15px;
}

.video-card {
  grid-template-columns: minmax(210px, 44%) minmax(0, 1fr);
  gap: 14px;
  min-height: 118px;
  border: 0;
  border-radius: 13px;
  padding: 0;
  background: transparent;
}

.video-card:hover,
.video-card.active {
  background: transparent;
}

.video-card.active {
  box-shadow: none;
}

.video-card.active::before {
  background: var(--accent);
}

.video-card .video-play,
.video-card > img,
.video-card .video-thumb {
  overflow: hidden;
  border-radius: 12px;
}

.video-card h3 {
  font-size: 16px;
  line-height: 1.3;
}

.video-card:hover h3 {
  color: var(--accent-dark);
}

.media-tabs {
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 5px;
  background: #eaeae7;
}

.media-tab {
  min-height: 42px;
  border-radius: 999px;
  color: #606067;
}

.media-tab:hover {
  background: rgb(255 255 255 / 65%);
  color: #1d1d20;
}

.media-tab.active {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 4px 14px rgb(24 24 27 / 10%);
}

/* Video playlists */

.video-playlist-stage {
  overflow: hidden;
  border: 1px solid #242428;
  border-radius: 18px;
  background: #101012;
  box-shadow: 0 18px 42px rgb(17 17 19 / 15%);
}

.video-playlist-main .video-player-shell {
  border-radius: 0;
  box-shadow: none;
}

.video-side-playlist {
  border-left-color: #2b2b30;
}

.video-playlist-track.active,
.audio-side-playlist .soundcloud-track.active {
  background: linear-gradient(90deg, rgb(0 48 144 / 18%), rgb(0 48 144 / 5%));
}

/* Light Spotify-inspired album player */

.audio-stage {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  border: 1px solid #e2e1dd;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--vh-shadow);
}

.audio-stage.single-track-audio-stage {
  grid-template-columns: minmax(0, 1fr);
}

.audio-player {
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 10%, rgb(0 48 144 / 10%), transparent 34%),
    linear-gradient(145deg, #fff 0%, #f8f8f6 62%, #f1f1ee 100%);
}

.album-art {
  border-radius: 18px;
  background: #e8e8e5;
  color: var(--ink);
  box-shadow:
    0 24px 58px rgb(24 24 27 / 18%),
    0 0 0 1px rgb(24 24 27 / 8%);
}

.audio-eyebrow {
  color: var(--accent-dark);
}

.audio-track-position {
  color: #787880;
}

.audio-player h2 {
  color: #111113;
}

.audio-player p {
  color: #4f4f56;
}

.waveform span {
  background: linear-gradient(180deg, #4f7dcc, #003090);
  box-shadow: 0 2px 7px rgb(0 48 144 / 12%);
}

.audio-side-playlist {
  border-left: 1px solid #e2e1dd;
  background: #fbfbfa;
  color: #171719;
}

.audio-side-heading {
  border-bottom: 1px solid #e2e1dd;
  background: #fff;
}

.audio-side-heading h3 {
  color: #171719;
}

.audio-side-heading small,
.audio-side-heading span {
  color: #77777f;
}

.audio-side-playlist .soundcloud-track {
  border-bottom-color: #e8e7e4;
  color: #252529;
}

.audio-side-playlist .soundcloud-track:hover:not(.active) {
  color: #151517;
  background: var(--vh-accent-soft);
}

.audio-side-playlist .soundcloud-track:hover:not(.active) .track-index,
.audio-side-playlist .soundcloud-track:hover:not(.active) .track-artist,
.audio-side-playlist .soundcloud-track:hover:not(.active) .track-view-count {
  color: #666672;
}

.audio-side-playlist .soundcloud-track.active {
  color: #151517;
  box-shadow: inset 4px 0 0 var(--accent);
}

.audio-side-playlist .soundcloud-track.active .track-index {
  color: var(--accent);
}

.audio-side-playlist .track-view-count {
  color: #85858d;
}

.custom-audio-element {
  display: none;
}

.custom-audio-player {
  display: grid;
  grid-template-columns: 38px auto minmax(120px, 1fr) 38px minmax(90px, 150px) 50px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 7px 12px;
  border: 1px solid #deddd9;
  border-radius: 999px;
  background: #f0f0ed;
  color: #26262b;
  box-shadow: inset 0 1px 2px rgb(24 24 27 / 5%);
}

.custom-audio-player.boosted {
  border-color: #a9c4ff;
  background: var(--vh-accent-soft);
}

.custom-audio-button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #17171a;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.custom-audio-button:hover,
.custom-audio-button:focus-visible {
  background: #fff;
  color: var(--accent-dark);
  outline: 0;
  box-shadow: 0 2px 8px rgb(24 24 27 / 10%);
}

.custom-audio-time,
.custom-audio-volume-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.custom-audio-time {
  color: #55555d;
  font-size: 12px;
  font-weight: 700;
}

.custom-audio-volume-value {
  min-width: 46px;
  color: #55555d;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.custom-audio-player.boosted .custom-audio-volume-value {
  color: var(--accent-dark);
}

.custom-audio-progress,
.custom-audio-volume {
  width: 100%;
  min-width: 0;
  height: 4px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(
    to right,
    var(--accent) 0,
    var(--accent) var(--progress, 0%),
    #c8c9cd var(--progress, 0%),
    #c8c9cd 100%
  );
  cursor: pointer;
}

.custom-audio-progress::-webkit-slider-thumb,
.custom-audio-volume::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  appearance: none;
  background: var(--accent);
  box-shadow: 0 1px 5px rgb(0 48 144 / 25%);
}

.custom-audio-progress::-moz-range-thumb,
.custom-audio-volume::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 5px rgb(0 48 144 / 25%);
}

.custom-audio-progress:focus-visible,
.custom-audio-volume:focus-visible {
  outline: 3px solid rgb(30 86 181 / 20%);
  outline-offset: 5px;
}

@media (max-width: 700px) {
  .video-timestamps-heading,
  .video-timestamp-editor {
    align-items: stretch;
    flex-direction: column;
  }

  .video-timestamp-editor {
    min-width: 0;
    width: 100%;
  }

  .video-timestamp-editor .secondary-action {
    width: 100%;
  }

  .video-timestamps-list {
    display: grid;
  }

  .video-timestamp-item {
    width: 100%;
  }

  .video-timestamp-item > button:first-child {
    flex: 1;
    min-width: 0;
  }

  .custom-audio-player {
    grid-template-columns: 36px auto minmax(0, 1fr) 36px minmax(72px, 90px) 46px;
    grid-template-rows: 18px 36px;
    gap: 6px;
    padding: 9px;
    border-radius: 24px;
  }

  .custom-audio-progress {
    grid-column: 1 / -1;
    grid-row: 1;
    align-self: center;
  }

  .custom-audio-play {
    grid-column: 1;
    grid-row: 2;
  }

  .custom-audio-time {
    grid-column: 2;
    grid-row: 2;
  }

  .custom-audio-mute {
    grid-column: 4;
    grid-row: 2;
  }

  .custom-audio-volume {
    grid-column: 5;
    grid-row: 2;
  }

  .custom-audio-volume-value {
    grid-column: 6;
    grid-row: 2;
  }
}

.album-audio-controls .skip-button,
.album-audio-controls .loop-button,
.audio-player .audio-download-button {
  border: 1px solid #d9d8d4;
  background: #fff;
  color: #28282d;
  box-shadow: 0 3px 10px rgb(24 24 27 / 6%);
}

.album-audio-controls .skip-button:hover,
.album-audio-controls .loop-button:hover,
.audio-player .audio-download-button:hover {
  border-color: #a9c4ff;
  background: var(--vh-accent-soft);
  color: var(--accent-dark);
}

.album-audio-controls .loop-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgb(0 48 144 / 20%);
}

/* Forms, upload, dashboard and profile */

.upload-page {
  width: min(980px, 100%);
  gap: 22px;
}

.upload-tabs,
.video-upload-mode,
.audio-upload-mode {
  border: 0;
  border-radius: 16px;
  padding: 6px;
  background: #eaeae7;
}

/* Audio has four sources: keep them balanced instead of wrapping the last one alone. */
.audio-upload-mode {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.audio-mode-button {
  white-space: nowrap;
}

@media (max-width: 700px) {
  .audio-upload-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.upload-tabs .media-tab,
.video-mode-button,
.audio-mode-button {
  min-height: 48px;
  border-radius: 12px;
}

.video-mode-button.active,
.audio-mode-button.active {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 4px 14px rgb(24 24 27 / 10%);
}

.upload-panel,
.upload-page-panel,
.dashboard-header,
.dashboard-section,
.login-panel {
  border: 1px solid #e3e2de;
  border-radius: var(--vh-radius);
  background: #fff;
  box-shadow: var(--vh-shadow);
}

.upload-page-panel {
  padding: clamp(22px, 4vw, 34px);
}

.upload-page-panel .panel-heading h1 {
  font-size: clamp(25px, 3vw, 31px);
  letter-spacing: -0.025em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
  min-height: 48px;
  border-color: #dcdad5;
  border-radius: 11px;
  background: #fdfdfc;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  border-color: rgb(0 48 144 / 58%);
  background: #fff;
  box-shadow: 0 0 0 4px rgb(0 48 144 / 7%);
}

.paste-button {
  border-radius: 8px;
  background: #171719;
}

.paste-button:hover {
  background: var(--accent);
}

.file-drop {
  border-color: #c9c8c3;
  border-radius: 13px;
  background: #fafaf8;
}

.upload-drop:hover,
.file-drop:hover {
  border-color: var(--accent);
  background: var(--vh-accent-soft);
}

.upload-drop.is-dragging {
  border-color: var(--accent);
  border-style: solid;
  background: #e9f0ff;
  box-shadow: inset 0 0 0 2px rgb(0 48 144 / 14%);
}

.primary-action {
  min-height: 46px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 7px 18px rgb(0 48 144 / 17%);
}

.primary-action:hover {
  background: var(--accent-dark);
  box-shadow: 0 9px 22px rgb(190 18 55 / 22%);
  transform: translateY(-1px);
}

.secondary-action {
  border: 1px solid #d9d8d4;
  border-radius: 999px;
  background: #fff;
  color: #29292e;
}

.secondary-action:hover {
  border-color: #a9c4ff;
  background: var(--vh-accent-soft);
  color: var(--accent-dark);
}

.dashboard-page {
  width: min(1180px, 100%);
  gap: 22px;
}

.dashboard-header,
.dashboard-section {
  padding: clamp(20px, 3vw, 30px);
}

.dashboard-header h1,
.dashboard-section h2 {
  letter-spacing: -0.025em;
}

.dashboard-video-card,
.dashboard-studio-row {
  border-color: #e9e8e5;
}

.dashboard-studio-row:not(.dashboard-studio-head):hover {
  background: #fafaf8;
}

.dashboard-page-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.album-card {
  border-color: #e3e2de;
  border-radius: 13px;
  padding: 12px;
  background: #fff;
}

.album-card:hover,
.album-card.active {
  border-color: #a9c4ff;
  background: var(--vh-accent-soft);
}

.album-icon {
  border-radius: 10px;
}

.track-button {
  border-radius: 9px;
}

.track-button:hover,
.track-button.active {
  background: rgb(0 48 144 / 9%);
  color: var(--accent-dark);
}

.login-page {
  background:
    radial-gradient(circle at 20% 15%, rgb(0 48 144 / 12%), transparent 30rem),
    #f7f7f5;
}

.login-panel {
  border-radius: 22px;
}

.site-footer a {
  color: var(--accent-dark);
}

/* Responsive desktop and tablet */

@media (max-width: 1420px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 470px);
    padding-left: 232px;
  }

  .app-shell:not(.home-mode):has(.player-frame:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell:not(.home-mode):has(.player-frame:not([hidden])) .watch-area {
    width: 100%;
    max-width: none;
  }

  .app-shell:not(.home-mode):has(.player-frame:not([hidden])) .side-panel {
    display: none;
  }

  .app-shell.home-mode {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .app-shell:not(.home-mode) .primary-nav {
    width: 220px;
  }

  .home-video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .home-video-grid.movies-poster-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1550px) {
  .app-shell:not(.home-mode):has(.player-frame.audio-mode:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell:not(.home-mode):has(.player-frame.audio-mode:not([hidden])) .watch-area,
  .app-shell:not(.home-mode):has(.player-frame.audio-mode:not([hidden])) .side-panel {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 1100px) {
  .app-shell,
  .app-shell.guest-mode,
  .app-shell.home-mode,
  .app-shell.nav-collapsed,
  .app-shell.home-mode.nav-collapsed {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 22px;
  }

  .home-feed,
  .home-feed-heading,
  .home-feed-heading > div,
  .home-category-menu,
  .home-video-grid,
  .home-video-card-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .home-feed-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
  }

  .home-feed-heading > div {
    width: 100%;
  }

  .home-category-menu {
    width: 100%;
  }

  .home-category-menu button {
    width: auto;
    min-width: max-content;
  }

  .home-feed-tools {
    width: 100%;
    justify-content: flex-end;
  }

  .home-video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100%;
  }

  .audio-stage {
    display: flex !important;
    width: 100%;
    min-width: 0;
    height: auto;
    flex-direction: column;
    overflow: visible;
    border-radius: 18px;
  }

  .player-frame.audio-mode .audio-player,
  .audio-side-playlist,
  .audio-side-playlist.video-side-playlist {
    position: relative;
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
  }

  .audio-side-playlist,
  .audio-side-playlist.video-side-playlist {
    min-height: 430px;
    max-height: min(50vh, 560px);
    border-top: 1px solid #e2e1dd;
    border-left: 0;
  }

  .video-side-playlist {
    border-top-color: #2b2b30;
  }

  .side-panel {
    max-width: none;
  }

  .video-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 18px;
  }

  .video-card {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }

  .video-card .video-play,
  .video-card > img,
  .video-card .video-thumb {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .topbar,
  .no-header-page .topbar {
    min-height: 68px;
  }

  .primary-nav,
  .app-shell.home-mode .primary-nav,
  .app-shell:not(.home-mode) .primary-nav {
    top: auto;
    border-radius: 18px;
    background: rgb(255 255 255 / 98%);
    box-shadow: 0 -20px 54px rgb(24 24 27 / 18%);
  }

  .app-shell:not(.mobile-subscriptions-open) .primary-nav {
    visibility: hidden;
    border-color: transparent;
    opacity: 0;
  }

  .app-shell.mobile-subscriptions-open .primary-nav {
    visibility: visible;
    border-color: var(--line);
    opacity: 1;
  }

  .mobile-bottom-nav {
    min-height: calc(70px + env(safe-area-inset-bottom));
    border-top-color: #e2e1dd;
    background: rgb(255 255 255 / 94%);
    box-shadow: 0 -7px 22px rgb(24 24 27 / 6%);
  }

  .mobile-bottom-link {
    border-radius: 12px;
  }

  .mobile-bottom-link.active {
    color: var(--accent);
  }

  .home-category-menu {
    display: flex;
    width: 100%;
  }

  .audio-player {
    min-height: 500px;
  }

  .audio-side-playlist {
    min-height: clamp(440px, 52vh, 620px);
    max-height: clamp(440px, 52vh, 620px);
  }

  .upload-page,
  .dashboard-page {
    padding-inline: 22px;
  }
}

@media (max-width: 720px) {
  .app-shell,
  .app-shell.guest-mode,
  .app-shell.home-mode,
  .app-shell.nav-collapsed,
  .app-shell.home-mode.nav-collapsed {
    padding-inline: 14px;
  }

  .home-video-grid,
  .home-video-grid.movies-poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .video-list {
    grid-template-columns: 1fr;
  }

  .video-card {
    grid-template-columns: minmax(150px, 42%) minmax(0, 1fr);
    min-height: 96px;
  }

  .video-player-shell,
  .video-playlist-stage,
  .audio-stage {
    border-radius: 14px;
  }
}

@media (max-width: 560px) {
  .topbar,
  .no-header-page .topbar {
    padding: 7px 12px 10px;
  }

  .brand-logo {
    width: 74px;
    height: 50px;
  }

  .site-search {
    height: 42px;
  }

  .home-feed {
    gap: 18px;
  }

  .home-feed-heading h1 {
    font-size: 27px;
  }

  .home-category-menu {
    width: calc(100vw - 28px);
    gap: 8px;
  }

  .home-category-menu button {
    width: auto;
    min-height: 36px;
    padding-inline: 15px;
  }

  .home-video-grid,
  .home-video-grid.movies-poster-grid {
    grid-template-columns: 1fr !important;
    gap: 28px;
  }

  .home-thumb,
  .video-player-shell,
  .video-playlist-stage,
  .audio-stage {
    border-radius: 12px;
  }

  .video-card {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 11px;
    min-height: 82px;
  }

  .video-card h3 {
    font-size: 14px;
  }

  .audio-player {
    grid-template-columns: 96px minmax(0, 1fr) !important;
    min-height: 0;
    padding: 24px 18px;
  }

  .audio-player .album-art {
    grid-column: 1;
    min-width: 0;
  }

  .audio-player .audio-copy {
    grid-column: 2;
    width: auto;
    min-width: 0;
  }

  .audio-player .waveform,
  .audio-player .audio-controls-row {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .audio-player h2 {
    font-size: clamp(28px, 9vw, 40px);
    overflow-wrap: anywhere;
  }

  .audio-side-playlist {
    position: relative;
    min-height: min(54vh, 520px);
    max-height: min(54vh, 520px);
  }

  .album-audio-controls .audio-player-actions {
    gap: 9px;
  }

  .upload-page,
  .dashboard-page {
    padding: 14px;
  }

  .upload-page-panel,
  .dashboard-header,
  .dashboard-section {
    border-radius: 14px;
  }

  .primary-action {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
.dashboard-discogs-reference {
  width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e4e4e7);
}

.dashboard-discogs-reference summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--accent, #0645ad);
}

.dashboard-discogs-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.dashboard-discogs-heading a {
  color: inherit;
  font-weight: 800;
}

.dashboard-discogs-tracks {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border, #e4e4e7);
  border-radius: 14px;
  overflow: hidden;
}

.dashboard-discogs-tracks li {
  display: grid;
  grid-template-columns: minmax(38px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
}

.dashboard-discogs-tracks li + li {
  border-top: 1px solid var(--border, #e4e4e7);
}

.dashboard-discogs-tracks strong,
.dashboard-discogs-tracks small {
  display: block;
}

.dashboard-discogs-tracks small {
  margin-top: 3px;
  color: var(--muted, #71717a);
}

.dashboard-discogs-position {
  color: var(--muted, #71717a);
  font-weight: 800;
}

.compact-action {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

@media (max-width: 720px) {
  .dashboard-discogs-tracks li {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .dashboard-discogs-tracks .compact-action {
    grid-column: 2;
    justify-self: start;
  }
}
.playlist-url-input-wrap {
  position: relative;
  display: block;
}

.playlist-url-input-wrap input {
  width: 100%;
  padding-right: 86px;
}

.playlist-url-paste {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 68px;
  min-height: 38px;
  padding: 7px 12px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: var(--accent, #0645ad);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.playlist-url-paste:hover {
  filter: brightness(1.08);
}

.playlist-url-paste:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #0645ad) 28%, transparent);
  outline-offset: 2px;
}

/* YouTube-style watch layout: player left, playlist and related videos right. */
.app-shell:not(.home-mode):has(.player-frame:not([hidden]):not(.audio-mode)) .side-panel {
  display: grid;
  width: 100%;
  max-width: none;
}

/*
 * Album pages use the ultrawide space as one large listening column. This gives
 * the tracklist room to breathe and keeps recommendations below the complete
 * player instead of splitting attention into a third column.
 */
@media (min-width: 1551px) {
  .app-shell:not(.home-mode):has(.player-frame.audio-mode:not([hidden])) {
    grid-template-columns: minmax(0, 1600px);
  }

  .app-shell:not(.home-mode):has(.player-frame.audio-mode:not([hidden])) .watch-area,
  .app-shell:not(.home-mode):has(.player-frame.audio-mode:not([hidden])) .side-panel {
    width: 100%;
    max-width: none;
  }

  .app-shell:not(.home-mode):has(.player-frame.audio-mode:not([hidden])) .side-panel {
    grid-column: 1;
    margin-top: 18px;
  }

  .player-frame.audio-mode .audio-stage {
    grid-template-columns: minmax(0, 1fr) minmax(440px, 480px);
  }

  .app-shell:not(.home-mode):has(.player-frame.audio-mode:not([hidden])) #videosPanel .video-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 28px;
  }
}

@media (min-width: 1281px) {
  .app-shell:not(.home-mode):has(.player-frame:not([hidden]):not(.audio-mode)) {
    grid-template-columns: minmax(0, 1100px) clamp(360px, 28vw, 500px);
    align-items: start;
    justify-content: center;
  }

  .app-shell:not(.home-mode):has(.player-frame:not([hidden]):not(.audio-mode)) .watch-area {
    width: 100%;
    max-width: 1100px;
  }

  .app-shell:not(.home-mode):has(.player-frame:not([hidden]):not(.audio-mode)) .side-panel {
    grid-column: 2;
    gap: 22px;
    margin-top: 0;
  }

  .video-playlist-main .video-player-shell {
    border-radius: 18px;
  }

.watch-playlist-panel {
    min-height: 0;
    max-height: none;
    border: 1px solid #2b2b30;
    border-radius: 18px;
  }

  .watch-playlist-panel .audio-side-heading {
    min-height: 94px;
    padding: 18px 22px;
  }

  .watch-playlist-panel .audio-side-heading h3 {
    font-size: 19px;
  }

  .watch-playlist-panel .video-playlist-track {
    grid-template-columns: 30px 82px minmax(0, 1fr);
    min-height: 74px;
    gap: 3px 12px;
    padding: 9px 16px;
  }

  .watch-playlist-panel .track-title {
    font-size: 15px;
  }

  #videosPanel .library-heading {
    padding: 0 0 10px;
  }

  #videosPanel .library-heading h2 {
    font-size: 23px;
  }

  #videosPanel .video-card {
    grid-template-columns: minmax(180px, 46%) minmax(0, 1fr);
  }
}

/* Theme switcher and dark theme */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.theme-toggle:hover,
.theme-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--vh-accent-soft);
  color: var(--accent-dark);
}

.theme-toggle-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  font-size: 17px;
  line-height: 1;
}

.login-theme-toggle {
  position: fixed;
  top: 20px;
  right: clamp(16px, 4vw, 40px);
  z-index: 5;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #181b21;
  --ink: #f3f4f6;
  --muted: #a6adba;
  --line: #303641;
  --accent: #78a7ff;
  --accent-dark: #a9c5ff;
  --focus: #78a7ff;
  --vh-soft: #232832;
  --vh-accent-soft: #1d3157;
  --vh-panel-strong: #20242c;
  --vh-shadow: 0 14px 38px rgb(0 0 0 / 28%);
  --vh-shadow-hover: 0 20px 46px rgb(0 0 0 / 38%);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% -10%, rgb(48 91 170 / 16%), transparent 28rem),
    var(--bg);
  color: var(--ink);
}

:root[data-theme="dark"] .site-footer,
:root[data-theme="dark"] .site-footer a {
  color: var(--muted);
}

:root[data-theme="dark"] .site-footer a:hover,
:root[data-theme="dark"] .site-footer a:focus-visible {
  color: var(--accent);
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .no-header-page .topbar {
  border-bottom-color: rgb(48 54 65 / 88%);
  background: rgb(18 21 27 / 90%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 4%);
}

:root[data-theme="dark"] .no-header-page .topbar {
  background: transparent;
  box-shadow: none;
}

:root[data-theme="dark"] .site-search,
:root[data-theme="dark"] .search-history-dropdown,
:root[data-theme="dark"] .account-menu-panel,
:root[data-theme="dark"] .upload-menu-panel,
:root[data-theme="dark"] .notification-panel {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 18px 45px rgb(0 0 0 / 35%);
}

:root[data-theme="dark"] .site-search {
  background: #20242b;
}

:root[data-theme="dark"] .site-search:focus-within {
  border-color: rgb(120 167 255 / 70%);
  background: #242a34;
}

:root[data-theme="dark"] .site-search input,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  color: var(--ink);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  border-color: var(--line);
  background: #20242b;
  color-scheme: dark;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #858e9d;
}

:root[data-theme="dark"] .sidebar-toggle:hover,
:root[data-theme="dark"] .sidebar-toggle[aria-pressed="true"],
:root[data-theme="dark"] .account-button,
:root[data-theme="dark"] .logout-button,
:root[data-theme="dark"] .secondary-action,
:root[data-theme="dark"] .media-tab,
:root[data-theme="dark"] .video-mode-button,
:root[data-theme="dark"] .dashboard-page-button,
:root[data-theme="dark"] .download-all-button {
  background: #252a33;
  color: var(--ink);
}

:root[data-theme="dark"] .account-button:hover,
:root[data-theme="dark"] .logout-button:hover,
:root[data-theme="dark"] .secondary-action:hover,
:root[data-theme="dark"] .media-tab:hover,
:root[data-theme="dark"] .video-mode-button:hover:not(.active),
:root[data-theme="dark"] .dashboard-page-button:hover:not(:disabled),
:root[data-theme="dark"] .download-all-button:hover {
  background: #303744;
  color: var(--accent-dark);
}

:root[data-theme="dark"] .primary-nav,
:root[data-theme="dark"] .side-panel,
:root[data-theme="dark"] .media-panel,
:root[data-theme="dark"] .library,
:root[data-theme="dark"] .home-video-card,
:root[data-theme="dark"] .video-card,
:root[data-theme="dark"] .album-card,
:root[data-theme="dark"] .dashboard-header,
:root[data-theme="dark"] .dashboard-section,
:root[data-theme="dark"] .upload-panel,
:root[data-theme="dark"] .upload-page-panel,
:root[data-theme="dark"] .login-panel {
  border-color: var(--line) !important;
  background-color: var(--panel) !important;
  color: var(--ink);
  box-shadow: var(--vh-shadow);
}

:root[data-theme="dark"] .primary-nav,
:root[data-theme="dark"] .mobile-bottom-nav {
  background: rgb(24 27 33 / 98%) !important;
}

:root[data-theme="dark"] .mobile-bottom-nav {
  border-top-color: var(--line);
  box-shadow: 0 -12px 30px rgb(0 0 0 / 30%);
}

:root[data-theme="dark"] .primary-nav-link,
:root[data-theme="dark"] .you-nav-item,
:root[data-theme="dark"] .mobile-bottom-link,
:root[data-theme="dark"] .search-history-option,
:root[data-theme="dark"] .account-menu-panel a,
:root[data-theme="dark"] .account-menu-panel button,
:root[data-theme="dark"] .upload-menu-panel a {
  color: var(--ink);
}

:root[data-theme="dark"] .primary-nav-link:hover,
:root[data-theme="dark"] .primary-nav-link.active,
:root[data-theme="dark"] .you-nav-item:hover,
:root[data-theme="dark"] .mobile-bottom-link:hover,
:root[data-theme="dark"] .search-history-row:hover,
:root[data-theme="dark"] .search-history-row.active,
:root[data-theme="dark"] .account-menu-panel a:hover,
:root[data-theme="dark"] .account-menu-panel button:hover,
:root[data-theme="dark"] .upload-menu-panel a:hover {
  background: #252a33;
  color: var(--accent-dark);
}

:root[data-theme="dark"] .home-feed-heading h1,
:root[data-theme="dark"] .home-feed-heading h2,
:root[data-theme="dark"] .library-heading h2,
:root[data-theme="dark"] .video-card h3,
:root[data-theme="dark"] .home-video-card h3,
:root[data-theme="dark"] .dashboard-header h1,
:root[data-theme="dark"] .dashboard-section h2,
:root[data-theme="dark"] .upload-page-panel h1,
:root[data-theme="dark"] .login-panel h1,
:root[data-theme="dark"] .panel-heading h1,
:root[data-theme="dark"] .panel-heading h2 {
  color: var(--ink) !important;
}

:root[data-theme="dark"] .home-video-card p,
:root[data-theme="dark"] .video-card p,
:root[data-theme="dark"] .dashboard-header p,
:root[data-theme="dark"] .dashboard-section p,
:root[data-theme="dark"] .panel-heading p,
:root[data-theme="dark"] .upload-navigation-copy span,
:root[data-theme="dark"] .video-uploader,
:root[data-theme="dark"] .video-meta,
:root[data-theme="dark"] small {
  color: var(--muted);
}

:root[data-theme="dark"] a:not(.upload-toggle):not(.login-link):not(.primary-action) {
  color: var(--accent-dark);
}

:root[data-theme="dark"] .theme-toggle {
  border-color: #465168;
  background: #202630;
  color: #eef3ff;
}

:root[data-theme="dark"] .theme-toggle:hover,
:root[data-theme="dark"] .theme-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: #293e68;
  color: #fff;
}

:root[data-theme="dark"] .login-page {
  background:
    radial-gradient(circle at 20% 15%, rgb(48 91 170 / 25%), transparent 30rem),
    var(--bg);
}

:root[data-theme="dark"] .login-theme-toggle {
  background: #202630;
}

@media (max-width: 560px) {
  .theme-toggle {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .theme-toggle-label {
    display: none;
  }

  .login-theme-toggle {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 1280px) {
  .app-shell:not(.home-mode):has(.player-frame:not([hidden]):not(.audio-mode)) .side-panel {
    grid-column: 1;
    margin-top: 24px;
  }

  .watch-area > .watch-playlist-panel {
    width: 100%;
    margin-top: 12px;
  }

  .watch-playlist-panel {
    min-height: 430px;
    max-height: min(56vh, 560px);
    border: 1px solid #2b2b30;
    border-radius: 18px;
  }
}
