/* StepMom Porn Platform Design — Adapté de Nimbus Design System
   Clean, minimal, dark theme, hairline borders, no gradients */

:root {
  --bg: #0F0F0F;
  --surface: #181818;
  --surface-hover: #272727;
  --border: #3F3F3F;
  --text: #F1F1F1;
  --text-muted: #AAAAAA;
  --accent: #FFB700;
  --accent-text: #0F0F0F;
  --header-h: 56px;
  --sidebar-w: 240px;
  --sidebar-rail-w: 72px;
  --radius-card: 12px;
  --radius-pill: 20px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, p {
  margin: 0;
}

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Scrollbars */
html, body {
  scrollbar-width: none;
}

html::-webkit-scrollbar, body::-webkit-scrollbar {
  display: none;
}

::-webkit-scrollbar {
  display: none;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-text);
  padding: 8px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
  font-size: 14px;
}

.skip-link:focus {
  left: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.icon {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  transition: background 0.2s ease;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 19px;
  font-weight: 500;
  white-space: nowrap;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.search-form {
  flex: 1;
  max-width: 640px;
  display: flex;
  align-items: center;
  margin: 0 auto;
}

.search-form input {
  flex: 1;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  padding: 0 var(--space-4);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  border-right: none;
  min-width: 0;
}

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

.search-form button[type="submit"] {
  height: 38px;
  width: 52px;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  background: var(--surface-hover);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.search-form button[type="submit"]:hover {
  background: var(--border);
}

.search-close-btn {
  display: none;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.search-icon-btn {
  display: none;
}

/* ---------- Shell / Sidebar ---------- */
.app-shell {
  display: flex;
  align-items: flex-start;
}

.sidebar-scrim {
  display: none;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: var(--space-3) var(--space-2);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-rail-w);
}

body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .channel-row span {
  display: none;
}

body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .channel-row {
  justify-content: center;
  padding: 0;
}

.sidebar-section {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-card);
  font-size: 14px;
  transition: background 0.2s ease;
  color: var(--text);
}

.nav-item:hover {
  background: var(--surface-hover);
}

.nav-item.active {
  background: var(--surface-hover);
  font-weight: 500;
  color: var(--accent);
}

.nav-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.menu-icon {
  font-size: 20px;
  line-height: 1;
}

.sidebar-heading {
  margin: 0 12px 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.sidebar-category-menu {
  position: relative;
}

.category-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  font: inherit;
}

.nav-caret {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.sidebar-category-menu:hover .nav-caret,
.sidebar-category-menu:focus-within .nav-caret {
  transform: rotate(180deg);
}

.category-dropdown {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% + 8px);
  background: rgba(15, 15, 20, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 8px 0;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
}

.sidebar-category-menu:hover .category-dropdown,
.sidebar-category-menu:focus-within .category-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.sidebar-categories a,
.sidebar-categories li,
.category-dropdown a {
  display: block;
  padding: 7px 12px;
  color: var(--text-muted);
  font-size: 13px;
  transition: background 0.2s ease, color 0.2s ease;
}

.category-dropdown a {
  width: 100%;
  color: var(--text);
  text-decoration: none;
}

.category-dropdown a:hover {
  background: var(--surface-hover);
  color: var(--accent);
}

body.sidebar-collapsed .sidebar-category-menu {
  position: static;
}

body.sidebar-collapsed .category-dropdown {
  left: calc(var(--sidebar-rail-w) + 8px);
  right: auto;
  top: 0;
  width: min(220px, calc(100vw - 120px));
}

.site-footer {
  padding: 24px 16px 32px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.channel-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-card);
  font-size: 13px;
  transition: background 0.2s ease;
  color: var(--text);
}

.channel-row:hover {
  background: var(--surface-hover);
}

.channel-row span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

main {
  flex: 1;
  min-width: 0;
  padding: var(--space-5);
}

/* ---------- Avatars & thumbnails ---------- */
.avatar {
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 500;
  flex-shrink: 0;
}

.avatar-24 {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.avatar-32 {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.avatar-36 {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.avatar-40 {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.thumb-wrap {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface-hover);
}

.thumb {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.duration-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.5;
}

@media (hover: hover) {
  .video-card:hover .thumb {
    transform: scale(1.03);
  }
}

/* ---------- Chip filter row ---------- */
.chip-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-4);
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: pointer;
}

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

.chip.selected {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* ---------- Video grid & card ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5) var(--space-4);
  width: 100%;
}

.video-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

.video-card .thumb-wrap {
  display: block;
  border-radius: 0;
}

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

.video-card:hover .video-thumb {
  transform: scale(1.03);
}

.video-badges {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  left: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.video-badges > span {
  padding: 3px 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.78);
}

.video-badges .duration-badge {
  position: static;
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1.4;
}

.video-card-body {
  min-height: 88px;
  padding: var(--space-3) var(--space-3) var(--space-4);
}

.video-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-title:hover {
  color: var(--accent);
}

.video-description {
  margin-top: var(--space-2);
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-grid > p {
  grid-column: 1 / -1;
  padding: var(--space-6);
  color: var(--text-muted);
  text-align: center;
}

.watch-main {
  max-width: 1180px;
}

.watch-player {
  width: 100%;
  overflow: hidden;
  background: #000;
  border-radius: var(--radius-card);
  aspect-ratio: 16 / 9;
}

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

.watch-info {
  padding: var(--space-4) 0 var(--space-6);
  border-bottom: 1px solid var(--border);
}

.watch-title {
  margin: 0 0 var(--space-2);
  color: var(--text);
  font-size: 22px;
  line-height: 1.3;
}

.watch-stats {
  color: var(--text-muted);
  font-size: 13px;
}

.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.watch-action {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
}

.watch-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.watch-recommendations-title {
  margin-top: var(--space-6);
}

.page-title {
  margin: 0 0 var(--space-2);
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
}

.page-subtitle {
  margin: 0 0 var(--space-5);
  color: var(--text-muted);
  font-size: 14px;
}

.gaming-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.gaming-pagination a,
.gaming-pagination span {
  min-width: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-align: center;
}

.gaming-pagination a:hover,
.gaming-pagination .bg-white\/15 {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 1439px) {
  main {
    padding: var(--space-4);
  }
}

@media (max-width: 1023px) {
  .sidebar {
    width: var(--sidebar-rail-w);
  }

  .sidebar .nav-label,
  .sidebar .channel-row span {
    display: none;
  }

  .sidebar .nav-item,
  .sidebar .channel-row {
    justify-content: center;
    padding: 0;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-4) var(--space-3);
  }
}

@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: 260px;
    height: auto;
    background: var(--surface);
    transform: translateX(-100%);
    z-index: 40;
    transition: transform 0.2s ease;
    border-right: 1px solid var(--border);
  }

  .sidebar .nav-label,
  .sidebar .channel-row span {
    display: inline;
  }

  .sidebar .nav-item,
  .sidebar .channel-row {
    justify-content: flex-start;
    padding: 0 var(--space-3);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-scrim {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 35;
  }

  main {
    padding: var(--space-4);
  }

  .search-form {
    display: none;
  }

  .search-icon-btn {
    display: grid;
  }

  body.search-open .header-left,
  body.search-open .header-right {
    display: none;
  }

  body.search-open .search-form {
    display: flex;
    flex: 1;
    max-width: none;
  }

  body.search-open .search-close-btn {
    display: grid;
    place-items: center;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-3);
  }

  .watch-title {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .upload-icon-btn {
    display: none;
  }

  main {
    padding: var(--space-3);
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-3);
  }

  .chip-row {
    margin-bottom: var(--space-3);
  }
}
