/* QuvaElon — extracted from wireframe */

:root {
  --bg: #ffffff;
  --ink: #1C1C1E;
  --mute: #8E8E93;
  --accent: #22C55E;
  --accent-rgb: 34, 197, 94;
  --line: rgba(0, 0, 0, 0.05);
  --soft: 0 2px 10px rgba(0, 0, 0, 0.06);
  --sec-bg: #ffffff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  background: #ececec;
  color: var(--ink);
}

.phone {
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  background: var(--sec-bg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background 0.25s ease;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}
@media (min-width: 768px) {
  .phone {
    max-width: 640px;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
  }
}
.phone[data-sec="eskilar"],
.phone[data-sec="uyjoy"],
.phone[data-sec="mashina"] {
  --sec-bg: #ffffff;
  --accent: #22C55E;
  --accent-rgb: 34, 197, 94;
}
.phone[data-sec="eskilar"] {
  --sec-bg: #ffffff;
  --accent: #16A34A;
  --accent-rgb: 22, 163, 74;
  --line: rgba(0, 0, 0, 0.06);
  --soft: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.phone[data-sec="xizmatlar"] {
  --sec-bg: #ffffff;
  --accent: #475569;
  --accent-rgb: 71, 85, 105;
}
.phone[data-sec="yangi"] {
  --sec-bg: #ffffff;
  --accent: #F27A1A;
  --accent-rgb: 242, 122, 26;
}

.phone-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 88px;
}
.phone-scroll::-webkit-scrollbar { display: none; }

/* Tepadan safe-area (iPhone notch) — fake status-bar yo‘q */
.status-space {
  display: none;
  height: 0;
}

.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
  background: var(--sec-bg);
  z-index: 5;
  flex-shrink: 0;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--soft);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.icon-btn.bell {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: var(--accent);
  background: #fff;
}
.icon-btn.bell .count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #1C1C1E;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.icon-btn.top-avatar {
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  color: #9CA3AF;
  background: #fff;
}
.icon-btn.top-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.icon-btn.top-avatar svg {
  width: 22px;
  height: 22px;
}
.icon-btn.top-avatar.has-photo svg { display: none; }

.search-box {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}
.search-box .lupa {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--mute);
  pointer-events: none;
}
.search {
  width: 100%;
  height: 44px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--soft);
  padding: 0 14px 0 42px;
  font-size: 16px;
  outline: none;
  background: #fff;
}
.search:focus { box-shadow: 0 0 0 2px var(--accent); }

.top-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-other-sec {
  height: 38px;
  padding: 0 12px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  animation: glowPulse 1.8s ease-in-out infinite;
}
.phone.slide-next .stage {
  animation: exitLeft 0.48s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}
.phone.slide-prev .stage {
  animation: exitRight 0.48s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}
@keyframes exitLeft {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  30% {
    transform: translateX(0) scale(1.08);
    opacity: 1;
  }
  100% {
    transform: translateX(-108%) scale(0.96);
    opacity: 0;
  }
}
@keyframes exitRight {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  30% {
    transform: translateX(0) scale(1.08);
    opacity: 1;
  }
  100% {
    transform: translateX(108%) scale(0.96);
    opacity: 0;
  }
}
.stage {
  will-change: transform, opacity;
  transform-origin: center center;
}
.stage.enter-next {
  animation: enterFromRight 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}
.stage.enter-prev {
  animation: enterFromLeft 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes enterFromRight {
  from { transform: translateX(100%) scale(0.98); opacity: 0.5; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes enterFromLeft {
  from { transform: translateX(-100%) scale(0.98); opacity: 0.5; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(var(--accent-rgb), 0.45),
      0 2px 8px rgba(var(--accent-rgb), 0.35);
  }
  50% {
    box-shadow:
      0 0 12px 4px rgba(var(--accent-rgb), 0.55),
      0 2px 10px rgba(var(--accent-rgb), 0.45);
  }
}

/* Yangi narsalar — Trendyol top area */
.phone[data-sec="yangi"] .status-space,
.phone[data-sec="yangi"] .top {
  background: #fff;
}
.phone[data-sec="yangi"] .search {
  border-radius: 999px;
  background: #F5F5F5;
  border-color: #EFEFEF;
  box-shadow: none;
}
.phone[data-sec="yangi"] .search:focus {
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}
.phone[data-sec="yangi"] .search-box .lupa {
  color: #F27A1A;
}
.phone[data-sec="yangi"] .btn-other-sec {
  border-radius: 10px;
  font-size: 11px;
  padding: 0 10px;
}

/* Xizmatlar — slate */
.phone[data-sec="xizmatlar"] .status-space,
.phone[data-sec="xizmatlar"] .top {
  background: #fff;
}
.phone[data-sec="xizmatlar"] .search {
  border-radius: 14px;
  background: #fff;
  border-color: #E2E8F0;
  box-shadow: 0 1px 3px rgba(71, 85, 105, 0.06);
}
.phone[data-sec="xizmatlar"] .search:focus {
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.22);
}
.phone[data-sec="xizmatlar"] .search-box .lupa {
  color: #475569;
}
.phone[data-sec="xizmatlar"] .btn-other-sec {
  border-radius: 10px;
  background: #475569;
  color: #fff;
  border: none;
  font-size: 11px;
  padding: 0 10px;
}
.phone[data-sec="xizmatlar"] .icon-btn {
  color: #334155;
}
.phone[data-sec="xizmatlar"] .cta {
  background: linear-gradient(180deg, #64748B 0%, #475569 55%, #334155 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 0 0 0 rgba(71, 85, 105, 0.45),
    0 8px 22px rgba(71, 85, 105, 0.35);
  animation: xizmatCtaGlow 2.2s ease-in-out infinite;
}
@keyframes xizmatCtaGlow {
  0%, 100% {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.28) inset,
      0 0 0 0 rgba(71, 85, 105, 0.5),
      0 0 14px 2px rgba(100, 116, 139, 0.35),
      0 8px 22px rgba(71, 85, 105, 0.35);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.35) inset,
      0 0 0 8px rgba(71, 85, 105, 0),
      0 0 28px 8px rgba(148, 163, 184, 0.55),
      0 10px 26px rgba(71, 85, 105, 0.45);
    filter: brightness(1.08);
  }
}

/* Ikkinchi qo‘l — vizual polish */
.phone[data-sec="eskilar"] .status-space,
.phone[data-sec="eskilar"] .top {
  background: #fff;
}
.phone[data-sec="eskilar"] .search {
  border-radius: 14px;
  background: #fff;
  border: 1px solid #ECECEC;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.phone[data-sec="eskilar"] .search:focus {
  border-color: rgba(22, 163, 74, 0.35);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}
.phone[data-sec="eskilar"] .search-box .lupa {
  color: #16A34A;
}
.phone[data-sec="eskilar"] .btn-other-sec {
  border-radius: 12px;
  background: #fff;
  border: 1px solid #E5E5E5;
  color: #15803D;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.phone[data-sec="eskilar"] .icon-btn {
  border-color: #ECECEC;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.phone[data-sec="eskilar"] .icon-btn.bell {
  color: #16A34A;
}
.phone[data-sec="eskilar"] .cta {
  background: linear-gradient(180deg, #4ADE80 0%, #22C55E 48%, #16A34A 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 8px 22px rgba(22, 163, 74, 0.32);
}
