/* Categories page (Tubi-ish dark theme + fast carousel UX) */

:root {
  --bg: #0b0b0f;
  --panel: #12121a;
  --card: #171724;
  --text: #f5f5f7;
  --muted: #b6b6c3;
  --accent: #7b2cff; /* purple accent */
  --accent2: #a56bff;
  --shadow: 0 10px 30px rgba(0,0,0,0.45);
}

body {
  background: var(--bg);
  color: var(--text);
}

.container {
  padding: 20px;
  max-width: 1300px;
  margin: 0 auto;
}

h1 {
  margin: 8px 0 18px;
  letter-spacing: 0.3px;
}

.category {
  position: relative;
  margin-bottom: 34px;
}

.category h2 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}

/* Horizontal carousel */
.movies-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 44px; /* room for arrows */
  scroll-behavior: smooth;
}

.movies-scroll::-webkit-scrollbar {
  height: 10px;
}
.movies-scroll::-webkit-scrollbar-thumb {
  background: rgba(123, 44, 255, 0.35);
  border-radius: 999px;
}

.movies {
  display: flex;
  gap: 12px;
}

.movie {
  min-width: 180px;
  max-width: 180px;
}

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

.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateZ(0);
  transition: transform 140ms ease, border-color 140ms ease;
}

.card:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(165, 107, 255, 0.55);
}

.poster {
  width: 100%;
  height: 270px;
  object-fit: cover;
  display: block;
  background: #0f0f16;
}

.meta {
  padding: 10px 10px 12px;
}

.year {
  font-weight: 700;
  font-size: 12px;
  margin: 0 0 4px;
  color: var(--accent2);
}

.title {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* description visible (3-line clamp) */
.description {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.25;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

/* Arrows */
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(18,18,26,0.85);
  color: var(--text);
  cursor: pointer;
  z-index: 2;
  display: grid;
  place-items: center;
  user-select: none;
  transition: background 140ms ease, border-color 140ms ease;
}

.arrow:hover {
  background: rgba(123, 44, 255, 0.22);
  border-color: rgba(165, 107, 255, 0.55);
}

.arrow-left { left: 6px; }
.arrow-right { right: 6px; }

/* Skeleton placeholders */
.movie.is-skeleton .card {
  border-color: rgba(255,255,255,0.06);
}

.skel-poster {
  height: 270px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 37%, rgba(255,255,255,0.06) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
}

.skel-line {
  height: 12px;
  margin-top: 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 37%, rgba(255,255,255,0.06) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
}

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

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.back-to-top:hover {
  background: var(--accent2);
}
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
