:root {
  --bg: #02010f;
  --fg: #eaeaea;
  --muted: #a7a7a7;
  --accent: #ff3b3b;
  --card: #161616;
  --blur-bg: rgba(0,0,0,.5);
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --fg: #101010;
  --muted: #4d4d4d;
  --card: #f4f4f4;
  --blur-bg: rgba(255,255,255,.6);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.header {
  position: sticky; top: 0; z-index: 50;
  display: flex; gap: 12px; align-items: center;
  padding: 10px 16px;
  background: var(--blur-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.header .logo { font-weight: 800; letter-spacing: .5px; }
.header .search { flex: 1; }
.header input[type="text"] {
  width: 100%; padding: 10px 12px; border: 1px solid #333; border-radius: 8px;
  background: var(--card); color: var(--fg);
}

.layout {
  display: grid; grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky; top: 52px; height: calc(100vh - 52px);
  padding: 16px;
  background: var(--blur-bg);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255,255,255,.07);
}
.sidebar a { display: block; color: var(--fg); text-decoration: none; padding: 8px 0; opacity:.9 }
.sidebar a:hover { opacity: 1 }

main { padding: 16px; }
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ---- карточки фильмов ---- */
/*========== MOVIE CARD ==========*/
.movie-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  display: block;
  background: #000;
  cursor: pointer;
  transition: transform .25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
}

.poster-wrap {
  position: relative;
}

.poster-img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}

/* Градиент снизу */
.gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 40%, rgb(0 0 0 / 80%) 70%);
  pointer-events: none;
}

/* Текст */
.info {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 5;
  color: #fff;
}

.info .title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

.info .bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Год */
.year {
  font-size: 14px;
  opacity: .9;
  font-weight: 600;
}

/*========== RATING CIRCLE SMALL ==========*/
.sm-rating-circle {
  width: 32px;
  height: 32px;
}

.sm-rating-circle svg text {
  font-size: 10px;
}

.sm-rating-circle svg .bg {
  stroke-width: 4;
  stroke: rgba(255,255,255,0.2);
}

.sm-rating-circle svg .progress {
  stroke-width: 4;
  stroke: #2196F3;
}

/*========== PLAY ICON ==========*/
.play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  background: rgba(0,0,0,0.45);
  transition: .25s ease;
}

.play-icon i {
  font-size: 42px;
  color: #1ea0ff;
  
}

/* ПРИ НАВЕДЕНИИ */
.movie-card:hover .play-icon {
  opacity: 1;
}

/*========== DISABLE HOVER ON MOBILE ==========*/
@media (hover: none) {
  .movie-card:hover .play-icon {
    opacity: 0;
  }
  .movie-card:hover {
    transform: none;
  }
}


/* ---- пагинация ---- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 40px 0 20px;
}

.pagination .page {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.08);
  transition: all .25s ease;
}

.pagination .page:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 6px rgba(255,59,59,.4);
}

.pagination .page.current {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(255,59,59,.5);
  pointer-events: none;
}

.pagination .dots {
  color: var(--muted);
  padding: 0 4px;
}

.progress-bar {
  height: 12px; background: #232323; border-radius: 999px; overflow: hidden; border:1px solid #333;
}
.progress-bar > span { display:block; height:100%; background: var(--accent); width: 0%; }

.footer { padding: 40px 16px; color: var(--muted); text-align:center }

@media (max-width: 1024px){
  .layout { grid-template-columns: 64px 1fr; }
  .sidebar { padding: 12px; }
}
