/* ===== KinoNova — Mini-App uslublari =====
   Dizayn g'oyasi: kechki kinoteatr. Deyarli qora fon (ko'k tusli), proyektor
   nurini eslatuvchi amber urg'u, va bo'limlar orasida "kinoplyonka teshigi"
   motivi bilan ajratgich — bu ilovaning imzo elementi.
*/

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0d13;
  --bg-elevated: #12161f;
  --card: #171c28;
  --card-hover: #1e2432;
  --text: #eef1f6;
  --text-dim: #8b93a7;
  --text-faint: #565e72;
  --accent: #e8a33d;
  --accent-strong: #f5b94f;
  --accent-soft: rgba(232, 163, 61, 0.14);
  --premium: #c23b3b;
  --premium-soft: rgba(194, 59, 59, 0.16);
  --border: #232838;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

.display {
  font-family: 'Bebas Neue', 'Manrope', sans-serif;
  letter-spacing: 0.03em;
}

img { max-width: 100%; display: block; }

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

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

/* ===== App shell ===== */

#app {
  min-height: 100vh;
  padding-bottom: calc(74px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--bg) 60%, rgba(10,13,19,0.85) 100%);
  backdrop-filter: blur(6px);
}

.topbar .back-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.topbar h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--text);
}

.topbar .brand-mark {
  color: var(--accent);
}

.page {
  padding: 4px 16px 24px;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Film-strip ajratgich (imzo element) ===== */

.film-divider {
  height: 14px;
  margin: 22px 0 14px;
  background-image:
    radial-gradient(circle, var(--border) 2px, transparent 2.4px);
  background-size: 16px 14px;
  background-repeat: repeat-x;
  background-position: left center;
  opacity: 0.9;
  position: relative;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 0 10px;
}

.section-head h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 21px;
  letter-spacing: 0.03em;
  margin: 0;
  color: var(--text);
}

.section-head .see-all {
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 700;
}

/* ===== Horizontal scroll rows ===== */

.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }

.poster-card {
  flex: 0 0 auto;
  width: 122px;
  scroll-snap-align: start;
  position: relative;
}

.poster-card .poster-img {
  width: 122px;
  height: 178px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--card);
  border: 1px solid var(--border);
}

.poster-card .poster-title {
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 6px;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.poster-card .poster-meta {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  background: rgba(10,13,19,0.75);
  color: var(--accent-strong);
  backdrop-filter: blur(3px);
  letter-spacing: 0.04em;
}

.badge.premium {
  background: var(--premium-soft);
  color: #ff8f8f;
}

/* ===== Grid (search / listing) ===== */

.poster-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 10px;
}
.poster-grid .poster-card { width: 100%; }
.poster-grid .poster-img { width: 100%; height: 148px; }

/* ===== Search bar ===== */

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 11px 14px;
  margin-bottom: 6px;
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

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

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 12px 0;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* ===== Movie Detail ===== */

.detail-hero {
  position: relative;
  margin: 0 -16px;
  height: 340px;
  overflow: hidden;
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,13,19,0) 40%, var(--bg) 96%);
}

.detail-body {
  margin-top: -34px;
  position: relative;
  z-index: 2;
}

.detail-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0 0 6px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px;
}

.detail-meta .dot { opacity: 0.5; }

.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12.5px;
}

.action-row {
  display: flex;
  gap: 10px;
  margin: 16px 0 18px;
}

.btn {
  flex: 1;
  padding: 13px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 14.5px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent);
  color: #17120a;
}

.btn-secondary {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  flex: 0 0 52px;
}

.btn-secondary.is-fav {
  color: var(--premium);
  border-color: var(--premium);
}

.detail-desc {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

/* ===== Profile ===== */

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 20px;
}

.avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--premium));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: #17120a;
  flex-shrink: 0;
}

.profile-name { font-size: 17px; font-weight: 800; }
.profile-sub { font-size: 13px; color: var(--text-faint); margin-top: 2px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
}

.stat-card .num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--accent-strong);
}

.stat-card .label {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 4px;
  border-bottom: 1px solid var(--border);
}

.list-item .left { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 14.5px; }
.list-item .chev { color: var(--text-faint); }

/* ===== Empty / loading states ===== */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
}

.empty-state .icon { font-size: 40px; margin-bottom: 10px; opacity: 0.6; }
.empty-state .title { color: var(--text-dim); font-weight: 700; margin-bottom: 4px; }

.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-hover) 37%, var(--card) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
}

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

/* ===== Tab bar ===== */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 8px 6px calc(8px + var(--safe-bottom));
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 700;
}

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

.tab-btn.active { color: var(--accent-strong); }

/* ===== Premium page ===== */

.plan-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
}

.plan-card .plan-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--accent-strong);
}

.plan-card .plan-price {
  font-size: 22px;
  font-weight: 800;
  margin: 6px 0 10px;
}

.plan-card .plan-price span { font-size: 13px; color: var(--text-faint); font-weight: 500; }

@media (min-width: 480px) {
  .poster-grid { grid-template-columns: repeat(4, 1fr); }
}
