/* ─────────────────────────────────────────────
   KEKUK iPA LIBRARY — Human Designer iOS 27 System
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-deep: #07070e;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --accent: #7c5cfc;
  --accent-2: #00d4ff;
  --accent-3: #ff2d55;
  --accent-glow: rgba(124, 92, 252, 0.35);
  --text-primary: #f5f5ff;
  --text-secondary: rgba(245, 245, 255, 0.65);
  --text-tertiary: rgba(245, 245, 255, 0.38);
  --tab-bar-h: 76px;
  --status-h: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shadow-glow: 0 8px 32px rgba(124, 92, 252, 0.22);
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-deep);
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ── Aurora Mesh Background ── */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
  animation: aurDrift 22s ease-in-out infinite alternate;
}

.aurora-1 {
  width: 65vw;
  height: 65vw;
  top: -15%;
  left: -15%;
  background: radial-gradient(circle, #7c5cfc 0%, #3d1fa8 60%, transparent 80%);
}

.aurora-2 {
  width: 55vw;
  height: 55vw;
  bottom: -10%;
  right: -10%;
  background: radial-gradient(circle, #00d4ff 0%, #0055b3 60%, transparent 80%);
  animation-delay: -7s;
}

.aurora-3 {
  width: 50vw;
  height: 50vw;
  top: 35%;
  right: 15%;
  background: radial-gradient(circle, #ff2d55 0%, #800020 60%, transparent 80%);
  animation-delay: -14s;
}

@keyframes aurDrift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, -20px) scale(1.06); }
  100% { transform: translate(-20px, 25px) scale(0.95); }
}

/* ── Status Bar Header ── */
.status-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--status-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 200;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  background: rgba(7, 7, 14, 0.7);
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
}

.status-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-time {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.location-badge {
  font-size: 10px;
  font-weight: 800;
  background: rgba(124, 92, 252, 0.2);
  color: var(--accent);
  border: 1px solid rgba(124, 92, 252, 0.3);
  border-radius: 100px;
  padding: 1px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.battery-icon {
  width: 25px;
  height: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 3px;
  position: relative;
  padding: 1.5px;
}

.battery-icon::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 5px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 0 2px 2px 0;
}

.battery-level {
  height: 100%;
  background: #34c759;
  border-radius: 1px;
}

/* ── Container Layout ── */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-top: calc(var(--status-h) + 8px);
  padding-bottom: calc(var(--tab-bar-h) + 24px);
}

/* ── Tab Content Animations ── */
.tab-content {
  display: none;
  animation: fadeSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
  display: block;
}

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

/* ── Page Header ── */
.page-header {
  padding: 20px 20px 8px;
}

.page-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.page-greeting {
  font-size: 11px;
  color: var(--accent-2);
  font-weight: 800;
  letter-spacing: 1.2px;
  display: block;
  margin-bottom: 2px;
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 30%, rgba(255, 255, 255, 0.75));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--glass-strong);
}

.notif-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff2d55;
  box-shadow: 0 0 10px #ff2d55;
}

.avatar-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.avatar-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

/* ── Modern Search Bar ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 13px 18px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14.5px;
  transition: all 0.2s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.search-bar:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.search-bar:active {
  transform: scale(0.98);
}

/* ── Section Titles & Headers ── */
.section-wrap {
  padding: 18px 0 6px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.section-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.see-all {
  background: none;
  border: none;
  color: var(--accent-2);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.see-all:hover {
  opacity: 0.8;
}

/* ── Categories Pill Scroll ── */
.categories-scroll {
  display: flex;
  gap: 10px;
  padding: 4px 20px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  white-space: nowrap;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cat-chip.active {
  background: linear-gradient(135deg, var(--accent), #5b3ddc);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(124, 92, 252, 0.4);
}

.cat-chip:not(.active):hover {
  background: var(--glass-strong);
  color: var(--text-primary);
}

/* ── Hero Carousel ── */
.featured-carousel {
  display: flex;
  gap: 16px;
  padding: 4px 20px 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.featured-carousel::-webkit-scrollbar {
  display: none;
}

.featured-card {
  min-width: calc(100vw - 48px);
  max-width: 480px;
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.featured-card:active {
  transform: scale(0.98);
}

.fc-1 { background: linear-gradient(135deg, #1b0c40 0%, #3e1ea8 50%, #7c5cfc 100%); }
.fc-2 { background: linear-gradient(135deg, #092618 0%, #0c6135 50%, #00d084 100%); }
.fc-3 { background: linear-gradient(135deg, #2b0b18 0%, #7a1443 50%, #ff2d55 100%); }

.fc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.fc-badge {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.fc-app-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fc-app-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.fc-details {
  flex: 1;
  min-width: 0;
}

.fc-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 2px;
}

.fc-btn {
  background: rgba(255, 255, 255, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  border-radius: 100px;
  padding: 8px 22px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.fc-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.fc-btn:active {
  transform: scale(0.94);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glass-border);
  transition: all 0.3s ease;
}

.dot.active {
  width: 22px;
  border-radius: 4px;
  background: var(--accent);
}

/* ── Clean iOS App List Rows ── */
.app-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 16px;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.app-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border);
}

.app-row:active {
  transform: scale(0.99);
}

.app-rank {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-tertiary);
  width: 20px;
  text-align: center;
}

.app-row-icon {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-row-info {
  flex: 1;
  min-width: 0;
}

.app-row-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.app-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.app-cat-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(124, 92, 252, 0.15);
  color: var(--accent-2);
}

.app-row-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.app-row-rating {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

/* iOS Style GET Pill Button */
.get-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  color: var(--accent-2);
  border-radius: 100px;
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.get-btn:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.4);
}

.get-btn.installed {
  background: rgba(52, 199, 89, 0.15);
  border-color: rgba(52, 199, 89, 0.4);
  color: #34c759;
}

.get-btn.update {
  background: rgba(255, 45, 85, 0.15);
  border-color: rgba(255, 45, 85, 0.4);
  color: #ff2d55;
}

.get-btn:active {
  transform: scale(0.92);
}

/* ── App Grid (New Releases) ── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0 20px;
}

.app-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: var(--bg-card);
  padding: 16px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  transition: all 0.2s ease;
}

.app-grid-item:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.app-grid-icon {
  width: 68px;
  height: 68px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-grid-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-grid-btn {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-2);
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 100px;
  padding: 4px 14px;
  cursor: pointer;
  font-family: inherit;
}

/* ── Browse Grid Layout ── */
.browse-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 16px 24px;
}

.filter-bar {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(124, 92, 252, 0.35);
}

/* ── Search Bar Active ── */
.search-bar-active {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1.5px solid var(--glass-border);
  border-radius: 16px;
  padding: 13px 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin-top: 14px;
}

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

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

.clear-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--text-secondary);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.clear-btn.visible {
  display: flex;
}

.search-recent {
  padding: 24px 20px;
}

.recent-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.recent-tags, .trending-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recent-tag, .trend-tag {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.trend-tag:hover {
  background: rgba(124, 92, 252, 0.2);
  color: var(--text-primary);
  border-color: rgba(124, 92, 252, 0.4);
}

.search-results {
  padding: 0 16px;
}

.results-count {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 4px 8px 12px;
}

.hidden {
  display: none !important;
}

/* ── Notification Center Drawer ── */
.notif-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.notif-drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.notif-drawer {
  position: absolute;
  top: calc(var(--status-h) + 10px);
  right: 16px;
  width: calc(100vw - 32px);
  max-width: 380px;
  background: rgba(16, 14, 28, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(32px);
  transform: translateY(-10px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-drawer-overlay.open .notif-drawer {
  transform: translateY(0) scale(1);
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.notif-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-header-title h2 {
  font-size: 17px;
  font-weight: 800;
}

.notif-count-badge {
  font-size: 10px;
  font-weight: 800;
  background: #ff2d55;
  color: #fff;
  border-radius: 100px;
  padding: 2px 8px;
}

.notif-clear-btn {
  background: none;
  border: none;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px;
}

.notif-item-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.notif-item-content {
  flex: 1;
}

.notif-item-title {
  font-size: 13.5px;
  font-weight: 700;
}

.notif-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.notif-item-time {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ── Updates Tab ── */
.updates-container {
  padding: 12px 16px 24px;
}

.update-all-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #ffffff;
  border-radius: 100px;
  padding: 9px 22px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(124, 92, 252, 0.35);
}

.update-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  margin-bottom: 10px;
}

.update-info {
  flex: 1;
  min-width: 0;
}

.update-name {
  font-size: 15px;
  font-weight: 700;
}

.update-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.update-changelog {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
  line-height: 1.4;
}

.update-btn {
  background: rgba(255, 45, 85, 0.15);
  border: 1.5px solid rgba(255, 45, 85, 0.4);
  color: #ff2d55;
  border-radius: 100px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

/* ── Profile Section ── */
.profile-card {
  margin: 16px 20px;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.profile-avatar-lg {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 32px rgba(124, 92, 252, 0.45);
}

.profile-info {
  text-align: center;
}

.profile-name {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-handle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.profile-stats {
  display: flex;
  gap: 36px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.65));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Settings List ── */
.settings-list {
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-group {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.settings-row:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 54px;
  right: 0;
  height: 0.5px;
  background: var(--glass-border);
}

.settings-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.settings-icon {
  font-size: 22px;
  width: 32px;
  text-align: center;
}

.settings-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.s-title {
  font-size: 15px;
  font-weight: 600;
}

.s-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}

.chevron {
  font-size: 20px;
  color: var(--text-tertiary);
}

/* ── Toggle Switch ── */
.toggle {
  width: 50px;
  height: 30px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.toggle.active {
  background: linear-gradient(90deg, var(--accent), #5b3ddc);
  box-shadow: 0 2px 12px rgba(124, 92, 252, 0.4);
}

.toggle-knob {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle.active .toggle-knob {
  transform: translateX(20px);
}

/* ── Bottom Glass Tab Bar ── */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tab-bar-h);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
  padding-bottom: var(--safe-bottom);
  backdrop-filter: blur(32px) saturate(210%);
  -webkit-backdrop-filter: blur(32px) saturate(210%);
  background: rgba(7, 7, 14, 0.82);
  border-top: 0.5px solid rgba(255, 255, 255, 0.1);
  z-index: 250;
  max-width: 1080px;
  margin: 0 auto;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  position: relative;
  padding: 8px 4px;
  transition: color 0.2s ease;
}

.tab-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-icon svg {
  width: 22px;
  height: 22px;
  transition: all 0.2s ease;
}

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

.tab-btn.active .tab-icon {
  filter: drop-shadow(0 0 10px rgba(124, 92, 252, 0.8));
}

.tab-btn:active {
  transform: scale(0.9);
}

.badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 20px);
  background: #ff2d55;
  color: #fff;
  border-radius: 100px;
  font-size: 9px;
  font-weight: 800;
  padding: 1.5px 6px;
  min-width: 16px;
  text-align: center;
  border: 1.5px solid var(--bg-deep);
}

/* ── App Detail Sheet Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-sheet {
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  background: rgba(14, 12, 26, 0.97);
  border-radius: 28px 28px 0 0;
  padding: 0 0 calc(28px + var(--safe-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(40px);
  max-width: 640px;
  margin: 0 auto;
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  margin: 12px auto 20px;
}

.modal-header {
  display: flex;
  gap: 18px;
  padding: 0 24px 20px;
}

.modal-app-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.modal-app-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-app-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

.modal-app-dev {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.stars {
  color: #ffd60a;
  font-size: 14px;
}

.rating-count {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: 4px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  padding: 0 24px 20px;
}

.modal-get-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #5b3ddc);
  border: none;
  color: #ffffff;
  border-radius: 100px;
  padding: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 24px rgba(124, 92, 252, 0.45);
  transition: all 0.2s ease;
}

.modal-get-btn:active {
  transform: scale(0.96);
}

.modal-wish-btn, .modal-share-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass);
  border: 1.5px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-tabs {
  display: flex;
  border-bottom: 0.5px solid var(--glass-border);
  padding: 0 24px;
}

.modal-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
}

.modal-tab.active {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
}

.modal-body {
  padding: 24px;
}

/* ── Info Grid ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.info-cell {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}

.info-cell-val {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 2px;
}

.info-cell-label {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.info-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.compat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compat-tag {
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.3);
  color: #34c759;
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: calc(var(--tab-bar-h) + 16px);
  left: 16px;
  right: 16px;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(20, 18, 36, 0.96);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(28px);
  z-index: 400;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  font-size: 24px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
}

.toast-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.toast-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  width: 0%;
  transition: width 0.15s ease;
}

/* Responsive Desktop Optimization */
@media (min-width: 768px) {
  .app-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .browse-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .featured-card {
    min-width: 440px;
  }
}
