/* =============================================================================
   ArcadeX Homepage Builder — Styles
   Uses only CSS custom properties defined in main.css
   ============================================================================= */

/* ── 1. Featured Banner / Hero Slider ─────────────────────────────────────── */
.home-section--featured-banner {
  margin-bottom: var(--space-2xl);
  border-top: none;
  padding-top: 0;
}

.featured-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);
}

.featured-banner__track {
  display: flex;
  width: 100%;
  min-height: 400px;
}

@media (min-width: 768px) {
  .featured-banner__track { min-height: 480px; }
}
@media (min-width: 1200px) {
  .featured-banner__track { min-height: 540px; }
}

.featured-banner__slide {
  flex: 0 0 100%;
  width: 100%;
  position: relative;
  display: none;
  min-height: inherit;
}
.featured-banner__slide.is-active { display: block; }

.featured-banner__bg {
  width: 100%;
  height: 100%;
  max-height: 540px;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: brightness(0.75);
}

.featured-banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0,0,0,.7) 0%,
    rgba(0,0,0,.2) 50%,
    transparent 100%
  );
  pointer-events: none;
}

.featured-banner__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 600px;
}

.featured-banner__cat {
  display: inline-block;
  padding: 3px 12px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: fit-content;
}

.featured-banner__title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 900;
  color: var(--color-white);
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
  margin: 0;
}

.featured-banner__plays {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.8);
  font-size: 0.875rem;
}

.featured-banner__play-btn {
  margin-top: var(--space-sm);
  width: fit-content;
  padding: 0.625rem 1.5rem;
  box-shadow: 0 4px 20px rgba(124,58,237,.5);
}

/* Arrows */
.featured-banner__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  background: rgba(15,15,26,.7);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), opacity var(--transition-fast);
  opacity: 0;
}
.featured-banner:hover .featured-banner__arrow { opacity: 1; }
.featured-banner__arrow:hover { background: var(--color-primary); border-color: var(--color-primary); }
.featured-banner__arrow--prev { left: var(--space-md); }
.featured-banner__arrow--next { right: var(--space-md); }

/* Dot nav */
.featured-banner__dots {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-lg);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.featured-banner__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), width var(--transition-fast);
  padding: 0;
}
.featured-banner__dot.is-active {
  background: var(--color-primary);
  width: 24px;
  border-radius: 4px;
}

/* Slide-in animation */
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.featured-banner__slide.is-active .featured-banner__caption {
  animation: slideIn 0.4s ease forwards;
}

/* ── 2. Period Tabs ─────────────────────────────────────────────────────────── */
.section-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.section-tab {
  padding: 0.35rem 0.875rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.section-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.section-tab.is-active,
.section-tab[aria-selected="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

/* Tab panels */
.section-panel { display: none; }
.section-panel.is-active,
.section-panel:not([hidden]) { display: block; }
.section-panel { padding-top: var(--space-lg); }

/* Loading spinner */
.section-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; }

/* ── 3. Category Row (horizontal scroll) ────────────────────────────────────── */
.home-section--category-row { overflow: hidden; }

.category-row-wrapper {
  position: relative;
  padding-inline: var(--space-xl);
}

.category-row__scroll {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-block: var(--space-xs) var(--space-md);
  scroll-snap-type: x mandatory;
}
.category-row__scroll::-webkit-scrollbar { display: none; }

.category-row__item {
  flex: 0 0 220px;
  scroll-snap-align: start;
}
@media (min-width: 768px) {
  .category-row__item { flex: 0 0 200px; }
}
@media (min-width: 1200px) {
  .category-row__item { flex: 0 0 220px; }
}

/* Arrows */
.category-row__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-calc(50% + var(--space-md)));
  z-index: 5;
  width: 40px;
  height: 40px;
  background: var(--color-header-bg);
  border: 1px solid var(--color-primary);
  border-radius: 50%;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  padding: 0;
}
.category-row__arrow:hover {
  background: var(--color-primary);
  color: var(--color-white);
}
.category-row__arrow:disabled {
  opacity: 0.25;
  pointer-events: none;
}
.category-row__arrow--prev { left: -8px; }
.category-row__arrow--next { right: -8px; }

/* Fade edges for visual polish */
.category-row-wrapper::before,
.category-row-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--space-xl);
  z-index: 2;
  pointer-events: none;
}
.category-row-wrapper::before {
  left: 0;
  background: linear-gradient(to right, var(--color-bg), transparent);
}
.category-row-wrapper::after {
  right: 0;
  background: linear-gradient(to left, var(--color-bg), transparent);
}

/* ── 4. Like Bar ─────────────────────────────────────────────────────────────── */
.game-card__like-bar,
.game-card-with-likes .game-card__like-bar {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-xs) var(--space-md) var(--space-sm);
  border-top: 1px solid var(--color-border);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.like-btn:hover { color: var(--color-text); background: var(--color-surface-2); }
.like-btn[data-voted="like"] { color: var(--color-secondary); }
.like-btn[data-voted="dislike"] { color: #ef4444; }

/* ── 5. Rating row below game card ──────────────────────────────────────────── */
.game-card__rating-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md) var(--space-sm);
  border-top: 1px solid var(--color-border);
}
.game-card__rating-row .arcadex-stars { font-size: 0.75rem; }
.game-card__rating-row .game-rating-text {
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* ── 6. Trending flame emoji ────────────────────────────────────────────────── */
.section-title--trending .trending-flame {
  display: inline;
  font-style: normal;
}

/* ── 7. Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .featured-banner__arrow { display: none; }
  .featured-banner__caption { padding: 1.25rem; }
  .featured-banner__title { font-size: 1.375rem; }
  .category-row-wrapper { padding-inline: var(--space-sm); }
  .category-row__item { flex: 0 0 160px; }
  .section-tabs { gap: 4px; }
  .section-tab { font-size: 0.75rem; padding: 0.25rem 0.625rem; }
  .featured-banner__dots { bottom: var(--space-sm); right: var(--space-sm); }
}

@media (max-width: 480px) {
  .category-row__item { flex: 0 0 140px; }
  .featured-banner__play-btn { padding: 0.5rem 1.25rem; font-size: 0.875rem; }
}
