/* ============================================
   AsilMedia v2 — Components
   ============================================ */

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap; line-height: 1.4; cursor: pointer;
  text-decoration: none;
}

.btn--primary { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--secondary { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { color: var(--accent); background: var(--accent-glow); }

.btn--sm { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-xs); }
.btn--lg { padding: var(--sp-3) var(--sp-6); font-size: var(--fs-base); }
.btn--block { width: 100%; }

.btn .icon { width: 18px; height: 18px; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 6px; font-size: 10px; font-weight: var(--fw-bold);
  border-radius: var(--radius-xs); line-height: 1.3;
  letter-spacing: 0.02em;
}

.badge--quality { background: var(--accent); color: #fff; }
.badge--hd { background: var(--accent); color: #fff; }
.badge--new { background: var(--danger); color: #fff; }
.badge--series { background: var(--info); color: #fff; }

.badge--rating {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; font-size: var(--fs-xs); font-weight: var(--fw-bold);
  background: var(--accent); color: #fff; border-radius: var(--radius-sm);
}

.badge--rating .icon { width: 12px; height: 12px; }

.badge--imdb {
  background: #f5c518; color: #000;
  padding: var(--sp-1) var(--sp-2); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  border-radius: var(--radius-xs);
}

.badge--kp {
  background: var(--accent); color: #fff;
  padding: var(--sp-1) var(--sp-2); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  border-radius: var(--radius-xs);
}

/* ---- Card (Movie/Content) ---- */
.card {
  position: relative;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card__link:hover { color: inherit; }

.card__poster {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-tertiary);
}

/* Shimmer overlay — shown until image is loaded */
.card__poster::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    var(--bg-tertiary) 0%,
    var(--bg-tertiary) 30%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 70%,
    var(--bg-tertiary) 100%);
  background-size: 250% 100%;
  animation: shimmer-loading 1.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.35s ease-out;
}

/* Wide poster for trailer cards (16:9) */
.card__poster--wide { aspect-ratio: 16/9; }

/* Hide shimmer once image has fully loaded (JS adds .loaded class).
   NOTE: only target the ::before shimmer pseudo-element — a previous
   general-sibling selector here (`img.loaded ~ * ~ *`) accidentally
   hid the quality & serial badges too. */
.card__poster:has(img.loaded)::before {
  opacity: 0;
}

.card__poster img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out), opacity 0.4s ease-out;
  position: relative;
  z-index: 2;
  opacity: 0;
}

.card__poster img.loaded {
  opacity: 1;
}

.card:hover .card__poster img { transform: scale(1.05); }

/* Quality format badges — TOP-LEFT (1080p, 720p, 480p, etc.) */
.card__badges {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  z-index: 3;
}

/* Rating / likes count — TOP-RIGHT (+168, +23, ...) */
.card__rating {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  z-index: 3;
}

/* Hover play overlay */
.card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  display: flex; align-items: center; justify-content: center;
  z-index: 4;
}

.card:hover .card__overlay { opacity: 1; }

.card__play {
  width: 44px; height: 44px;
  background: var(--accent); border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow);
}

.card__play .icon { color: #fff; margin-left: 2px; width: 20px; height: 20px; }

/* Card info below poster */
.card__info {
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
}

.card__title {
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: var(--sp-1); color: var(--text-primary);
  word-break: break-word;
}

/* Alt name shown inline with card title in muted color */
.card__title-alt {
  color: var(--text-muted);
  font-weight: var(--fw-regular);
  font-size: 0.92em;
}

.card__meta {
  display: flex; align-items: center;
  font-size: var(--fs-xs); color: var(--text-muted);
}

/* card__link leaks into meta due to nested <a> from DLE year xfvalue links */
.card__meta > .card__link {
  flex: 1; min-width: 0;
  display: flex; justify-content: space-between;
}

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

.card__meta > a:not(.card__link) {
  white-space: nowrap; margin-left: 2px;
}

/* Bookmark button */
.card__bookmark {
  position: absolute; bottom: var(--sp-2); right: var(--sp-2);
  z-index: var(--z-base); padding: var(--sp-1);
  border-radius: var(--radius-sm); background: var(--bg-glass);
  backdrop-filter: blur(4px); opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
  color: var(--text-secondary); border: none; cursor: pointer;
}

.card:hover .card__bookmark { opacity: 1; }
.card__bookmark:hover { color: var(--accent); }
.card__bookmark.active { color: var(--accent); opacity: 1; }

/* Serial episode badge — bottom left of card poster */
.card__serial-badge {
  position: absolute;
  bottom: var(--sp-2);
  left: var(--sp-2);
  z-index: 3;
}

.card__serial-badge .badge {
  font-size: var(--fs-xs);
  padding: 3px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Carousel card sizing */
.carousel-card { width: 150px; }
@media (min-width: 480px) { .carousel-card { width: 160px; } }
@media (min-width: 768px) { .carousel-card { width: 170px; } }
@media (min-width: 1280px) { .carousel-card { width: 185px; } }

/* ---- Tags ---- */
.tag {
  display: inline-flex; align-items: center;
  padding: var(--sp-1) var(--sp-3); font-size: var(--fs-xs);
  color: var(--text-secondary); background: var(--bg-tertiary);
  border-radius: var(--radius-full); border: 1px solid var(--border);
  transition: all var(--duration-fast) var(--ease-out); text-decoration: none;
}

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

/* ---- Forms ---- */
.form-group { margin-bottom: var(--sp-4); }

.form-label {
  display: block; margin-bottom: var(--sp-1);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-secondary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%; padding: var(--sp-2) var(--sp-3);
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: var(--fs-sm); outline: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus { border-color: var(--accent); }

.form-textarea { resize: vertical; min-height: 80px; }

.form-check {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.form-row { display: flex; align-items: center; gap: var(--sp-2); }

/* ---- Alerts ---- */
.alert {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}

.alert--info { border-left: 3px solid var(--info); }
.alert--success { border-left: 3px solid var(--success); }
.alert--error { border-left: 3px solid var(--danger); }

.alert strong { display: block; margin-bottom: var(--sp-1); }

/* ---- Skeleton loader ---- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Auth panel (sidebar logged-in user) ---- */
.auth-panel {
  padding: var(--sp-3) var(--sp-4);
}

.auth-panel__user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.auth-panel__avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  object-fit: cover;
  flex-shrink: 0;
}

.auth-panel__info {
  min-width: 0;
}

.auth-panel__name {
  display: block;
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--duration-fast) var(--ease-out);
}

.auth-panel__name:hover {
  color: var(--accent);
}

.auth-panel__role {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.auth-panel__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ---- Auth form (sidebar login form) ---- */
.auth-form {
  padding: var(--sp-3) var(--sp-4);
}

.auth-form__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
}

.auth-form .form-group {
  margin-bottom: var(--sp-3);
}

.auth-form .form-input {
  font-size: var(--fs-sm);
  padding: var(--sp-2) var(--sp-3);
}

.auth-form__links {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
}

.auth-form__links a {
  color: var(--accent);
  transition: color var(--duration-fast) var(--ease-out);
}

.auth-form__links a:hover {
  text-decoration: underline;
}

.auth-form__social {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.auth-form__social-label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--sp-2);
}

.auth-form__social-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ---- Auth pages ---- */
.auth-page {
  display: flex; justify-content: center;
  padding: var(--sp-6) var(--sp-4);
}

.auth-page__card {
  width: 100%; max-width: 420px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--sp-6);
}

.auth-page__title {
  font-size: var(--fs-xl); font-weight: var(--fw-bold);
  margin-bottom: var(--sp-5); text-align: center;
}

.auth-page__desc {
  font-size: var(--fs-sm); color: var(--text-secondary);
  margin-bottom: var(--sp-4); text-align: center;
}

/* ---- SEO text ---- */
.seo-text {
  padding: var(--sp-6) var(--sp-4);
  font-size: var(--fs-sm); line-height: var(--lh-relaxed);
  color: var(--text-muted);
}

@media (min-width: 768px) { .seo-text { padding: var(--sp-6); } }

.seo-text h2, .seo-text h3 {
  font-size: var(--fs-lg); font-weight: var(--fw-bold);
  color: var(--text-primary); margin-bottom: var(--sp-3);
}

/* ---- Footer ---- */
.site-footer {
  padding: var(--sp-8) var(--sp-4);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: var(--fs-sm); color: var(--text-muted);
}

.site-footer__title {
  font-size: var(--fs-lg); font-weight: var(--fw-bold);
  color: var(--text-primary); margin-bottom: var(--sp-4);
}

.site-footer__links {
  display: flex; justify-content: center; gap: var(--sp-4);
  margin-bottom: var(--sp-4); flex-wrap: wrap;
}

.site-footer__links a { color: var(--accent); }
.site-footer__links a:hover { text-decoration: underline; }

.site-footer__social {
  display: flex; justify-content: center; gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.site-footer__social a {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.site-footer__social a:hover {
  background: var(--accent); color: #fff;
}

/* ---- Static/Profile pages ---- */
.static-page { padding: var(--sp-4); }
@media (min-width: 768px) { .static-page { padding: var(--sp-6); } }
.static-page__content { max-width: 800px; }

.profile { padding: var(--sp-4) 0; }
@media (min-width: 768px) { .profile { padding: var(--sp-6) 0; } }

.profile__header {
  display: flex; gap: var(--sp-5); align-items: center;
  margin-bottom: var(--sp-6); flex-wrap: wrap;
  background: var(--bg-secondary); border-radius: var(--radius-lg);
  padding: var(--sp-5); border: 1px solid var(--border);
}
.profile__avatar-wrap { flex-shrink: 0; }
.profile__avatar {
  width: 80px; height: 80px; border-radius: var(--radius-full);
  object-fit: cover; border: 3px solid var(--accent);
}
.profile__name { font-size: var(--fs-xl); font-weight: var(--fw-bold); margin-bottom: var(--sp-1); }
.profile__meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.profile__meta-item {
  display: flex; align-items: center; gap: var(--sp-1);
  font-size: var(--fs-sm); color: var(--text-secondary);
}
.profile__meta-item .icon { color: var(--text-tertiary); }
.profile__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.profile__actions a {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  font-size: var(--fs-sm); color: var(--accent); text-decoration: none;
  padding: var(--sp-1) var(--sp-3); border-radius: var(--radius-sm);
  background: rgba(0, 180, 216, 0.1); transition: background 0.2s;
}
.profile__actions a:hover { background: rgba(0, 180, 216, 0.2); }

.profile__section { margin-bottom: var(--sp-6); }
.profile__section-title {
  font-size: var(--fs-lg); font-weight: var(--fw-bold);
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.profile__section-subtitle {
  font-size: var(--fs-md); font-weight: var(--fw-bold);
  margin: var(--sp-5) 0 var(--sp-3); padding-top: var(--sp-4);
  border-top: 1px solid var(--border); color: var(--text-secondary);
}
.profile__form { max-width: 560px; }

/* ---- Search page ---- */
.search-page__form { display: none; }

.search-page__header {
  max-width: 700px;
  margin: 0 auto var(--sp-5);
  text-align: center;
}

.search-page__query {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
}
.search-page__query .icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.search-page__info {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.search-page__form input.textin,
.search-page__form input[type="text"] {
  width: 100% !important;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--duration-fast);
  margin-bottom: var(--sp-3);
  box-sizing: border-box;
}
.search-page__form input.textin:focus,
.search-page__form input[type="text"]:focus {
  border-color: var(--accent);
}

.search-page__form input.bbcodes,
.search-page__form input[type="submit"],
.search-page__form input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-2) var(--sp-5) !important;
  font-size: var(--fs-sm) !important;
  font-weight: var(--fw-bold);
  color: #fff !important;
  background: var(--accent) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer;
  transition: opacity var(--duration-fast);
  margin-right: var(--sp-2);
}
.search-page__form input.bbcodes:hover {
  opacity: 0.85;
}
.search-page__form input.bbcodes + input.bbcodes {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
}

/* Search page within content-grid: search-page header spans full width */
.content-grid > .search-page,
.content-grid > form {
  grid-column: 1 / -1;
}

/* ---- PM page ---- */
.pm-page { padding: var(--sp-4); }
@media (min-width: 768px) { .pm-page { padding: var(--sp-6); } }
.pm-page__tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.pm-page__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-bottom: var(--sp-4); }

/* ---- Vote widget ---- */
.vote-widget { padding: var(--sp-4); background: var(--bg-secondary); border-radius: var(--radius-md); border: 1px solid var(--border); }
.vote-widget__title { font-size: var(--fs-md); font-weight: var(--fw-bold); margin-bottom: var(--sp-3); }
.vote-widget__list { margin-bottom: var(--sp-3); }
.vote-widget__count { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--sp-3); }
.vote-widget__actions { display: flex; gap: var(--sp-2); }

/* ---- Scroll to top ---- */
.scroll-top {
  position: fixed;
  bottom: var(--sp-4);
  right: var(--sp-4);
  z-index: var(--z-sticky);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: var(--shadow-glow);
}

.scroll-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* When mobile bar is visible, push scroll-top up */
.page-fullstory .scroll-top { bottom: 72px; }

/* ---- Mobile bottom bar ---- */
.mobile-bar {
  display: none;
}

@media (max-width: 767px) {
  .mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    display: flex;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
  }

  .page-fullstory .main-content {
    padding-bottom: 64px;
  }
}

.mobile-bar__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.mobile-bar__btn .icon { width: 18px; height: 18px; }

.mobile-bar__btn--play {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

.mobile-bar__btn--play:hover {
  background: var(--accent-hover);
}

/* ---- Search popup (fast search) ---- */
.fastsearch-item { padding: var(--sp-2); }
.fastsearch-item__link {
  display: flex; gap: var(--sp-3); text-decoration: none; color: var(--text-primary);
  padding: var(--sp-2); border-radius: var(--radius-sm);
  transition: background var(--duration-fast) var(--ease-out);
}
.fastsearch-item__link:hover { background: var(--bg-hover); }
.fastsearch-item__poster { width: 50px; height: 70px; border-radius: var(--radius-xs); overflow: hidden; flex-shrink: 0; }
.fastsearch-item__poster img { width: 100%; height: 100%; object-fit: cover; }
.fastsearch-item__title { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.fastsearch-item__category { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---- "Barchasini ko'rish" carousel card ---- */
.carousel-view-all {
  width: 150px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.carousel-view-all:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 180, 216, 0.05);
}

.carousel-view-all__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: all var(--duration-fast) var(--ease-out);
}

.carousel-view-all:hover .carousel-view-all__icon {
  background: var(--accent);
  color: var(--text-inverse);
}

.carousel-view-all__icon .icon {
  width: 24px;
  height: 24px;
}

@media (min-width: 480px) { .carousel-view-all { width: 160px; } }
@media (min-width: 768px) { .carousel-view-all { width: 170px; min-height: 240px; } }
@media (min-width: 1280px) { .carousel-view-all { width: 185px; } }

/* ---- Mobile logo bar (above top-bar, mobile only) ---- */
.mobile-logo-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3) var(--sp-4) 0;
  background: var(--bg-primary);
}

.mobile-logo-bar__link {
  display: flex;
  align-items: center;
}

.mobile-logo-bar__img {
  height: 38px;
  width: auto;
}

@media (min-width: 1024px) {
  .mobile-logo-bar { display: none; }
}

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--sp-2);
  pointer-events: none;
  max-width: 90vw;
}

.page-fullstory .toast-container { bottom: 80px; }

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: all var(--duration-normal) var(--ease-out);
}

.toast--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast--hiding {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
}

.toast .icon {
  flex-shrink: 0;
}

.toast--success .icon { color: var(--success); }
.toast--error .icon { color: var(--danger); }
.toast--warning .icon { color: var(--warning); }
.toast--info .icon { color: var(--info); }

.toast--success { border-color: rgba(63, 185, 80, 0.3); }
.toast--error { border-color: rgba(248, 81, 73, 0.3); }
.toast--warning { border-color: rgba(210, 153, 34, 0.3); }
.toast--info { border-color: rgba(88, 166, 255, 0.3); }

/* ---- Page Header for non-content pages ---- */
.page-header {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-8) var(--sp-4) var(--sp-6);
}

.page-header__title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.page-header__subtitle {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .page-header { padding: var(--sp-10) var(--sp-4) var(--sp-8); }
  .page-header__title { font-size: var(--fs-3xl); }
}

/* ---- History Page ---- */
.history-page {
  padding: var(--sp-4);
}

.history-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.history-page__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.history-page__title .icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.history-page__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-16) var(--sp-4);
  color: var(--text-muted);
}

.history-page__empty svg {
  margin-bottom: var(--sp-4);
  opacity: 0.3;
}

.history-page__empty p {
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.history-page__empty span {
  font-size: var(--fs-sm);
}

/* ---- Actor/Director Profile ---- */
.actor-profile {
  margin-bottom: var(--sp-6);
}

.actor-profile--loading {
  min-height: 200px;
}

/* Skeleton loading */
.actor-profile__skeleton {
  display: flex;
  gap: var(--sp-5);
  padding: var(--sp-5);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.actor-profile__skeleton-photo {
  width: 160px;
  height: 220px;
  border-radius: var(--radius-md);
  background: linear-gradient(110deg, var(--bg-tertiary) 8%, var(--bg-card-hover) 18%, var(--bg-tertiary) 33%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite linear;
  flex-shrink: 0;
}

.actor-profile__skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-top: var(--sp-2);
}

.actor-profile__skeleton-line {
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(110deg, var(--bg-tertiary) 8%, var(--bg-card-hover) 18%, var(--bg-tertiary) 33%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite linear;
}

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

/* Profile card */
.actor-profile__card {
  display: flex;
  gap: var(--sp-5);
  padding: var(--sp-5);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.actor-profile__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 60%);
  opacity: 0.06;
  pointer-events: none;
}

/* Photo */
.actor-profile__photo-wrap {
  flex-shrink: 0;
  width: 170px;
  position: relative;
  z-index: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.actor-profile__photo-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    var(--bg-tertiary) 0%,
    var(--bg-tertiary) 30%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 70%,
    var(--bg-tertiary) 100%);
  background-size: 250% 100%;
  animation: shimmer-loading 1.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.35s ease-out;
}

.actor-profile__photo-wrap:has(.actor-profile__photo.loaded)::before {
  opacity: 0;
}

.actor-profile__photo {
  width: 170px;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius-md);
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease-out;
  display: block;
}

.actor-profile__photo.loaded { opacity: 1; }

.actor-profile__photo-placeholder {
  width: 170px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

/* Info */
.actor-profile__info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.actor-profile__name {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin: 0 0 var(--sp-1);
  line-height: 1.2;
}

.actor-profile__name-en {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--sp-3);
}

.actor-profile__profession {
  display: inline-block;
  font-size: var(--fs-xs);
  color: var(--accent);
  background: var(--accent-glow);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-3);
  font-weight: var(--fw-medium);
}

/* Meta grid */
.actor-profile__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-3);
}

.actor-profile__meta-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.actor-profile__meta-item svg {
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0.8;
}

/* Biography */
.actor-profile__bio {
  margin-top: var(--sp-2);
}

/* Language tabs — UZ | RU */
.actor-profile__bio-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-3);
}

.actor-profile__bio-tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 14px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.01em;
}

.actor-profile__bio-tab:hover {
  color: var(--text-primary);
}

.actor-profile__bio-tab.is-active {
  background: var(--accent);
  color: var(--bg-primary);
}

.actor-profile__bio-body {
  position: relative;
}

.actor-profile__bio-text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 var(--sp-2);
  display: none;
}

.actor-profile__bio-text.is-active {
  display: block;
}

.actor-profile__bio-toggle {
  font-size: var(--fs-xs);
  color: var(--accent);
  cursor: pointer;
}

/* Section titles — elegant divider with gradient accent */
.actor-profile__section-title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin: var(--sp-8) 0 var(--sp-5);
  padding-left: var(--sp-4);
  position: relative;
  letter-spacing: -0.01em;
}

.actor-profile__section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2, var(--accent)));
  border-radius: var(--radius-full);
  box-shadow: 0 0 12px var(--accent-glow, rgba(0, 180, 216, 0.4));
}

.actor-profile__section-title svg {
  color: var(--accent);
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.actor-profile__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--accent);
  background: var(--accent-glow, rgba(0, 180, 216, 0.12));
  border: 1px solid var(--accent-glow, rgba(0, 180, 216, 0.25));
  border-radius: var(--radius-full);
  font-weight: var(--fw-semibold);
  margin-left: var(--sp-1);
}

/* Films grid after section title: tighter, consistent */
.actor-profile__section-title + .content-grid,
.actor-profile__other-section + .content-grid {
  margin-bottom: var(--sp-8);
}

.actor-profile__other-section {
  margin-top: var(--sp-4);
}

/* Responsive */
@media (max-width: 640px) {
  .actor-profile__card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--sp-4);
  }

  .actor-profile__photo-wrap {
    width: 140px;
  }

  .actor-profile__photo {
    width: 140px;
    height: 200px;
  }

  .actor-profile__photo-placeholder {
    width: 140px;
    height: 200px;
  }

  .actor-profile__meta {
    justify-content: center;
  }

  .actor-profile__name {
    font-size: var(--fs-xl);
  }

  .actor-profile__skeleton {
    flex-direction: column;
    align-items: center;
  }

  .actor-profile__skeleton-photo {
    width: 140px;
    height: 200px;
  }
}

/* ============================================================
   COUNTRY PROFILE (variant of actor-profile)
   ============================================================ */
.country-profile .country-profile__flag-wrap {
  width: 170px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
    var(--bg-tertiary) 0%,
    var(--bg-secondary) 100%);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
}

.country-profile .country-profile__flag-wrap::before {
  animation: none;
  display: none;
}

.country-profile__flag {
  font-size: 120px;
  line-height: 1;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.45));
  user-select: none;
}

.country-profile__flag-placeholder {
  width: 90px;
  height: 90px;
  color: var(--text-muted);
  opacity: 0.5;
}

@media (max-width: 640px) {
  .country-profile .country-profile__flag-wrap {
    width: 140px;
    height: 200px;
  }
  .country-profile__flag {
    font-size: 96px;
  }
}

/* ============================================================
   GENRE PROFILE — /xfsearch/genre/NAME/
   Matches the visual family of .actor-profile but uses an icon
   tile instead of a photo.
   ============================================================ */
.genre-profile {
  margin-bottom: var(--sp-6);
}

.genre-profile__card {
  position: relative;
  display: flex;
  gap: var(--sp-5);
  padding: var(--sp-6) var(--sp-5);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
}

.genre-profile__card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
}

.genre-profile__icon-wrap {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.genre-profile__icon {
  width: 64px;
  height: 64px;
  color: #ffffff;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.genre-profile__info {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.genre-profile__eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--accent);
  background: var(--accent-glow);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: max-content;
}

.genre-profile__name {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin: 0 0 var(--sp-1);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.genre-profile__name-alt {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0 0 var(--sp-3);
}

.genre-profile__tagline {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 var(--sp-4);
  max-width: 720px;
}

.genre-profile__stats {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.genre-profile__stat {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  font-weight: var(--fw-medium);
}

.genre-profile__stat svg {
  color: var(--accent);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .genre-profile__card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--sp-5) var(--sp-4);
  }
  .genre-profile__icon-wrap {
    width: 112px;
    height: 112px;
  }
  .genre-profile__icon {
    width: 52px;
    height: 52px;
  }
  .genre-profile__name {
    font-size: var(--fs-2xl);
  }
  .genre-profile__stats {
    justify-content: center;
  }
  .genre-profile__eyebrow {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============================================================
   CATEGORIES HERO — /films/ and its children
   Shows the parent "Tarjima kinolar" family as a grid of
   gradient cards. Active leaf is highlighted.
   ============================================================ */
.categories-hero {
  margin-bottom: var(--sp-8);
  padding: 0 var(--sp-4);
}

@media (min-width: 768px) {
  .categories-hero {
    padding: 0 var(--sp-6);
  }
}

.categories-hero__header {
  margin-bottom: var(--sp-5);
}

.categories-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--accent);
  background: var(--accent-glow);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

.categories-hero__eyebrow .icon {
  width: 14px;
  height: 14px;
}

.categories-hero__title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin: 0 0 var(--sp-2);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.categories-hero__lede {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  max-width: 780px;
}

.categories-hero__grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.category-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

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

.category-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}

.category-card__bg {
  position: absolute;
  inset: 0;
  opacity: 0.10;
  z-index: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
  mask-image: radial-gradient(circle at top left, rgba(0,0,0,0.9), transparent 70%);
  -webkit-mask-image: radial-gradient(circle at top left, rgba(0,0,0,0.9), transparent 70%);
}

.category-card:hover .category-card__bg,
.category-card--active .category-card__bg {
  opacity: 0.18;
}

.category-card__icon-wrap {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.category-card__icon {
  width: 28px;
  height: 28px;
  color: #ffffff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}

.category-card__body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.category-card__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin: 0 0 var(--sp-1);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.category-card__descr {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 var(--sp-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-card__count {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.category-card__chevron {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--duration-normal) var(--ease-out),
              color var(--duration-normal) var(--ease-out);
}

.category-card__chevron .icon {
  width: 20px;
  height: 20px;
}

.category-card:hover .category-card__chevron {
  color: var(--accent);
  transform: translateX(4px);
}

.category-card--active .category-card__chevron {
  color: var(--accent);
}

@media (max-width: 640px) {
  .categories-hero__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }
  .categories-hero__title {
    font-size: var(--fs-xl);
  }
  .category-card {
    padding: var(--sp-3);
    gap: var(--sp-3);
  }
  .category-card__icon-wrap {
    width: 48px;
    height: 48px;
  }
  .category-card__icon {
    width: 24px;
    height: 24px;
  }
}

/* Light theme niceties */
[data-theme="light"] .genre-profile__card,
[data-theme="light"] .category-card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .category-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
[data-theme="light"] .category-card__title {
  color: var(--text-primary);
}

