:root {
  --bg-deep: #050814;
  --bg-navy: #0a1026;
  --bg-card: rgba(15, 21, 46, 0.84);
  --bg-card-hover: rgba(20, 28, 60, 0.94);
  --border-subtle: rgba(139, 92, 246, 0.24);
  --border-bright: rgba(96, 165, 250, 0.55);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-purple: #8b5cf6;
  --accent-violet: #a855f7;
  --accent-blue: #3b82f6;
  --accent-cyan: #38bdf8;
  --shadow-glow: 0 18px 45px rgba(59, 130, 246, 0.16), 0 0 0 1px rgba(139, 92, 246, 0.22);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html, body {
  min-height: 100%;
  background: radial-gradient(circle at 18% 12%, #131c42 0%, #070b1a 48%, #040610 100%);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.bg-orb-left {
  top: -160px;
  left: -140px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
}

.bg-orb-right {
  bottom: -180px;
  right: -120px;
  background: radial-gradient(circle, #2563eb, transparent 70%);
}

.store-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px 36px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Top Navigation Bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-radius: var(--radius-xl);
  background: rgba(11, 16, 36, 0.85);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-logo {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.55));
}

.brand-logo.small {
  width: 26px;
  height: 26px;
}

.brand-text span {
  background: linear-gradient(90deg, #c084fc, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-pill svg {
  width: 15px;
  height: 15px;
}

.nav-pill:hover {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.14);
}

.nav-pill.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.45);
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 240px;
  flex: 0 1 280px;
}

.search-icon {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 10px 34px 10px 38px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(6, 10, 25, 0.85);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

.search-wrap input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.clear-search {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

/* Main */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

/* Hero Banner */
.hero-banner {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  align-items: center;
  gap: 24px;
  padding: 34px 38px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 80% 35%, rgba(56, 189, 248, 0.22), transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.34), transparent 58%),
    linear-gradient(125deg, #0b112c 0%, #15143f 55%, #0b1938 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-copy h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 14px;
}

.hero-accent {
  background: linear-gradient(90deg, #c084fc 0%, #8b5cf6 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.45));
}

.hero-sub {
  font-size: 1.05rem;
  font-weight: 500;
  color: #cbd5e1;
  letter-spacing: 0.04em;
}

.hero-art {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-svg {
  width: 100%;
  max-width: 360px;
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.45));
}

/* Category Pills */
.categories-section {
  display: flex;
  justify-content: center;
}

.categories-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 22, 48, 0.78);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-pill svg {
  width: 18px;
  height: 18px;
  color: #93c5fd;
}

.cat-pill:hover {
  border-color: var(--accent-purple);
  color: #ffffff;
  transform: translateY(-1px);
}

.cat-pill.is-active {
  color: #ffffff;
  border-color: rgba(192, 132, 252, 0.7);
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 55%, #2563eb 100%);
  box-shadow: 0 8px 26px rgba(124, 58, 237, 0.45);
}

.cat-pill.is-active svg {
  color: #ffffff;
}

/* Section Meta & Apps Grid */
.section-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-meta h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.results-count {
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid rgba(139, 92, 246, 0.24);
  box-shadow: 0 14px 35px rgba(2, 6, 23, 0.55);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.app-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
  box-shadow: var(--shadow-glow);
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.app-icon-box {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.app-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-icon-box svg {
  width: 34px;
  height: 34px;
  color: #ffffff;
}

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

.app-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.app-name {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-version {
  font-size: 0.74rem;
  font-weight: 600;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.app-desc {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.app-meta-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.meta-chip.verified {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.32);
  background: rgba(16, 185, 129, 0.1);
}

.download-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: linear-gradient(135deg, #6d28d9 0%, #4f46e5 50%, #2563eb 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.38);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.download-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.55);
}

.download-btn svg {
  width: 18px;
  height: 18px;
}

/* Loading Skeletons */
.skeleton-card {
  height: 186px;
  border-radius: var(--radius-xl);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.8) 25%, rgba(30, 41, 59, 0.9) 50%, rgba(15, 23, 42, 0.8) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border: 1px solid rgba(139, 92, 246, 0.15);
}

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

/* Empty & Error States */
.empty-state,
.error-state {
  text-align: center;
  padding: 48px 24px;
  border-radius: var(--radius-xl);
  background: rgba(12, 18, 40, 0.8);
  border: 1px dashed rgba(139, 92, 246, 0.35);
}

.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  color: #8b5cf6;
}

.empty-state h3,
.error-state h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.empty-state p,
.error-state p {
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.reset-btn {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(139, 92, 246, 0.45);
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* About Section */
.about-card {
  padding: 32px;
  border-radius: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.about-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.about-card > p {
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 780px;
  margin-bottom: 24px;
}

.about-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.pillar {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(9, 14, 34, 0.85);
  border: 1px solid rgba(96, 165, 250, 0.22);
}

.pillar h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: #c4b5fd;
}

.pillar p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Footer */
.store-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius-xl);
  background: rgba(9, 13, 30, 0.85);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.footer-item svg {
  width: 16px;
  height: 16px;
  color: #60a5fa;
}

/* Responsive */
@media (max-width: 860px) {
  .hero-banner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 28px 22px;
  }

  .search-wrap {
    flex: 1 1 100%;
  }
}

@media (max-width: 560px) {
  .store-shell {
    padding: 14px 14px 28px;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }
}
