/* ==========================================================================
   SAKIYNA — VIVID OLED & 4K BRAND DESIGN SYSTEM (SAKIYNA-SAYT-RANGLAR.CSS)
   Mualliflik brendi: Sakiyna ilovasi va saytining yagona yuqori sifatli ranglari.
   Qo'llab-quvvatlaydi: OLED deep black, Display-P3 (Wide Gamut),
                       QHD (1440p), Ultrawide (21:9), 4K UHD (3840x2160).
   ========================================================================== */

:root {
  --ink: #0d1430;
  --ink-2: #101a3e;
  --black: #06060c;
  --blue: #2e9fe3;
  --blue-soft: #6fc0f5;
  --purple: #7a3aa8;
  --magenta: #e0227d;
  --magenta-soft: #f57bb7;
  --text: #f4f3f9;
  --text-dim: #8d89a1;
  --glass: rgba(16, 15, 27, 0.78);
  --glass-line: #26243a;
  --brand-gradient: linear-gradient(135deg, #1c6fc4 0%, #7a3aa8 50%, #e0227d 100%);
  --brand-gradient-h: linear-gradient(90deg, #1c6fc4 0%, #2e9fe3 22%, #7a3aa8 55%, #e0227d 100%);
  --brand-text-gradient: linear-gradient(120deg, #2e9fe3 0%, #e0227d 100%);
  --brand-glow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ---------- Apple / P3 Wide Color Gamut (Display-P3) ---------- */
@supports (color: color(display-p3 1 1 1)) {
  :root {
    --blue: color(display-p3 0.18 0.62 0.89);
    --blue-soft: color(display-p3 0.43 0.75 0.96);
    --purple: color(display-p3 0.48 0.23 0.66);
    --magenta: color(display-p3 0.88 0.13 0.49);
    --magenta-soft: color(display-p3 0.96 0.48 0.72);
    --brand-gradient: linear-gradient(135deg, color(display-p3 0.11 0.43 0.77) 0%, color(display-p3 0.48 0.23 0.66) 50%, color(display-p3 0.88 0.13 0.49) 100%);
    --brand-gradient-h: linear-gradient(90deg, color(display-p3 0.11 0.43 0.77) 0%, color(display-p3 0.18 0.62 0.89) 22%, color(display-p3 0.48 0.23 0.66) 55%, color(display-p3 0.88 0.13 0.49) 100%);
    --brand-text-gradient: linear-gradient(120deg, color(display-p3 0.18 0.62 0.89) 0%, color(display-p3 0.88 0.13 0.49) 100%);
  }
}
@media (color-gamut: p3) {
  :root {
    --blue: color(display-p3 0.18 0.62 0.89);
    --blue-soft: color(display-p3 0.43 0.75 0.96);
    --purple: color(display-p3 0.48 0.23 0.66);
    --magenta: color(display-p3 0.88 0.13 0.49);
    --magenta-soft: color(display-p3 0.96 0.48 0.72);
    --brand-gradient: linear-gradient(135deg, color(display-p3 0.11 0.43 0.77) 0%, color(display-p3 0.48 0.23 0.66) 50%, color(display-p3 0.88 0.13 0.49) 100%);
    --brand-gradient-h: linear-gradient(90deg, color(display-p3 0.11 0.43 0.77) 0%, color(display-p3 0.18 0.62 0.89) 22%, color(display-p3 0.48 0.23 0.66) 55%, color(display-p3 0.88 0.13 0.49) 100%);
    --brand-text-gradient: linear-gradient(120deg, color(display-p3 0.18 0.62 0.89) 0%, color(display-p3 0.88 0.13 0.49) 100%);
  }
}

/* ---------- OLED Fon: chuqur qora + ko'p nuqtali yorqin radial tuslar ---------- */
body {
  color: var(--text) !important;
  background-color: #06060c !important;
  background-image: none !important;
  background: #06060c !important;
}

/* ---------- Navigatsiya: kristall shisha va yorqin brend elementlari ---------- */
.nav {
  background: rgba(8, 8, 16, 0.72) !important;
  backdrop-filter: blur(24px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px -6px rgba(46, 159, 227, 0.15) !important;
}

.tlogo em {
  background: var(--brand-text-gradient) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  filter: none !important;
}

.nav-links a.active {
  color: #fff !important;
  background: var(--brand-gradient-h) !important;
  background-clip: padding-box !important;
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

.lang-switch button.on {
  color: #fff !important;
  background: var(--brand-gradient-h) !important;
  background-clip: padding-box !important;
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

/* ---------- Brend Tugmalari (Glow va Gradient) ---------- */
.btn-solid {
  background: var(--brand-gradient-h) no-repeat !important;
  background-clip: padding-box !important;
  overflow: hidden;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 4px 14px -2px rgba(224, 34, 125, 0.20), 0 2px 8px -1px rgba(46, 159, 227, 0.18) !important;
  transition: all 0.35s cubic-bezier(0.32, 0.72, 0, 1) !important;
}

.btn-solid:hover {
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 6px 20px -2px rgba(224, 34, 125, 0.30), 0 3px 10px -1px rgba(46, 159, 227, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}

.btn-glass {
  background: rgba(18, 17, 30, 0.65) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: var(--text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

/* ---------- Banner & Kartalar ---------- */
.story-banner {
  background: rgba(14, 13, 24, 0.78) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-left: 3px solid var(--blue) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

.story-card:hover {
  border-color: rgba(46, 159, 227, 0.35) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

.video-card:hover {
  border-color: rgba(46, 159, 227, 0.4) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

.vf-play span {
  background: rgba(10, 10, 20, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1) !important;
}

.video-card:hover .vf-play span {
  background: var(--brand-gradient-h) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
  transform: scale(1.1) !important;
}

/* ---------- Audio Pleer, Chiplar, Reaksiyalar ---------- */
.player.playing {
  border-color: rgba(46, 159, 227, 0.4) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

.player.playing .p-btn {
  background: var(--brand-gradient-h) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
}

.p-bar .fill {
  background: var(--brand-gradient-h) !important;
  box-shadow: none !important;
}

.chip.on, .tool-btn.on, .react-btn.on {
  background: var(--brand-gradient-h) no-repeat !important;
  background-clip: padding-box !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.fav.on {
  color: var(--magenta) !important;
  filter: none !important;
}

.volr {
  accent-color: var(--blue) !important;
}

#readbar {
  background: var(--brand-gradient-h) !important;
}

.auth-circle {
  background: var(--brand-gradient) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.cprog i {
  background: var(--brand-gradient-h) !important;
}

.newdot {
  background: var(--magenta) !important;
}

/* ---------- 2K / QHD (1440p) Moslashuv ---------- */
@media (min-width: 1440px) {
  body {
    font-size: 17.5px !important;
    background-image: none !important;
  }
  main { max-width: 1420px !important; }
  .nav { width: min(1420px, calc(100% - 2.5rem)) !important; padding: 0.7rem 1.5rem !important; }
  .story-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)) !important; gap: 1.6rem !important; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important; gap: 1.5rem !important; }
}

/* ---------- 34" Ultrawide (21:9) Moslashuv ---------- */
@media (min-width: 1920px) {
  body {
    font-size: 18.5px !important;
    background-image: none !important;
  }
  main { max-width: 1680px !important; }
  .nav { width: min(1680px, calc(100% - 3.5rem)) !important; padding: 0.8rem 1.8rem !important; }
  .tlogo-nav { font-size: 1.35rem !important; }
  .btn { padding: 0.95rem 2.3rem !important; font-size: 0.98rem !important; }
  .story-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important; gap: 1.8rem !important; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important; gap: 1.8rem !important; }
  .p-btn { width: 56px !important; height: 56px !important; font-size: 1.15rem !important; }
  .vf-play span { width: 80px !important; height: 80px !important; font-size: 1.6rem !important; }
}

/* ---------- 4K UHD (3840x2160) va Katta OLED Ekranlar ---------- */
@media (min-width: 2560px) {
  body {
    font-size: 20px !important;
    background-image: none !important;
  }
  main { max-width: 2100px !important; }
  .nav { width: min(2100px, calc(100% - 4.5rem)) !important; padding: 0.9rem 2.2rem !important; }
  .tlogo-nav { font-size: 1.5rem !important; }
  .tlogo-hero { font-size: clamp(3.2rem, 5.5vw, 5.2rem) !important; }
  .btn { padding: 1.1rem 2.8rem !important; font-size: 1.1rem !important; }
  .story-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) !important; gap: 2.2rem !important; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)) !important; gap: 2.2rem !important; }
  .p-btn { width: 64px !important; height: 64px !important; font-size: 1.3rem !important; }
  .vf-play span { width: 92px !important; height: 92px !important; font-size: 1.85rem !important; }
}

/* ============================================================
   7-BUYRUQ: Skeleton Shimmer Animatsiyasi
   ============================================================ */
@keyframes sakiyna-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 37%, rgba(255, 255, 255, 0.03) 63%) !important;
  background-size: 400% 100% !important;
  animation: sakiyna-shimmer 1.8s ease-in-out infinite !important;
  border-radius: 12px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 6px;
}

.skeleton-title {
  height: 22px;
  width: 60%;
  margin-bottom: 12px;
  border-radius: 6px;
}

.skeleton-card {
  min-height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* ============================================================
   8-BUYRUQ: Global Qidiruv Natijalari Dizayni
   ============================================================ */
.gs-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s ease, transform 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.gs-item:last-child {
  border-bottom: none;
}
.gs-item:hover {
  background: rgba(46, 159, 227, 0.12);
  transform: translateX(3px);
}
.gs-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  flex-shrink: 0;
}
.gs-badge.gs-story {
  background: rgba(46, 159, 227, 0.2);
  color: #6fc0f5;
  border: 1px solid rgba(46, 159, 227, 0.35);
}
.gs-badge.gs-audio {
  background: rgba(224, 86, 136, 0.2);
  color: #f78bb0;
  border: 1px solid rgba(224, 86, 136, 0.35);
}
.gs-badge.gs-video {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.gs-content {
  flex: 1;
  min-width: 0;
}
.gs-content b {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-content small {
  display: block;
  font-size: 0.74rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-arrow {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-left: auto;
}

/* ============================================================
   2-BUYRUQ & 3-BUYRUQ: Video Davomiyligi va "YANGI" Belgisi
   ============================================================ */
.vf-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  z-index: 3;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  letter-spacing: 0.04em;
}

.vf-badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #e0227d, #7a3aa8);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(224, 34, 125, 0.4);
  z-index: 3;
  pointer-events: none;
}

/* ============================================================
   6-BUYRUQ: Ichki Sahifalar Dekorativ Naqshi
   ============================================================ */
.page-deco {
  position: absolute;
  right: -10px;
  top: -15px;
  width: 170px;
  opacity: 0.32;
  pointer-events: none;
  color: rgba(46, 159, 227, 0.45);
}

/* ============================================================
   GOOGLE OAUTH AUTHENTICATION (SUPABASE)
   ============================================================ */
.google-auth-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.2rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  padding: 0.38rem 0.85rem;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.google-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.google-btn:active {
  transform: translateY(0);
}

.google-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* User Profile Badge */
.user-profile {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(46, 159, 227, 0.35);
  color: #fff;
  padding: 0.22rem 0.75rem 0.22rem 0.25rem;
  border-radius: 99px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.25s ease;
  max-width: 240px;
}

.user-avatar-btn:hover {
  background: rgba(46, 159, 227, 0.16);
  border-color: rgba(46, 159, 227, 0.6);
  box-shadow: 0 2px 12px rgba(46, 159, 227, 0.25);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: #14131f;
  flex-shrink: 0;
}

.user-email-pill, .user-name {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8rem;
  font-weight: 500;
  color: #f4f3f9;
}

.user-caret {
  font-size: 0.65rem;
  color: var(--text-dim);
  transition: transform 0.2s;
  flex-shrink: 0;
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: rgba(12, 11, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85), 0 0 20px rgba(46, 159, 227, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  animation: fadeInDown 0.2s ease-out;
}

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

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-dropdown-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(46, 159, 227, 0.5);
  background: #14131f;
  flex-shrink: 0;
}

.user-info-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.user-info-row b {
  font-size: 0.88rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info-row small {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.8rem 0;
}

.user-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(224, 34, 125, 0.12);
  border: 1px solid rgba(224, 34, 125, 0.35);
  color: #ff6ea8;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-logout-btn:hover {
  background: rgba(224, 34, 125, 0.26);
  color: #fff;
  border-color: rgba(224, 34, 125, 0.65);
  box-shadow: 0 4px 14px rgba(224, 34, 125, 0.25);
  transform: translateY(-1px);
}

@media (max-width: 680px) {
  .google-btn .btn-text {
    display: none !important;
  }
  .google-btn {
    padding: 0.4rem 0.55rem;
  }
  .user-email-pill, .user-name {
    max-width: 95px;
  }
  .user-avatar-btn {
    padding: 0.2rem 0.5rem 0.2rem 0.2rem;
  }
}
@media (max-width: 440px) {
  .user-email-pill, .user-name {
    max-width: 75px;
  }
}
