/* style.css — KinoFoxMedia (desktop + mobile) */

/* ========== ROOT / RESET ========== */

:root {
  --bg-color: #000000;
  --bg-elevated: #141414;
  --accent: #ff1a2a;
  --accent-hover: #ff4b5c;
  --text-main: #ffffff;
  --text-muted: #b3b3b3;
  --card-bg: #181818;
  --radius-lg: 12px;
  --radius-md: 8px;
  --transition-fast: 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { height: 100%; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
}

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

/* ========== HEADER ========== */

header {
  position: sticky;
  top: 0;
  z-index: 1005;
  background: linear-gradient(to bottom, rgba(0,0,0,0.95), rgba(0,0,0,0.6), transparent);
  padding: 14px 1.8vw 8px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 1.1rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.brand-logo {
  background: radial-gradient(circle at 20% 0%, #ff4b5c 0, #ff1a2a 40%, #250008 100%);
  box-shadow: 0 0 18px rgba(255, 40, 60, .7);
}

.logo-text {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.logo-kino { color: #ffffff; }

.logo-media {
  background: linear-gradient(135deg, #ff4b5c, #ff1a2a);
  -webkit-background-clip: text;
  color: transparent;
}

.header-right {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

nav {
  display: flex;
  gap: 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  align-items: center;
}

nav a.nav-link {
  position: relative;
  padding-bottom: 2px;
}

nav a.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff1a2a, #8b0000);
  transition: width var(--transition-fast);
}

nav a.nav-link:hover { color: var(--text-main); }
nav a.nav-link:hover::after { width: 100%; }

nav a.nav-link.active { color: var(--text-main); }
nav a.nav-link.active::after { width: 100%; }

/* (если где-то есть кнопка-лупа в навигации) */
.nav-search-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.nav-search-btn:hover {
  color: var(--text-main);
  transform: translateY(-1px);
}

/* Right tools */
.header-right-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.18);
}

.lang-btn {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
}

.lang-btn.active {
  opacity: 1;
  color: #ffffff;
}

.lang-sep { opacity: 0.4; }

.header-account{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: #060509;
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 0.85rem;
  text-decoration: none;
  color: #ffffff;
  max-width: 180px;
  white-space: nowrap;
}

.header-account:hover{ background: rgba(255,255,255,0.06); }

.header-avatar{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #1d1d25;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
  flex-shrink: 0;
}

.header-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-account-name{
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-auth {
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff1a2a, #8b0000);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(0,0,0,0.85);
  white-space: nowrap;
  border: none;
}

.btn-auth:hover { filter: brightness(1.05); }

/* ========== MENU BACKDROP (BLUR LAYER) ========== */

.menu-backdrop{
  position: fixed;
  inset: 0;
  z-index: 1000;

  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;

  background: rgba(0,0,0,0.35);

  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
}

.menu-backdrop.show{
  opacity: 1;
  pointer-events: auto;
}

/* ========== MAIN LAYOUT ========== */

.page { padding: 0 1.8vw 40px; }

/* ========== HERO ========== */

.hero {
  position: relative;
  margin-top: -16px;
  padding-top: 80px;
  padding-bottom: 30px;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at 10% 0%, #260000, #000000);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to right,
    rgba(0,0,0,0.95),
    rgba(0,0,0,0.4),
    rgba(0,0,0,0.96)
  );
}

.hero-title {
  font-size: clamp(2.1rem, 3.4vw, 3rem);
  font-weight: 800;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 18px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.8rem;
}

.hero-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

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

.btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              background var(--transition-fast),
              color var(--transition-fast),
              filter var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, #ff1a2a, #8b0000);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.7);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(0,0,0,0.9);
}

.btn-ghost {
  background: rgba(0,0,0,0.78);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.22);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

.hero-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.hero-poster {
  justify-self: end;
  max-width: 360px;
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 24px;
  background: #000;
  position: relative;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0,0,0,0.9);
}

.hero-poster-inner {
  position: absolute;
  inset: 1px;
  border-radius: 22px;
  background: radial-gradient(circle at top, #ff1a2a, #400000, #050509);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-poster-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.hero-poster-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.hero-poster-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.badge-hd {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.15);
}

.age {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(238, 238, 238, 0.12);
}

/* ========== CATALOG ========== */

.section { margin-top: 6px; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 14px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.section-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* SEARCH (single block, JS moves it) */
.search-wrapper {
  margin-left: 16px;
  min-width: 260px;
  position: relative;
}

.search-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.search-input {
  flex: 1 1 auto;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.9);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}

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

.btn-search {
  padding-inline: 14px;
  white-space: nowrap;
}

.btn-reset {
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
}

.btn-reset.hidden { display: none; }

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: rgba(0,0,0,0.98);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 18px 40px rgba(0,0,0,0.9);
  padding: 6px 0;
  z-index: 20;
  font-size: 0.85rem;
}

.search-suggestions.hidden { display: none; }

.suggest-header {
  padding: 4px 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.suggest-item {
  padding: 6px 12px 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suggest-item:hover { background: rgba(255,255,255,0.06); }

.suggest-title { font-weight: 500; }

.suggest-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              filter var(--transition-fast);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.9);
  filter: brightness(1.05);
}

.card-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  background: radial-gradient(circle at 20% 0%, #ff4b5c, #8b0000, #050509);
  background-size: cover;
  background-position: center;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0, rgba(0,0,0,0.1) 60%);
}

.card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
  font-size: 32px;
}

.card:hover .card-play { opacity: 1; }

.card-body { padding: 8px 10px 11px; }

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.loader {
  text-align: center;
  padding: 16px 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.loader.hidden { display: none; }

footer {
  padding: 20px 1.8vw 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========== BURGER BUTTON ========== */

.burger {
  display: none;
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.7);
  cursor: pointer;
  flex-shrink: 0;
}

.burger span,
.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: #ffffff;
  border-radius: 999px;
  transition:
    transform .25s ease,
    opacity .25s ease,
    top .25s ease,
    bottom .25s ease;
}

.burger span {
  top: 50%;
  transform: translateY(-50%);
}

.burger::before { top: 10px; }
.burger::after  { bottom: 10px; }

.burger.open span {
  opacity: 0;
  transform: translateY(-50%) scaleX(0.4);
}

.burger.open::before {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.burger.open::after {
  bottom: auto;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

body.menu-open { overflow: hidden; }

/* ========== MOBILE ========== */

@media (max-width: 900px) {

  header {
    padding: 10px 12px 6px;
    justify-content: space-between;
    background: linear-gradient(
      to bottom,
      rgba(0,0,0,0.98),
      rgba(0,0,0,0.82),
      rgba(0,0,0,0.4)
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .logo {
    font-size: 0.95rem;
    gap: 4px;
  }

  .logo-mark {
    width: 24px;
    height: 24px;
    font-size: 16px;
  }

  .burger {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: 2px;
    z-index: 1001;
  }

  /* МЕНЮ: само прозрачное. Blur делает .menu-backdrop */
  .header-right {
    position: fixed;
    inset: 0;
    z-index: 1000;

    background: transparent;

    padding: 80px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;

    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;

    overflow-y: auto;
  }

  .header-right.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .header-center {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  header nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.95rem;
    width: 100%;
  }

  header nav a.nav-link { padding: 6px 0; }
  header nav a.nav-link::after { height: 1px; }

  .nav-search-btn {
    justify-content: flex-start;
    padding-left: 0;
  }

  /* Поисковик на мобилке будет над каталогом, но стили остаются */
  .search-wrapper {
    margin-left: 0;
    width: 100%;
    min-width: 0;
  }

  .search-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .search-input {
    width: 100%;
    font-size: 0.85rem;
    padding: 8px 11px;
  }

  .btn-search,
  .btn-reset {
    width: 100%;
    justify-content: center;
  }

  .search-suggestions {
    left: 0;
    right: 0;
    margin-top: 2px;
    border-radius: 12px;
    max-height: 220px;
    font-size: 0.8rem;
  }

  .header-right-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    width: 100%;
  }

  .lang-toggle { align-self: flex-start; }

  .header-account,
  .btn-auth {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .page { padding: 0 12px 26px; }

  .hero {
    margin-top: 0;
    padding-top: 70px;
    padding-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .hero-poster {
    order: -1;
    max-width: 220px;
    margin: 0 auto 4px;
    border-radius: 18px;
  }

  .hero-poster-inner {
    border-radius: 16px;
    padding: 12px 12px 14px;
  }

  .hero-title {
    font-size: 1.6rem;
    margin-bottom: 6px;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 10px;
  }

  .hero-tags {
    font-size: 0.7rem;
    gap: 6px;
    margin-bottom: 12px;
  }

  .hero-tag { padding: 3px 8px; }

  .hero-actions {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .btn {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .btn-primary {
    flex: 1;
    justify-content: center;
  }

  .hero-badge {
    font-size: 0.72rem;
    margin-top: 6px;
  }

  .section { margin-top: 6px; }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px; /* важно: чтоб поисковик красиво сел над каталогом */
  }

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

  .card { border-radius: 12px; }

  .card-body { padding: 6px 7px 7px; }

  .card-title { font-size: 0.8rem; }

  .card-meta { font-size: 0.7rem; }

  footer {
    padding: 14px 12px 10px;
    font-size: 0.7rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  header { padding-inline: 8px; }

  .hero-title { font-size: 1.45rem; }

  .hero-poster { max-width: 190px; }

  .grid { gap: 8px; }

  .card-title { font-size: 0.76rem; }

  .card-meta { font-size: 0.66rem; }
}
@media (max-width: 900px){
  header{ z-index: 1005; }
  .header-right{ z-index: 1006; }
  .burger{ z-index: 1007; }
}
