/* ================================================
   SportHub — Home Page Styles
   Banner, Categories, Announcements, Ads, Sponsors
   ================================================ */

/* ─── Banner Carousel ─── */
.banner-carousel { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; box-shadow: var(--banner-shadow); }
.banner-track { display: flex; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.banner-slide { min-width: 100%; aspect-ratio: 2.2/1; display: flex; align-items: flex-end; padding: 1.2rem; position: relative; }
.banner-slide.banner-placeholder { background: var(--bg-elevated) !important; border: 2px dashed var(--border); }
.banner-slide.skeleton-slide { padding: 0; }
.banner-slide.skeleton-slide::after { display: none; }
.banner-skeleton { position: absolute; inset: 0; border-radius: var(--radius); }
.banner-img-placeholder { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: .75rem; font-weight: 600; color: var(--text-muted); font-family: monospace; z-index: 0; }
.banner-slide::after { content:''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.35), transparent 60%); }
.banner-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.25); color: #fff; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; backdrop-filter: blur(4px); transition: background var(--transition); }
.banner-arrow:hover { background: rgba(0,0,0,.45); }
.banner-arrow-left { left: .5rem; }
.banner-arrow-right { right: .5rem; }
.banner-content { position: relative; z-index: 1; color: #fff; }
.banner-tag { display: inline-block; padding: .2rem .6rem; border-radius: var(--radius-full); background: rgba(255,255,255,.2); backdrop-filter: blur(8px); font-size: .7rem; font-weight: 600; margin-bottom: .4rem; }
.banner-content h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; margin-bottom: .15rem; }
.banner-content p { font-size: .8rem; opacity: .85; }
.banner-dots { position: absolute; bottom: .6rem; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.banner-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); cursor: pointer; transition: all var(--transition); }
.banner-dot.active { background: #fff; width: 20px; border-radius: 4px; }

/* ─── Category Bar ─── */
.category-bar { display: flex; gap: .6rem; overflow-x: auto; padding: .2rem .2rem .8rem; -webkit-overflow-scrolling: touch; }
.category-bar::-webkit-scrollbar { display: none; }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: .2rem; min-width: 56px; padding: .5rem; border-radius: var(--radius); background: var(--bg-card); border: 1.5px solid var(--border); cursor: pointer; transition: all var(--transition); }
.cat-item span { font-size: 1.3rem; }
.cat-item small { font-size: .65rem; color: var(--text-secondary); white-space: nowrap; }
.cat-item.active { border-color: var(--accent); background: var(--accent-bg); }
.cat-item.active small { color: var(--accent); font-weight: 600; }
.cat-item:hover:not(.locked) { border-color: var(--accent); }
.cat-item.locked {
  opacity: .35;
  cursor: not-allowed;
  filter: grayscale(60%);
  pointer-events: none;
  position: relative;
}
.cat-lock {
  font-size: .5rem;
  position: absolute;
  top: 2px;
  right: 2px;
}

/* ─── Announcement Marquee ─── */
.announce-marquee-wrap {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden; margin-bottom: .8rem; height: 38px; padding: 0 .6rem;
}
.announce-marquee-label {
  flex-shrink: 0; padding: .15rem .55rem; border-radius: var(--radius-full);
  background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700;
  letter-spacing: .5px;
}
.announce-marquee-track {
  flex: 1; overflow: hidden; position: relative; height: 100%;
  display: flex; align-items: center; mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%);
}
.announce-marquee-inner {
  display: inline-flex; gap: 2.5rem; white-space: nowrap;
  animation: marquee-scroll var(--marquee-duration, 20s) linear infinite;
}
.announce-marquee-inner:hover { animation-play-state: paused; }
.announce-marquee-item {
  font-size: .82rem; color: var(--text-secondary); cursor: pointer;
  transition: color .2s; display: inline-flex; align-items: center; gap: .3rem;
}
.announce-marquee-item::before {
  content: ''; display: inline-block; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent); flex-shrink: 0;
}
.announce-marquee-item:hover { color: var(--accent); }
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── Horizontal Scroll Cards ─── */
.horizontal-scroll { display: flex; gap: .65rem; overflow-x: auto; padding: .2rem .2rem .6rem; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; scroll-behavior: smooth; }
/* Mobile: hide scrollbar, use touch */
.horizontal-scroll::-webkit-scrollbar { display: none; }
.horizontal-scroll { scrollbar-width: none; }
/* PC wide: show styled scrollbar */
@media (min-width: 601px) {
  .horizontal-scroll { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; padding-bottom: .9rem; }
  .horizontal-scroll::-webkit-scrollbar { display: block; height: 6px; }
  .horizontal-scroll::-webkit-scrollbar-track { background: transparent; margin: 0 .5rem; }
  .horizontal-scroll::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
  .horizontal-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent-hover, #1d4ed8); }
}
.h-card { min-width: 220px; max-width: 220px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; scroll-snap-align: start; cursor: pointer; transition: all var(--transition); flex-shrink: 0; }
.h-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.h-card-img { height: 90px; overflow: hidden; }
.h-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.h-card-placeholder { border: 2px dashed var(--border); background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 600; color: var(--text-muted); font-family: monospace; }
.h-card-body { padding: .65rem .75rem; }
.h-card-title { font-weight: 700; font-size: .85rem; margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-card-meta { font-size: .72rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: .3rem .8rem; }

/* ─── Floating Ads ─── */
.floating-ads {
  position: fixed;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  will-change: transform;
  transition: top .4s ease;
}
.floating-ads { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none; }
.floating-ads.dragging { cursor: grabbing; transition: none; }
.floating-ads.dragging .float-ad { animation: none; pointer-events: none; }
.float-ad { width: 80px; height: 80px; background: var(--bg-card); border: 2px solid #d1d5db; border-radius: 50%; overflow: hidden; text-align: center; cursor: pointer; opacity: 1; transition: transform .25s ease, box-shadow .25s ease; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,0,0,.15); animation: float-breathe 2.8s ease-in-out infinite; }
.float-ad:hover { animation-play-state: paused; transform: scale(1.12) translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.3); }
@keyframes float-breathe {
  0%,100% { transform: scale(1) translateY(0); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
  50% { transform: scale(1.10) translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
}
.float-ad-img { width: 100%; height: 100%; background: linear-gradient(135deg, #374151, #1f2937); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: .6rem; font-weight: 600; }
.float-ad small { display: none; }

/* ─── Popup Ad Overlay ─── */
.popup-ad-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  animation: popupFadeIn .3s ease;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.popup-ad-container {
  position: relative; width: 82%; max-width: 340px;
  background: var(--bg-card); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.06);
  animation: popupSlideUp .35s cubic-bezier(.4,0,.2,1);
}
.popup-ad-close {
  width: 28px; height: 28px;
  border-radius: 50%; background: var(--bg-elevated); color: var(--text-muted);
  font-size: .82rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 1.5px solid var(--border); flex-shrink: 0;
  transition: all .2s;
}
.popup-ad-close:hover { background: var(--text-muted); color: #fff; }
.popup-ad-body img { display: block; width: 100%; max-height: 65vh; object-fit: contain; border-radius: 0; }
.popup-ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 280px; background: linear-gradient(135deg, #374151, #1f2937); color: #fff; cursor: pointer;
}
.popup-ad-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem .75rem; border-top: 1px solid var(--border);
}
.popup-ad-counter {
  font-size: .72rem; color: var(--text-muted); font-weight: 500; min-width: 2.5rem;
}
.popup-ad-footer-right {
  display: flex; align-items: center; gap: .45rem; margin-left: auto;
}
.popup-ad-dismiss-btn {
  font-size: .72rem; padding: .3rem .7rem; border-radius: 20px;
  border: 1.5px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer; transition: all .2s; font-weight: 500;
}
.popup-ad-dismiss-btn:hover { border-color: var(--accent); color: var(--accent); }
.popup-ad-dismiss-btn.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
@keyframes popupSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes popupFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Sponsor Grid ─── */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 0 .5rem .5rem;
}
.sponsor-slot {
  aspect-ratio: 1;
  border: 1px dashed var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  color: var(--text-muted);
  overflow: hidden;
  background: var(--bg-card);
  cursor: default;
}
.sponsor-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}
.sponsor-slot.has-link { cursor: pointer; }
