/* ========== HERO ========== */
.hero {
  padding: 72px 0 32px;
  text-align: center;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero__accent {
  background: linear-gradient(135deg, var(--accent), #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ========== STATS BANNER ========== */
.stats-banner {
  padding: 12px 0;
  text-align: center;
}

.stats-banner__inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border-radius: 100px;
  background: var(--green-soft);
  border: 1px solid var(--green);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
  animation: statsFadeIn 0.6s ease-out;
}

.stats-banner__icon { font-size: 1.1rem; }

/* User count tag (floating on cards) */
.app-card__users {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--green);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.app-card__users i { font-size: 0.75em; }

/* User badge (detail page hero/sidebar) */
.badge--users {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge--users i { font-size: 0.75em; }

.user-count-value {
  color: var(--green);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.user-count-value i { font-size: 0.9em; }

/* ========== CATALOG ========== */
.catalog { padding: 24px 0 80px; }

.catalog__filters {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.catalog__empty {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 0;
  font-size: 1rem;
}

/* ========== APP CARD ========== */
.app-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  gap: 18px;
  transition: all var(--transition);
  cursor: pointer;
  animation: fadeUp 0.4s ease both;
}

.app-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.app-card:nth-child(2) { animation-delay: 0.06s; }
.app-card:nth-child(3) { animation-delay: 0.12s; }

.app-card__icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
}

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

.app-card__name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.app-card__tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.app-card__desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.app-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge--category { background: var(--accent-soft); color: var(--accent); }
.badge--free { background: var(--green-soft); color: var(--green); }
.badge--paid { background: var(--orange-soft); color: var(--orange); }
.badge--dev { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }

/* ===== Dev Lock Overlay (Card) ===== */
.app-card__icon-wrap {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
}

.app-card__icon-wrap--dev .app-card__icon {
  filter: grayscale(0.7) brightness(0.5);
}

.app-card__lock {
  position: absolute;
  top: 0;
  left: 0;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.8);
  pointer-events: none;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
}

/* ===== Dev Lock Overlay (Hero) ===== */
.app-hero__icon-wrap {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
}

.app-hero__icon-wrap--dev .app-hero__icon {
  filter: grayscale(0.7) brightness(0.5);
}

.app-hero__lock {
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: rgba(255, 255, 255, 0.8);
  pointer-events: none;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 22px;
}

/* ========== APP DETAIL ========== */
.app-detail { padding: 40px 0 80px; }

.app-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}

.app-hero__icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  flex-shrink: 0;
}

.app-hero__info { flex: 1; }

.app-hero__name {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.app-hero__tagline {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 12px;
}

.app-hero__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.app-hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.btn--share {
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--share:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.btn--share.copied {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ========== CONTENT LAYOUT ========== */
.app-content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.app-content__main { min-width: 0; }

/* Screenshots */
.app-screenshots { margin-bottom: 36px; }

.app-screenshots h3,
.app-description h3,
.app-features h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.screenshots-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.screenshots-track::-webkit-scrollbar { height: 6px; }
.screenshots-track::-webkit-scrollbar-track { background: transparent; }
.screenshots-track::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.screenshot-item {
  flex-shrink: 0;
  width: 180px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform var(--transition);
  border: 1px solid var(--border);
}

.screenshot-item:hover { transform: scale(1.03); }
.screenshot-item img { width: 100%; height: auto; display: block; }

/* Description */
.app-description { margin-bottom: 36px; }

.app-description p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* Features */
.app-features ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  transition: background var(--transition), border-color var(--transition);
}

.app-features li::before {
  content: "\F26A";
  font-family: "bootstrap-icons";
  color: var(--green);
  flex-shrink: 0;
  margin-top: 1px;
}

.feature-label {
  font-weight: 600;
  color: var(--text);
}

/* ========== SIDEBAR ========== */
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  transition: background var(--transition), border-color var(--transition);
}

.sidebar-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.sidebar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.sidebar-row:last-child { border-bottom: none; }
.sidebar-row__label { color: var(--text-dim); }
.sidebar-row__value { color: var(--text); font-weight: 500; text-align: right; }

.sidebar-card--tiers h4 { margin-bottom: 12px; }

.tier-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.tier-item:last-child { border-bottom: none; }

.tier-item__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 2px;
}

.tier-item__desc {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ========== LIGHTBOX ========== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-height: 90vh;
  max-width: 90vw;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.lightbox__close:hover { background: rgba(255, 255, 255, 0.2); }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.lightbox__nav:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

/* ========== MOBILE SEARCH (below hero) ========== */
.hero__search-mobile {
  display: none;
  position: relative;
  max-width: 420px;
  margin: 20px auto 0;
}

.hero__search-mobile i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}

.hero__search-mobile input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.hero__search-mobile input::placeholder { color: var(--text-dim); }
.hero__search-mobile input:focus { border-color: var(--accent); }

/* ===== TRIAL BANNER ===== */
.app-trial {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  margin-bottom: 28px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(46, 125, 50, 0.35);
}
.trial-icon { font-size: 1.3rem; line-height: 1; }
.trial-text { flex: 1; }

/* ===== VIDEO SECTION ===== */
.app-videos {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 32px;
}

.app-video { margin-bottom: 0; }

.app-video__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.app-video__header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.btn-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition);
}
.btn-fullscreen:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-fullscreen i { font-size: 0.85rem; }

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 480px) {
  .container { padding: 0 14px; }

  .header__inner { gap: 8px; height: 56px; }
  .header__logo span { display: none; }
  .header__logo i { font-size: 1.5rem; }
  .header__search { display: none; }
  .hero__search-mobile { display: block; }

  .hero { padding: 36px 0 16px; }
  .hero__title { font-size: 1.5rem; }
  .hero__subtitle { font-size: 0.88rem; }

  .catalog { padding: 20px 0 60px; }
  .catalog__grid { grid-template-columns: 1fr; gap: 14px; }
  .app-card { padding: 16px; gap: 14px; }
  .app-card__icon { width: 56px; height: 56px; border-radius: 14px; }
  .app-card__icon-wrap { width: 56px; height: 56px; }
  .app-card__lock { width: 56px; height: 56px; font-size: 1.3rem; border-radius: 14px; }
  .app-card__name { font-size: 1rem; }
  .app-card__tagline { font-size: 0.8rem; }
  .app-card__desc { font-size: 0.78rem; margin-bottom: 10px; }

  .app-content { grid-template-columns: 1fr; gap: 24px; }

  .app-hero {
    flex-direction: column;
    text-align: center;
    gap: 16px;
    margin-bottom: 28px;
  }

  .app-hero__icon { width: 72px; height: 72px; border-radius: 18px; }
  .app-hero__icon-wrap { width: 72px; height: 72px; }
  .app-hero__lock { width: 72px; height: 72px; font-size: 1.8rem; border-radius: 18px; }
  .app-hero__name { font-size: 1.25rem; }
  .app-hero__tagline { font-size: 0.88rem; }

  .app-hero__badges,
  .app-hero__actions { justify-content: center; }

  .app-hero__actions { flex-direction: column; align-items: center; }
  .app-hero__actions .btn { width: 100%; justify-content: center; }

  .btn { padding: 11px 20px; font-size: 0.85rem; }

  .screenshot-item { width: 130px; }

  .app-screenshots h3,
  .app-description h3,
  .app-features h3 { font-size: 1rem; }

  .app-features li { padding: 12px; font-size: 0.84rem; }

  .sidebar-card { padding: 18px; }
  .sidebar-row { font-size: 0.82rem; padding: 8px 0; }

  .footer { padding: 20px 0; }
  .footer__inner {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    font-size: 0.78rem;
  }

  .catalog__filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 6px;
    margin-bottom: 20px;
  }

  .catalog__filters::-webkit-scrollbar { display: none; }
  .filter-btn { flex-shrink: 0; padding: 7px 16px; font-size: 0.8rem; }

  .lightbox__nav { width: 40px; height: 40px; font-size: 1rem; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__close { top: 10px; right: 10px; width: 38px; height: 38px; }

  .app-videos {
    margin-left: -14px;
    margin-right: -14px;
    margin-bottom: 28px;
    gap: 24px;
  }
  .app-video__header { padding: 0 14px; }
  .video-wrapper {
    border-radius: 0;
    box-shadow: none;
  }
  .app-trial {
    font-size: 0.88rem;
    padding: 12px 16px;
  }
  .btn-fullscreen {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .header__search { display: none; }
  .hero__search-mobile { display: block; }

  .hero { padding: 48px 0 24px; }
  .hero__title { font-size: 1.8rem; }
  .hero__subtitle { font-size: 0.95rem; }

  .catalog__grid { grid-template-columns: 1fr; }
  .app-content { grid-template-columns: 1fr; }

  .app-hero {
    flex-direction: column;
    text-align: center;
  }

  .app-hero__badges,
  .app-hero__actions { justify-content: center; }

  .app-hero__name { font-size: 1.4rem; }

  .footer__inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .screenshot-item { width: 150px; }

  .catalog__filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .catalog__filters::-webkit-scrollbar { display: none; }
  .filter-btn { flex-shrink: 0; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .catalog__grid { grid-template-columns: repeat(2, 1fr); }
  .app-content { grid-template-columns: 1fr 260px; }
}
