/* ============================================================
   assets/css/main.css  –  FreebiesGift Public Styles
   Theme: White & Blue  |  Day Mode Only  |  Mobile-First
   ============================================================ */

:root {
  /* ── Palette ── */
  --bg:           #f0f4fa;        /* page background – light blue-grey */
  --bg2:          #ffffff;        /* card / surface */
  --bg3:          #e8eef8;        /* subtle tint */
  --card:         #ffffff;
  --border:       rgba(37,99,235,0.12);
  --border2:      rgba(37,99,235,0.22);

  /* Blue accent scale */
  --accent:       #2563eb;        /* primary blue */
  --accent-dark:  #1d4ed8;        /* hover state */
  --accent-light: #eff6ff;        /* very light blue fill */
  --accent-mid:   #bfdbfe;        /* medium blue tint */

  --accent2:      #dc2626;        /* red for hot/danger */
  --accent3:      #0891b2;        /* teal */

  --text:         #0f172a;        /* near-black */
  --muted:        #475569;        /* slate-600 */
  --dim:          #94a3b8;        /* slate-400 */

  --green:        #16a34a;
  --green-light:  #dcfce7;

  --shadow:       0 1px 3px rgba(37,99,235,0.06), 0 4px 14px rgba(37,99,235,0.05);
  --shadow-hover: 0 4px 16px rgba(37,99,235,0.14), 0 8px 28px rgba(37,99,235,0.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ════════════════════════════════════════
   NAV
   ════════════════════════════════════════ */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1.5px solid var(--border);
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
  box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(37,99,235,0.06);
}
.logo {
  font-family: 'Inter', sans-serif;
  font-weight: 800; font-size: 1.25rem;
  color: var(--accent); text-decoration: none;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
nav ul { display: flex; gap: 4px; list-style: none; align-items: center; }
nav ul a {
  color: var(--muted); text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  padding: 5px 11px; border-radius: 7px;
  transition: all .18s;
  white-space: nowrap;
}
nav ul a:hover { color: var(--accent); background: var(--accent-light); }
.nav-badge {
  background: var(--accent); color: #fff;
  font-size: 0.58rem; font-weight: 700;
  padding: 1px 5px; border-radius: 20px;
  margin-left: 3px; vertical-align: middle;
}

/* ════════════════════════════════════════
   HERO
   ════════════════════════════════════════ */
.hero {
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  border: 1.5px solid var(--accent-mid);
  color: var(--accent);
  font-size: 0.71rem; font-weight: 700;
  padding: 5px 14px; border-radius: 20px;
  margin-bottom: 1.2rem;
  text-transform: uppercase; letter-spacing: 0.6px;
}
h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800; line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--text);
}
h1 .accent { color: var(--accent); }
.hero > p {
  font-size: 1rem; color: var(--muted);
  max-width: 560px; margin: 0 auto 2rem;
  line-height: 1.7;
}

/* Stats bar */
.stats-bar {
  display: flex; justify-content: center; flex-wrap: wrap;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat {
  text-align: center;
  padding: 1.15rem 2rem;
  border-right: 1px solid var(--border);
  flex: 1; min-width: 110px;
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family: 'Inter', sans-serif;
  font-size: 1.55rem; font-weight: 800;
  color: var(--accent); display: block;
}
.stat-label { font-size: 0.72rem; color: var(--muted); font-weight: 500; margin-top: 2px; }

/* ════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════ */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem 5rem; }
.two-col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}
.sidebar { position: sticky; top: 78px; }
.sidebar-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.sidebar-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.9px; margin-bottom: 1rem;
}

/* ════════════════════════════════════════
   SEARCH BAR
   ════════════════════════════════════════ */
.search-wrap {
  max-width: 560px; margin: 0 auto 1.5rem;
  position: relative;
}
.search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); font-size: 1rem;
  pointer-events: none; color: var(--dim);
}
#searchInput {
  width: 100%;
  background: var(--bg2);
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  padding: 13px 14px 13px 44px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: var(--shadow);
}
#searchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
#searchInput::placeholder { color: var(--dim); }

/* ════════════════════════════════════════
   CATEGORY NAV  –  mobile-scrollable strip
   ════════════════════════════════════════ */
.cat-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 2rem;
  /* Desktop: centre-aligned wrap */
  flex-wrap: wrap;
  justify-content: center;
}
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg2);
  border: 1.5px solid var(--border2);
  color: var(--muted);
  padding: 7px 16px; border-radius: 50px;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all .18s;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  box-shadow: var(--shadow);
  white-space: nowrap;    /* ← prevents wrapping mid-label */
  flex-shrink: 0;         /* ← never squish pills */
}
.cat-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(37,99,235,0.3);
}
.cat-count {
  background: rgba(37,99,235,0.1);
  font-size: 0.65rem; padding: 1px 7px;
  border-radius: 20px; font-weight: 700;
  color: var(--accent);
}
.cat-pill.active .cat-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ── Mobile: horizontal scroll strip, no wrapping ── */
@media (max-width: 640px) {
  .cat-nav {
    flex-wrap: nowrap;           /* single row */
    overflow-x: auto;            /* scroll horizontally */
    overflow-y: hidden;
    justify-content: flex-start; /* left-align */
    padding-bottom: 6px;         /* space for scrollbar */
    /* hide scrollbar visually but keep it functional */
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .cat-nav::-webkit-scrollbar { display: none; }
  .cat-pill {
    flex-shrink: 0;
    font-size: 0.8rem;
    padding: 7px 14px;
  }
}

/* Legacy filter-btn (used on game.php pagination) */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 2rem; }
.filter-btn {
  background: var(--bg2); border: 1.5px solid var(--border2); color: var(--muted);
  padding: 6px 16px; border-radius: 8px; font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all .2s; font-family: 'DM Sans', sans-serif;
  text-decoration: none; display: inline-block;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* ════════════════════════════════════════
   SECTION HEADERS
   ════════════════════════════════════════ */
.section-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 1.25rem;
}
.section-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem; font-weight: 800; white-space: nowrap;
}
.section-line { flex: 1; height: 1.5px; background: var(--border); }
.section-count {
  font-size: 0.71rem; color: var(--accent); font-weight: 700;
  background: var(--accent-light);
  border: 1px solid var(--border2);
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}

/* ════════════════════════════════════════
   GAMES GRID
   ════════════════════════════════════════ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.game-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-top: 3px solid transparent;
  border-radius: 14px;
  padding: 1.15rem 1.1rem;
  cursor: pointer; transition: all .2s;
  text-decoration: none; color: inherit;
  display: block; box-shadow: var(--shadow);
}
.game-card:hover {
  border-top-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.game-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 0.85rem;
  background: var(--accent-light);
}
.game-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem; font-weight: 800;
  margin-bottom: 3px; line-height: 1.3;
}
.game-reward { font-size: 0.73rem; color: var(--muted); margin-bottom: 0.75rem; font-weight: 500; }
.game-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.link-count {
  background: var(--accent-light); color: var(--accent);
  border: 1px solid var(--accent-mid);
  font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 5px;
}
.click-count { font-size: 0.68rem; color: var(--dim); font-weight: 500; }
.hot-badge {
  background: #fee2e2; color: var(--accent2);
  border: 1px solid rgba(220,38,38,0.2);
  font-size: 0.62rem; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.4px;
}

/* ════════════════════════════════════════
   CATEGORY HERO BANNER
   ════════════════════════════════════════ */
.cat-hero {
  background: linear-gradient(135deg, var(--accent-light) 0%, #fff 100%);
  border: 1.5px solid var(--accent-mid);
  border-radius: 18px; padding: 2rem 2.5rem;
  margin-bottom: 2rem; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 1.5rem;
  border-left: 5px solid var(--accent);
}
.cat-hero-icon {
  font-size: 2.8rem; width: 72px; height: 72px;
  background: var(--accent-light); border-radius: 18px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cat-hero h2 { font-family: 'Inter', sans-serif; font-size: 1.45rem; font-weight: 800; margin-bottom: 0.3rem; }
.cat-hero p { color: var(--muted); font-size: 0.875rem; line-height: 1.65; margin: 0; }

/* ════════════════════════════════════════
   LATEST LINKS
   ════════════════════════════════════════ */
.latest-section { margin-top: 2.5rem; }
.latest-list { display: flex; flex-direction: column; gap: 8px; }
.latest-item {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 0.85rem 1.1rem;
  display: flex; align-items: center; gap: 0.9rem;
  cursor: pointer; transition: all .18s;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.latest-item:hover {
  border-color: var(--accent);
  transform: translateX(3px);
  box-shadow: var(--shadow-hover);
}
.latest-game-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0; background: var(--accent-light);
}
.latest-info { flex: 1; min-width: 0; }
.latest-name { font-weight: 700; font-size: 0.85rem; }
.latest-time { font-size: 0.73rem; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest-clicks { font-size: 0.72rem; color: var(--dim); flex-shrink: 0; font-weight: 500; }
.new-tag {
  background: var(--green-light); color: var(--green);
  border: 1px solid rgba(22,163,74,0.2);
  font-size: 0.62rem; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  text-transform: uppercase; flex-shrink: 0;
}

/* ════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════ */
.popular-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: all .18s;
  text-decoration: none; color: inherit;
}
.popular-item:last-child { border-bottom: none; }
.popular-item:hover .popular-name { color: var(--accent); }
.popular-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0; background: var(--accent-light);
}
.popular-name { font-size: 0.82rem; font-weight: 600; flex: 1; transition: color .18s; }
.popular-clicks { font-size: 0.7rem; color: var(--muted); font-weight: 500; }
.rank { font-size: 0.68rem; color: var(--dim); width: 18px; text-align: right; font-weight: 700; }

/* ════════════════════════════════════════
   BREADCRUMB
   ════════════════════════════════════════ */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--muted);
  margin-bottom: 1.25rem; padding-top: 1.25rem;
}
.breadcrumb a { color: var(--accent); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--dim); }

/* ════════════════════════════════════════
   ALERT BOX
   ════════════════════════════════════════ */
.alert-box {
  background: var(--accent-light); border: 1px solid var(--accent-mid);
  border-radius: 10px; padding: 0.9rem 1.1rem;
  font-size: 0.82rem; color: var(--muted); line-height: 1.6; margin-bottom: 1.25rem;
}

/* ════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════ */
footer {
  margin-top: 4rem;
  background: var(--bg2);
  border-top: 1.5px solid var(--border);
  padding: 2.5rem 1.5rem 1.5rem;
}
.footer-inner {
  max-width: 1140px; margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-brand .logo { display: block; margin-bottom: 0.6rem; }
.footer-brand p { font-size: 0.78rem; color: var(--muted); line-height: 1.7; }
.footer-col-title {
  font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 700;
  color: var(--text); text-transform: uppercase; letter-spacing: 0.7px;
  margin-bottom: 0.85rem;
}
.footer-col a {
  display: block; color: var(--muted); text-decoration: none;
  font-size: 0.82rem; margin-bottom: 0.5rem; transition: color .18s;
}
.footer-col a:hover { color: var(--accent); }
.footer-copy {
  max-width: 1140px; margin: 2rem auto 0;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
  text-align: center; font-size: 0.74rem; color: var(--dim); line-height: 1.7;
}

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  /* Stats */
  .stats-bar { flex-direction: column; }
  .stat { border-right: none; border-bottom: 1px solid var(--border); padding: 0.9rem 1.5rem; }
  .stat:last-child { border-bottom: none; }

  /* Nav */
  nav ul { display: none; }

  /* Games grid – 2 columns on phone */
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .game-card { padding: 0.9rem 0.85rem; }
  .game-icon { width: 38px; height: 38px; font-size: 1.2rem; }
  .game-name { font-size: 0.82rem; }

  /* Category hero */
  .cat-hero { flex-direction: column; text-align: center; padding: 1.5rem; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }

  /* Hero text */
  .hero { padding: 2rem 1rem 1.5rem; }
  .hero > p { font-size: 0.9rem; }

  /* Search */
  #searchInput { font-size: 0.9rem; padding: 11px 14px 11px 40px; }

  /* Container padding */
  .container { padding: 0 1rem 4rem; }
}
