/* ── CSS Variables — Light ─────────────────────────────────── */
:root {
  --primary:        #635BFF;
  --primary-light:  rgba(99, 91, 255, 0.12);
  --accent:         #00D9FF;
  --accent-light:   rgba(0, 217, 255, 0.14);
  --neon-yellow:    #E9FF70;
  --mint:           #00FFB3;
  --mint-light:     rgba(0, 255, 179, 0.14);
  --coral:          #FF7A5C;
  --magenta:        #FF4D9D;
  --lime:           #C7F900;
  --bg:             #F8F9FF;
  --surface:        #FFFFFF;
  --surface2:       #F0F1FA;
  --primary-text:   #3C4257;
  --secondary-text: #697386;
  --hint:           #A3ACBA;
  --divider:        #E3E8EF;
  --sidebar-w:      260px;
  --hero-grad:      linear-gradient(135deg, rgba(99,91,255,.18) 0%, rgba(0,217,255,.18) 100%);
  --hero-text:      #3C4257;
  --card-shadow:    0 2px 12px rgba(60,66,87,.08);
  --card-hover-shadow: 0 14px 36px rgba(99,91,255,.22);
  --topbar-bg:      rgba(255,255,255,0.85);
}

/* ── Dark Mode Variables ────────────────────────────────────── */
[data-theme="dark"] {
  --bg:             #0F1020;
  --surface:        #1A1B2E;
  --surface2:       #13142280;
  --primary-text:   #F8F9FF;
  --secondary-text: #A3ACBA;
  --hint:           #697386;
  --divider:        #2D2E42;
  --hero-grad:      linear-gradient(135deg, rgba(99,91,255,.28) 0%, rgba(0,217,255,.22) 100%);
  --hero-text:      #F8F9FF;
  --card-shadow:    0 2px 12px rgba(0,0,0,.35);
  --card-hover-shadow: 0 14px 36px rgba(99,91,255,.35);
  --topbar-bg:      rgba(26,27,46,0.88);
}

/* ── Reset / Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--primary-text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Poppins', sans-serif; }

/* ── Layout ────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--divider);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: background .3s, border-color .3s;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
}

.logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 700; font-size: 15px;
  color: var(--primary-text);
}

.nav-group { padding: 0 12px; margin-bottom: 8px; }

.nav-group-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: .09em;
  color: var(--hint);
  padding: 0 8px 8px;
  text-transform: uppercase;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: var(--secondary-text);
  cursor: pointer;
  transition: background .18s, color .18s;
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item .material-symbols-rounded { font-size: 20px; }

.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ── Main Area ─────────────────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-width: 0;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 90;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--divider);
  padding: 12px 40px;
  display: flex; align-items: center; gap: 16px;
  transition: background .3s, border-color .3s;
}

.search-wrap { flex: 1; position: relative; }

.search-wrap .material-symbols-rounded {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--hint); font-size: 20px;
  pointer-events: none;
}

.search-input {
  width: 100%; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  background: var(--bg);
  padding: 0 16px 0 44px;
  font-size: 14px; font-family: 'Inter', sans-serif;
  color: var(--primary-text);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .3s, color .3s;
}

.search-input::placeholder { color: var(--hint); }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,91,255,.12); }

.topbar-icon-btn {
  width: 38px; height: 38px;
  border: none; background: transparent;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--secondary-text);
  cursor: pointer; transition: background .15s;
}

.topbar-icon-btn:hover { background: var(--primary-light); color: var(--primary); }

/* Dark mode toggle */
.theme-toggle {
  width: 38px; height: 38px;
  border: 1.5px solid var(--divider);
  background: transparent;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--secondary-text);
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  flex-shrink: 0;
}

.theme-toggle:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff; font-size: 13px; font-weight: 700;
  font-family: 'Poppins', sans-serif;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
}

/* ── Page Content ──────────────────────────────────────────── */
.page-content {
  padding: 32px 40px 60px;
  display: flex; flex-direction: column; gap: 36px;
}

/* ── Hero Banner ───────────────────────────────────────────── */
.hero-banner {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  height: 280px;
  background: var(--hero-grad);
  transition: background .3s;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-blob-tr {
  width: 320px; height: 320px;
  top: -100px; right: -80px;
  background: radial-gradient(circle, rgba(0,217,255,.35) 0%, transparent 70%);
  animation: float 5s ease-in-out infinite;
}

.hero-blob-bl {
  width: 220px; height: 220px;
  bottom: -70px; left: -50px;
  background: radial-gradient(circle, rgba(99,91,255,.35) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite reverse;
}

.hero-content {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 0 52px;
  gap: 12px;
}

.hero-badge {
  display: inline-flex; align-items: center;
  background: var(--neon-yellow);
  color: #3C4257;
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em;
  padding: 4px 14px;
  border-radius: 999px;
  width: fit-content;
}

.hero-title {
  font-size: 34px; font-weight: 700; line-height: 1.18;
  color: var(--hero-text);
  transition: color .3s;
}

.hero-sub {
  font-size: 15px; color: var(--secondary-text);
  transition: color .3s;
}

.hero-btns { display: flex; gap: 14px; margin-top: 6px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-brand {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer; border: none;
  transition: transform .18s, box-shadow .18s;
  text-decoration: none;
}

.btn-brand-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,91,255,.4);
}

.btn-brand-primary:hover {
  transform: scale(1.04);
  box-shadow: 0 7px 22px rgba(99,91,255,.55);
  color: #fff;
}

.btn-brand-outline {
  background: transparent;
  color: var(--primary-text);
  border: 1.5px solid var(--divider);
  backdrop-filter: blur(6px);
}

[data-theme="dark"] .btn-brand-outline { border-color: rgba(255,255,255,.25); color: var(--primary-text); }

.btn-brand-outline:hover {
  transform: scale(1.03);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(99,91,255,.18);
}

/* ── Section Header ────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px; font-weight: 700;
  color: var(--primary-text);
}

.view-all {
  font-size: 13px; font-weight: 600;
  color: var(--primary);
  cursor: pointer; text-decoration: none;
}

.view-all:hover { text-decoration: underline; }

/* ── Category Pills ────────────────────────────────────────── */
.cats-row {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.cats-row::-webkit-scrollbar { display: none; }

.cat-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--divider);
  font-size: 13px; font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: var(--secondary-text);
  cursor: pointer; white-space: nowrap;
  transition: transform .18s, box-shadow .18s, border-color .18s, color .18s, background .3s;
  flex-shrink: 0;
}

.cat-pill .material-symbols-rounded { font-size: 18px; }

.cat-pill:hover,
.cat-pill.active-pill {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99,91,255,.18);
}

.cat-pill.active-pill {
  background: var(--primary-light);
  font-weight: 700;
}

/* ── Filter Chips ──────────────────────────────────────────── */
.chips-row { display: flex; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  border: 1.5px solid var(--divider);
  background: transparent;
  color: var(--secondary-text);
  transition: .18s;
}

.chip .material-symbols-rounded { font-size: 14px; }

.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.chip:not(.active):hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── App Cards ─────────────────────────────────────────────── */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.app-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--divider);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--card-shadow);
  transition: transform .22s, box-shadow .22s, background .3s, border-color .3s;
  cursor: pointer;
}

.app-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow);
}

/* Horizontal top row: icon + name/category */
.app-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-icon-wrap {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  overflow: hidden;
}

.app-icon-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

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

.app-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 700; font-size: 15px;
  color: var(--primary-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.app-cat-badge {
  font-size: 11px; font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 9px;
  border-radius: 999px;
  width: fit-content;
  margin-top: 4px;
}

.badge-design    { background: rgba(0,217,255,.14); color: #00A8C8; }
.badge-finance   { background: rgba(0,200,100,.14); color: #00964A; }
.badge-prod      { background: rgba(99,91,255,.14); color: var(--primary); }
.badge-gaming    { background: rgba(255,77,157,.14); color: #D6006A; }
.badge-health    { background: rgba(0,255,179,.14); color: #00A06B; }
.badge-dev       { background: rgba(0,217,255,.14); color: #0098C8; }

[data-theme="dark"] .badge-design  { background: rgba(0,217,255,.18); color: #00D9FF; }
[data-theme="dark"] .badge-finance { background: rgba(0,255,100,.18); color: #00FFB3; }
[data-theme="dark"] .badge-prod    { background: rgba(99,91,255,.18); color: #A59FFF; }
[data-theme="dark"] .badge-gaming  { background: rgba(255,77,157,.18); color: #FF4D9D; }
[data-theme="dark"] .badge-health  { background: rgba(0,255,179,.18); color: #00FFB3; }
[data-theme="dark"] .badge-dev     { background: rgba(0,217,255,.18); color: #00D9FF; }

.app-desc {
  font-size: 13px; color: var(--secondary-text);
  line-height: 1.5; flex: 1;
}

/* Bottom row: rating + download button */
.app-card-bottom {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.app-rating {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600;
  color: var(--primary-text);
}

.app-rating .material-symbols-rounded {
  font-size: 16px; color: #FFB800;
}

.btn-download {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 13px; font-weight: 700;
  font-family: 'Poppins', sans-serif;
  background: var(--primary);
  color: #fff;
  border: none; cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 3px 8px rgba(99,91,255,.3);
}

.btn-download:hover {
  background: #4e46e5;
  transform: scale(1.04);
  box-shadow: 0 5px 14px rgba(99,91,255,.45);
  color: #fff; text-decoration: none;
}

a.btn-download { text-decoration: none; }

.btn-download:disabled {
  opacity: .45; cursor: not-allowed;
  transform: none; box-shadow: none;
}

/* icon gradient helpers */
.gi-design  { background: linear-gradient(135deg, #FF7A5C28, #E9FF7030); }
.gi-finance { background: linear-gradient(135deg, #FFB80028, #E9FF7030); }
.gi-prod    { background: linear-gradient(135deg, #00D9FF22, #635BFF22); }
.gi-gaming  { background: linear-gradient(135deg, #FF4D9D22, #635BFF22); }
.gi-health  { background: linear-gradient(135deg, #00FFB322, #00D9FF22); }
.gi-dev     { background: linear-gradient(135deg, #635BFF22, #00D9FF22); }

/* ── Why Section ───────────────────────────────────────────── */
.why-card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 20px;
  padding: 40px 48px;
  transition: background .3s, border-color .3s;
}

.why-title {
  font-size: 20px; font-weight: 700;
  color: var(--primary-text);
  text-align: center; margin-bottom: 32px;
}

.why-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.why-feature {
  display: flex; flex-direction: column;
  align-items: center; gap: 10px; text-align: center;
}

.why-icon-wrap {
  width: 54px; height: 54px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.why-feature-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 700; font-size: 15px;
  color: var(--primary-text);
}

.why-feature-desc { font-size: 13px; color: var(--secondary-text); }

/* ── Fade-in ───────────────────────────────────────────────── */
.fade-in-section {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .5s ease, transform .5s ease;
}

.fade-in-section.visible { opacity: 1; transform: translateY(0); }

/* ── Float keyframes ───────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-18px); }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .apps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .sidebar { display: none; }
  .main-area { margin-left: 0; }
  .topbar { padding: 12px 20px; }
  .page-content { padding: 20px 20px 48px; }
  .hero-content { padding: 0 28px; }
  .hero-title { font-size: 26px; }
  .why-features { grid-template-columns: 1fr; }
  .why-card { padding: 28px 20px; }
}

@media (max-width: 640px) {
  .apps-grid { grid-template-columns: 1fr; }
  .hero-banner { height: auto; min-height: 240px; }
  .hero-btns { flex-wrap: wrap; }
}
