/* ==========================================================================
   Avezz Games & Tools Hubs (1:1 UI/app2.html + Sectioned Category Groups)
   ========================================================================== */

.apps-page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 20px 72px;
}

/* Section Headers (Games: Originals / Mini Games / Quizzes) */
.apps-section {
  margin-bottom: 34px;
}

.apps-section:last-child {
  margin-bottom: 0;
}

.apps-section[hidden] {
  display: none;
}

.apps-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 2px;
}

.apps-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}

.apps-section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}

.apps-section-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-tertiary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 999px;
}

.apps-section-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
}

/* 2-Column Large Stage Grid (UI/app2.html) */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* Horizontal Card */
.app-card {
  display: flex;
  align-items: stretch;
  min-height: 192px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.app-card[hidden] {
  display: none;
}

.app-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-popover);
}

.app-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Image Column with Hover Slideshow */
.app-thumb {
  position: relative;
  width: 44%;
  min-width: 210px;
  flex-shrink: 0;
  background: #111827;
  overflow: hidden;
}

.app-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.app-slide.is-active {
  opacity: 1;
}

.app-card:hover .app-slide.is-active {
  transform: scale(1.03);
}

.app-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.app-card:hover .app-dots {
  opacity: 1;
}

.app-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: background 0.2s ease, transform 0.2s ease;
}

.app-dot.is-active {
  background: #ffffff;
  transform: scale(1.2);
}

/* Text Column */
.app-info {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.app-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.app-cat--original {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
}

[data-theme="dark"] .app-cat--original {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.16);
}

.app-visits {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 6px;
}

.app-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Empty State */
.apps-empty {
  text-align: center;
  padding: 56px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.apps-empty[hidden] {
  display: none;
}

.apps-empty h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}

.apps-empty p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

/* Responsive */
@media (max-width: 920px) {
  .apps-grid {
    grid-template-columns: 1fr;
  }

  .apps-search-input {
    width: 190px;
  }
}

@media (max-width: 560px) {
  .apps-page {
    padding: 14px 12px 56px;
  }

  .apps-header-top {
    padding: 14px 14px;
  }

  .apps-cat-bar {
    padding: 8px 14px 10px;
  }

  .apps-controls,
  .apps-search-box,
  .apps-search-input {
    width: 100%;
  }

  .app-card {
    flex-direction: column;
    min-height: auto;
  }

  .app-thumb {
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 10;
  }

  .app-info {
    padding: 15px 16px;
  }
}
