/* TubeMe Pages */

/* Page enter/exit */
.page {
  width: 100%;
  min-height: calc(100vh - var(--header-h) - var(--nav-h));
  position: relative;
  animation: pageIn 0.35s var(--ease-out);
}

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

.page-back {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.page-back svg { width: 22px; height: 22px; }
.page-back:active { opacity: 0.7; }

.page-title {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  padding: 0 var(--s-4) var(--s-3);
  letter-spacing: -0.02em;
}

/* Home */
.home-page .hero-slider { margin-top: var(--s-3); }

/* Collections page */
.collections-page .grid-2 { padding-top: var(--s-3); }

.collection-card {
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring);
}
.collection-card:active { transform: scale(0.97); }

.collection-card .thumb {
  position: relative;
  aspect-ratio: 16/10;
  background: var(--surface-2);
  overflow: hidden;
}
.collection-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s;
  opacity: 0;
}
.collection-card .thumb img.loaded { opacity: 1; }
.collection-card .thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
}

.collection-card .badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--neon-gradient);
  color: #000;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-full);
  letter-spacing: 0.05em;
  z-index: 2;
}

.collection-card .meta {
  padding: var(--s-3);
}
.collection-card .title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.collection-card .desc {
  font-size: 11px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Collection Detail */
.collection-detail .cover {
  position: relative;
  width: 100%;
  height: 280px;
  margin-top: calc(-1 * (var(--header-h) + var(--safe-top)));
  overflow: hidden;
}

.collection-detail .cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--surface-2);
}

.collection-detail .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: zoomSlow 8s var(--ease-out) forwards;
}

@keyframes zoomSlow {
  from { transform: scale(1.15); }
  to { transform: scale(1); }
}

.collection-detail .cover-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5,5,5,0.4) 0%, transparent 30%, rgba(5,5,5,0.95) 95%),
    linear-gradient(90deg, rgba(5,5,5,0.7) 0%, transparent 60%);
  padding: calc(var(--header-h) + var(--safe-top) + var(--s-4)) var(--s-4) var(--s-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.collection-detail .back-top {
  align-self: flex-start;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  color: #fff;
}

.collection-detail .info {
  padding: var(--s-4);
  margin-top: -60px;
  position: relative;
  z-index: 2;
}

.collection-detail .info h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  font-family: 'Poppins', sans-serif;
  text-shadow: 0 4px 24px rgba(0,0,0,0.6);
}

.collection-detail .info p {
  margin-top: var(--s-3);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.season-tabs {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4) var(--s-4);
  overflow-x: auto;
  margin-top: var(--s-3);
}

.season-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.season-tab.active {
  background: var(--neon-gradient);
  color: #000;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0,212,255,0.3);
}

/* Search page */
.search-page .trending-list {
  padding: 0 var(--s-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.trending-tag {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
}
.trending-tag:active { background: var(--surface-2); color: var(--text); }
.trending-tag.hot { color: var(--neon-pink); border-color: rgba(255, 60, 172, 0.3); }

.filter-bar {
  display: flex;
  gap: var(--s-2);
  padding: 0 var(--s-4) var(--s-2);
  overflow-x: auto;
}

.filter-pill {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.filter-pill.active {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  background: rgba(0,212,255,0.08);
}
.filter-pill svg { width: 12px; height: 12px; }

/* Favorites */
.favorites-page .tab-bar {
  display: flex;
  gap: var(--s-2);
  padding: 0 var(--s-4) var(--s-3);
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-3);
}

.fav-tab {
  flex-shrink: 0;
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.fav-tab.active { color: var(--neon-blue); }
.fav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--neon-gradient);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--neon-blue);
}

/* Profile */
.profile-page .profile-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  margin: var(--s-3);
  background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(123,97,255,0.08));
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}

.profile-page .profile-head::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(0,212,255,0.25), transparent 70%);
  border-radius: 50%;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--neon-gradient);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  color: #000;
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.4);
  flex-shrink: 0;
}

.profile-info h3 {
  font-size: 18px;
  font-weight: 700;
}
.profile-info p {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}
.profile-info .badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  background: var(--neon-gradient);
  color: #000;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--r-full);
  letter-spacing: 0.05em;
}

.settings-list {
  padding: 0 var(--s-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: var(--s-3);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:active { background: var(--surface-2); }

.settings-row .icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: rgba(0, 212, 255, 0.08);
  display: grid;
  place-items: center;
  color: var(--neon-blue);
  flex-shrink: 0;
}
.settings-row .icon svg { width: 18px; height: 18px; }

.settings-row .label {
  flex: 1;
}
.settings-row .label .name { font-size: 14px; font-weight: 500; }
.settings-row .label .sub { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.settings-row .value {
  font-size: 12px;
  color: var(--text-2);
}

.settings-row .chevron { color: var(--text-3); }
.settings-row .chevron svg { width: 16px; height: 16px; }

/* Toggle */
.toggle {
  width: 42px;
  height: 24px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  position: relative;
  cursor: pointer;
  transition: background 0.25s;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s var(--ease-spring);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.toggle.on { background: var(--neon-gradient); }
.toggle.on::after { transform: translateX(18px); }

/* Section Page (Barchasi) */
.section-page .grid-2 { padding-top: var(--s-3); }

/* Video Detail Page */
.video-page .player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  margin-top: calc(-1 * (var(--header-h) + var(--safe-top)));
  padding-top: calc(var(--header-h) + var(--safe-top));
}

.video-page .video-info {
  padding: var(--s-4);
}

.video-page .video-info h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.video-page .meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-2);
  color: var(--text-2);
  font-size: 12px;
}

.video-page .meta-row span { display: flex; align-items: center; gap: 4px; }

.video-page .actions-row {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4) var(--s-3);
  overflow-x: auto;
}

.action-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-2);
  cursor: pointer;
  min-width: 64px;
  transition: all 0.2s var(--ease-out);
}
.action-chip svg { width: 18px; height: 18px; }
.action-chip:active { transform: scale(0.94); }
.action-chip.active {
  color: var(--neon-blue);
  border-color: var(--neon-blue);
  background: rgba(0,212,255,0.08);
}

.video-page .description {
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  margin: 0 var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

/* Video sahifasining oxirgi bo'limi ("Shunga o'xshash yana" / season episodes)
   bottom navigation tagida qolib ketmasin uchun qo'shimcha pastki bo'sh joy. */
.video-page > .section:last-child,
.video-page .season-episodes-section:last-child {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 32px);
}

.profile-avatar.photo {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  color: transparent;
}

.profile-avatar.small {
  width: 56px;
  height: 56px;
  margin: 0 auto;
}

.profile-avatar.medium {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

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

.telegram-auth-card {
  margin: 0 var(--s-4) var(--s-4);
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.09), rgba(123, 97, 255, 0.09));
}

/* ===== Subscription card (obuna kartasi) =====
   Profil kartasi tagidagi kichik karta. Hozircha foydalanuvchida obuna yo'q. */
.subscription-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 var(--s-3) var(--s-3);
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(0, 212, 255, 0.10), transparent 55%),
    radial-gradient(120% 100% at 100% 100%, rgba(123, 97, 255, 0.10), transparent 55%),
    rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
  transition: transform .2s var(--ease-out), border-color .2s ease;
}
.subscription-card:hover {
  border-color: rgba(0, 212, 255, 0.28);
  transform: translateY(-1px);
}
.subscription-card .sub-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(123, 97, 255, 0.18));
  border: 1px solid rgba(0, 212, 255, 0.22);
  color: #7cf5b6;
}
.subscription-card.empty .sub-card-icon { color: #ffd47a; }
.subscription-card .sub-card-body {
  flex: 1;
  min-width: 0;
}
.subscription-card .sub-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.subscription-card .sub-card-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.45;
}
.subscription-card .sub-card-chip {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.subscription-card.empty .sub-card-chip {
  background: rgba(255, 212, 122, 0.10);
  border-color: rgba(255, 212, 122, 0.22);
  color: #ffd47a;
}

.telegram-auth-copy strong,
.telegram-auth-meta strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.telegram-auth-copy p,
.telegram-auth-note,
.telegram-auth-meta small {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.6;
}

.telegram-auth-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.telegram-auth-meta {
  min-width: 0;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(72, 255, 163, 0.14);
  color: #7cf5b6;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.telegram-auth-details {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.telegram-auth-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.telegram-auth-details span {
  color: var(--text-2);
  font-size: 12px;
}

.telegram-auth-details strong {
  font-size: 12px;
  text-align: right;
  word-break: break-word;
}

.telegram-auth-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.telegram-auth-actions > * {
  flex: 1;
}

/* ===== Premium dizaynli Telegram action tugmalari =====
   Profilni tahrirlash / Boshqa raqamdan kirish / Chiqish — uchala tugma
   bir xil hajmda, ikona+matn shaklida, hover/active animatsiyalari bilan. */
.tg-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.tg-actions-grid > * { flex: initial; }

.tg-action-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px 12px;
  min-height: 78px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.tg-action-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.08), transparent 60%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.tg-action-btn:hover::before { opacity: 1; }
.tg-action-btn:active { transform: scale(0.96); }

.tg-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.tg-action-btn:hover .tg-action-icon { transform: translateY(-2px) scale(1.05); }

.tg-action-label {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  letter-spacing: 0.005em;
  color: var(--text);
  max-width: 100%;
  word-break: break-word;
}

/* Profilni tahrirlash — neon-blue lahjasi */
.tg-action-edit {
  border-color: rgba(0, 212, 255, 0.18);
  background: linear-gradient(180deg, rgba(0,212,255,0.10), rgba(0,212,255,0.02));
}
.tg-action-edit .tg-action-icon {
  background: rgba(0, 212, 255, 0.16);
  color: #6fe3ff;
  box-shadow: 0 6px 18px rgba(0, 212, 255, 0.22);
}
.tg-action-edit:hover {
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 12px 28px rgba(0, 212, 255, 0.18);
}

/* Boshqa raqamdan kirish — purple/violet lahjasi */
.tg-action-switch {
  border-color: rgba(123, 97, 255, 0.22);
  background: linear-gradient(180deg, rgba(123,97,255,0.12), rgba(123,97,255,0.02));
}
.tg-action-switch .tg-action-icon {
  background: rgba(123, 97, 255, 0.18);
  color: #b8a8ff;
  box-shadow: 0 6px 18px rgba(123, 97, 255, 0.22);
}
.tg-action-switch:hover {
  border-color: rgba(123, 97, 255, 0.45);
  box-shadow: 0 12px 28px rgba(123, 97, 255, 0.22);
}

/* Chiqish — qizg'ish lahja (xavf belgisi) */
.tg-action-logout {
  border-color: rgba(255, 77, 109, 0.22);
  background: linear-gradient(180deg, rgba(255,77,109,0.12), rgba(255,77,109,0.02));
}
.tg-action-logout .tg-action-icon {
  background: rgba(255, 77, 109, 0.16);
  color: #ff96aa;
  box-shadow: 0 6px 18px rgba(255, 77, 109, 0.22);
}
.tg-action-logout:hover {
  border-color: rgba(255, 77, 109, 0.45);
  box-shadow: 0 12px 28px rgba(255, 77, 109, 0.22);
}

/* Kichik ekranlar uchun — 348px va undan kichik */
@media (max-width: 360px) {
  .tg-actions-grid { gap: 8px; }
  .tg-action-btn { min-height: 72px; padding: 12px 6px 10px; }
  .tg-action-icon { width: 32px; height: 32px; }
  .tg-action-label { font-size: 11px; }
}

.telegram-auth-note {
  margin-top: 14px;
}

.telegram-widget-wrap.compact {
  margin-top: 14px;
}
/* Glass card */
.glass {
  background: rgba(20, 20, 20, 0.6);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
}

.continue-card {
  position: relative;
}
.continue-card .progress-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.15);
}
.continue-card .progress-bar > div {
  height: 100%;
  background: var(--neon-gradient);
  box-shadow: 0 0 8px var(--neon-blue);
}

/* ===== Season grid cards (Collection detail) ===== */
.seasons-grid { padding: 8px 16px 24px; }
.season-card .v-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
}
.season-card .v-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.season-card .v-card-badge {
  top: 8px;
  right: 8px;
  left: auto;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}
.season-card .v-card-play {
  opacity: 1;
}
.season-card .v-card-title {
  font-weight: 700;
}
