/* =========================================
   GAME DEALS HUB — Dark Glassmorphism UI
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --gdh-accent:   #00d4ff;
  --gdh-bg:       #0a0e1a;
  --gdh-surface:  rgba(255,255,255,0.04);
  --gdh-border:   rgba(255,255,255,0.08);
  --gdh-text:     #e8ecf4;
  --gdh-muted:    rgba(232,236,244,0.45);
  --gdh-radius:   12px;
  --gdh-cols:     4;
}

/* ── WRAPPER ── */
.gdh-wrapper {
  background: var(--gdh-bg);
  border-radius: 20px;
  padding: 32px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--gdh-text);
  position: relative;
  overflow: hidden;
}

.gdh-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(0,212,255,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 110%, rgba(130,80,255,0.07) 0%, transparent 60%);
  pointer-events: none;
}

/* ── HEADER ── */
.gdh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  position: relative;
}

.gdh-header__title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gdh-text);
  text-transform: uppercase;
}

.gdh-header__icon {
  color: var(--gdh-accent);
  filter: drop-shadow(0 0 8px var(--gdh-accent));
}

.gdh-header__live {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gdh-muted);
}

.gdh-live-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e;
  animation: gdh-pulse 2s ease-in-out infinite;
}

@keyframes gdh-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

/* ── CONTROLS ── */
.gdh-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.gdh-controls__row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gdh-controls__row--secondary {
  padding-top: 12px;
  border-top: 1px solid var(--gdh-border);
}

/* Search */
.gdh-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gdh-surface);
  border: 1px solid var(--gdh-border);
  border-radius: 8px;
  padding: 8px 14px;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  transition: border-color .2s;
}
.gdh-search-wrap:focus-within {
  border-color: var(--gdh-accent);
  box-shadow: 0 0 0 2px rgba(0,212,255,0.15);
}
.gdh-search-wrap svg { color: var(--gdh-muted); flex-shrink: 0; }
.gdh-search {
  background: transparent;
  border: none;
  color: var(--gdh-text);
  font-size: 14px;
  width: 100%;
  outline: none;
}
.gdh-search::placeholder { color: var(--gdh-muted); }

/* Store Buttons */
.gdh-store-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.gdh-store-btn {
  padding: 6px 12px;
  background: var(--gdh-surface);
  border: 1px solid var(--gdh-border);
  border-radius: 6px;
  color: var(--gdh-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.gdh-store-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--gdh-text);
  border-color: rgba(255,255,255,0.2);
}
.gdh-store-btn.active {
  background: var(--gdh-accent);
  border-color: var(--gdh-accent);
  color: #000;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(0,212,255,0.35);
}

/* Select */
.gdh-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gdh-muted);
}
.gdh-sort {
  background: var(--gdh-surface);
  border: 1px solid var(--gdh-border);
  border-radius: 6px;
  color: var(--gdh-text);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

/* Price Range */
.gdh-price-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gdh-muted);
}
.gdh-price-val { color: var(--gdh-accent); font-weight: 600; }
.gdh-price-range {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 4px;
  background: var(--gdh-border);
  border-radius: 2px;
  cursor: pointer;
}
.gdh-price-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--gdh-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0,212,255,0.5);
}

/* Toggle */
.gdh-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.gdh-toggle input { display: none; }
.gdh-toggle__track {
  width: 36px;
  height: 20px;
  background: var(--gdh-border);
  border-radius: 10px;
  position: relative;
  transition: background .2s;
}
.gdh-toggle__track::after {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.gdh-toggle input:checked ~ .gdh-toggle__track { background: var(--gdh-accent); }
.gdh-toggle input:checked ~ .gdh-toggle__track::after { transform: translateX(16px); }
.gdh-toggle__label { font-size: 13px; color: var(--gdh-muted); }

/* ── GRID ── */
.gdh-grid {
  display: grid;
  grid-template-columns: repeat(var(--gdh-cols), 1fr);
  gap: 16px;
  position: relative;
}

/* ── CARD ── */
.gdh-card {
  border-radius: var(--gdh-radius);
  background: var(--gdh-surface);
  border: 1px solid var(--gdh-border);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative;
}

.gdh-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--store-accent, var(--gdh-accent)), transparent);
  opacity: 0;
  transition: opacity .25s;
}

.gdh-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
}
.gdh-card:hover::before { opacity: 1; }

.gdh-card__link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Thumb */
.gdh-card__thumb {
  position: relative;
  aspect-ratio: 460/215;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
}
.gdh-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.gdh-card:hover .gdh-card__thumb img { transform: scale(1.04); }

.gdh-card__thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 2.5rem;
}

/* Badge */
.gdh-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--gdh-accent);
  color: #000;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 12px rgba(0,212,255,0.4);
}

/* Store tag */
.gdh-card__store-tag {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.6) !important;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Body */
.gdh-card__body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.gdh-card__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  color: var(--gdh-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta */
.gdh-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gdh-rating {
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gdh-muted);
}
.gdh-rating--positive { color: #4ade80; }
.gdh-rating--positive svg { color: #4ade80; }
.gdh-rating--mixed { color: #facc15; }
.gdh-rating--mixed svg { color: #facc15; }
.gdh-rating--negative { color: #f87171; }
.gdh-rating--negative svg { color: #f87171; }

.gdh-meta-score {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Pricing */
.gdh-card__pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
}

.gdh-price {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.gdh-price--old {
  font-size: 13px;
  color: var(--gdh-muted);
  text-decoration: line-through;
  font-weight: 500;
}
.gdh-price--sale {
  font-size: 22px;
  color: var(--gdh-accent);
  text-shadow: 0 0 8px rgba(0,212,255,0.4);
}
.gdh-price--free {
  font-size: 18px;
  color: #4ade80;
  text-shadow: 0 0 8px rgba(74,222,128,0.4);
}

/* CTA */
.gdh-card__cta { margin-top: 4px; }
.gdh-btn {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gdh-accent);
  transition: color .2s;
}
.gdh-card:hover .gdh-btn { color: #fff; }

/* ── FOOTER ── */
.gdh-footer {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gdh-load-more {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--gdh-surface);
  border: 1px solid var(--gdh-border);
  border-radius: 8px;
  color: var(--gdh-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: 0.03em;
}
.gdh-load-more:hover {
  background: var(--gdh-accent);
  border-color: var(--gdh-accent);
  color: #000;
  box-shadow: 0 4px 16px rgba(0,212,255,0.3);
}
.gdh-load-more svg { transition: transform .2s; }
.gdh-load-more:hover svg { transform: translateY(2px); }

.gdh-footer__note {
  font-size: 11px;
  color: var(--gdh-muted);
  text-align: center;
  margin: 0;
}
.gdh-footer__note a { color: var(--gdh-muted); text-decoration: underline; }

/* ── STATES ── */
.gdh-empty, .gdh-error {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px;
  color: var(--gdh-muted);
  text-align: center;
}
.gdh-empty span { font-size: 3rem; }

.gdh-skeleton {
  background: linear-gradient(90deg, var(--gdh-surface) 25%, rgba(255,255,255,0.06) 50%, var(--gdh-surface) 75%);
  background-size: 200% 100%;
  animation: gdh-shimmer 1.4s infinite;
  border-radius: var(--gdh-radius);
  aspect-ratio: 1/1.4;
}
@keyframes gdh-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── LOADING OVERLAY ── */
.gdh-loading {
  position: relative;
  pointer-events: none;
}
.gdh-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10,14,26,0.7);
  backdrop-filter: blur(2px);
  border-radius: var(--gdh-radius);
  z-index: 10;
}

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .gdh-grid { --gdh-cols: 3; }
}
@media (max-width: 900px) {
  .gdh-grid { --gdh-cols: 2; }
  .gdh-wrapper { padding: 20px; }
}
@media (max-width: 560px) {
  .gdh-grid { --gdh-cols: 1; }
  .gdh-store-filter { display: none; }
  .gdh-header__title { font-size: 1.4rem; }
}

/* ── CARD ENTRANCE ── */
@keyframes gdh-fadeup {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gdh-card {
  animation: gdh-fadeup .35s ease both;
}
.gdh-card:nth-child(1)  { animation-delay: .02s; }
.gdh-card:nth-child(2)  { animation-delay: .04s; }
.gdh-card:nth-child(3)  { animation-delay: .06s; }
.gdh-card:nth-child(4)  { animation-delay: .08s; }
.gdh-card:nth-child(5)  { animation-delay: .10s; }
.gdh-card:nth-child(6)  { animation-delay: .12s; }
.gdh-card:nth-child(7)  { animation-delay: .14s; }
.gdh-card:nth-child(8)  { animation-delay: .16s; }
.gdh-card:nth-child(9)  { animation-delay: .18s; }
.gdh-card:nth-child(10) { animation-delay: .20s; }
.gdh-card:nth-child(11) { animation-delay: .22s; }
.gdh-card:nth-child(12) { animation-delay: .24s; }
