/* ═══════════════════════════════════════════════════
   PIXORA 4K — ENHANCED v2.0
   Full responsive: Mobile / iPhone / iPad / Laptop / 4K
═══════════════════════════════════════════════════ */

/* ── Reset & Tokens ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

:root {
  /* Dark (default) */
  --bg:           #07070f;
  --surface:      #0f0f1e;
  --card:         #0b0b1a;
  --border:       #1c1c35;
  --border-hov:   #2e2e55;
  --accent:       #00ff88;
  --accent-dim:   rgba(0,255,136,0.10);
  --accent2:      #7b5cff;
  --accent2-dim:  rgba(123,92,255,0.12);
  --text:         #e8e8f2;
  --text-sub:     #9090b0;
  --muted:        #4a4a6a;
  --glow:         0 0 18px rgba(0,255,136,0.28);
  --glow-lg:      0 0 38px rgba(0,255,136,0.18);
  --nav-bg:       rgba(7,7,15,0.92);
  --sheet-bg:     rgba(10,10,22,0.98);
  --shadow-card:  0 12px 40px rgba(0,0,0,0.55);
  --r-sm:  6px;
  --r:     10px;
  --r-lg:  16px;
  --r-xl:  22px;
  --nav-h: 58px;
  --bot-h: 62px;
  --sidebar-w: 240px;
  --tr: 0.2s ease;
}

html.light {
  --bg:          #f0f2f8;
  --surface:     #ffffff;
  --card:        #f6f8fc;
  --border:      #dde1ee;
  --border-hov:  #b8c0d8;
  --accent:      #008a4a;
  --accent-dim:  rgba(0,138,74,0.09);
  --accent2:     #5b3fd4;
  --accent2-dim: rgba(91,63,212,0.09);
  --text:        #0e0e20;
  --text-sub:    #4a4a70;
  --muted:       #8888aa;
  --glow:        0 0 14px rgba(0,138,74,0.18);
  --glow-lg:     0 0 28px rgba(0,138,74,0.12);
  --nav-bg:      rgba(240,242,248,0.94);
  --sheet-bg:    rgba(248,249,252,0.99);
  --shadow-card: 0 8px 28px rgba(0,0,0,0.09);
}

/* Smooth theme switch for bg/color only */
body, .navbar, .sidebar, .bottom-nav, .filter-bar, .drawer, .cat-sheet {
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}
.wall-card { transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hov); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a   { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ═══════════════════════════════════════
   TOP NAVBAR
═══════════════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
}

/* Hamburger */
.nav-ham {
  flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; padding: 7px;
  border-radius: var(--r-sm);
}
.nav-ham span {
  display: block; height: 2px; background: var(--text); border-radius: 2px;
  transition: var(--tr);
}
.nav-ham.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-ham.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-ham.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Logo */
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 1rem;
  letter-spacing: -0.4px; white-space: nowrap; flex-shrink: 0;
}
.nav-logo .hi { color: var(--accent); }
@keyframes glowPulse {
  0%,100% { text-shadow: 0 0 6px rgba(0,255,136,0.3); }
  50%      { text-shadow: 0 0 18px rgba(0,255,136,0.9); }
}
.nav-logo .hi { animation: glowPulse 3.5s ease-in-out infinite; }

/* Search */
.nav-search { flex: 1; position: relative; min-width: 0; }
.nav-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  color: var(--text); font-size: 0.84rem;
  outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
  -webkit-appearance: none;
}
.nav-search input::placeholder { color: var(--muted); }
.nav-search input:focus { border-color: var(--accent); box-shadow: var(--glow); }
.nav-search .s-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; width: 15px; height: 15px;
}

/* Category button (desktop) */
.cat-wrap { position: relative; flex-shrink: 0; }
.cat-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-size: 0.81rem; font-weight: 500; white-space: nowrap;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.cat-btn:hover, .cat-btn.open { border-color: var(--accent); box-shadow: var(--glow); }
.cat-btn .arr { transition: transform var(--tr); }
.cat-btn.open .arr { transform: rotate(180deg); }

/* Desktop category dropdown */
.cat-drop {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 8px;
  min-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65), var(--glow);
  z-index: 2000;
}
.cat-drop.open { display: block; animation: fadeIn 0.18s ease; }
.cat-drop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.cat-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 0.81rem; color: var(--text-sub);
  transition: background var(--tr), color var(--tr);
}
.cat-link:hover { background: var(--card); color: var(--accent); }
.cat-link svg { flex-shrink: 0; opacity: 0.6; }
.cat-link:hover svg { opacity: 1; }

/* Theme toggle */
.theme-toggle {
  flex-shrink: 0; width: 44px; height: 26px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 13px; position: relative; cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s !important; overflow: hidden;
}
.theme-toggle:hover { border-color: var(--accent); box-shadow: var(--glow); }
.theme-toggle .t-sun, .theme-toggle .t-moon {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 11px; transition: opacity 0.3s !important; pointer-events: none;
}
.theme-toggle .t-sun  { right: 5px; opacity: 0; }
.theme-toggle .t-moon { left: 5px; opacity: 1; }
html.light .theme-toggle .t-sun  { opacity: 1; }
html.light .theme-toggle .t-moon { opacity: 0; }
.theme-toggle .t-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1) !important;
}
html.light .theme-toggle .t-thumb { transform: translateX(18px); }

/* ═══════════════════════════════════════
   MOBILE CATEGORIES BOTTOM SHEET
═══════════════════════════════════════ */
.cat-sheet-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px); z-index: 800;
}
.cat-sheet-overlay.open { display: block; }

.cat-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--sheet-bg);
  border-top: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  z-index: 850; padding-bottom: env(safe-area-inset-bottom, 0);
  transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  max-height: 80vh; display: flex; flex-direction: column;
}
.cat-sheet.open { transform: translateY(0); }
.cat-sheet-handle {
  width: 40px; height: 4px; background: var(--border-hov);
  border-radius: 2px; margin: 12px auto 4px;
  flex-shrink: 0;
}
.cat-sheet-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem; font-weight: 700;
  padding: 4px 16px 14px; flex-shrink: 0;
  color: var(--text-sub); letter-spacing: 0.8px; text-transform: uppercase; font-size: 0.68rem;
}
.cat-sheet-scroll { overflow-y: auto; flex: 1; padding: 0 12px 20px; }
.cat-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.cat-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 14px 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); text-align: center;
  transition: border-color var(--tr), background var(--tr), transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cat-tile:active { transform: scale(0.95); }
.cat-tile:hover { border-color: var(--accent); background: var(--accent-dim); }
.cat-tile .ct-icon { font-size: 1.5rem; line-height: 1; }
.cat-tile .ct-name { font-size: 0.68rem; color: var(--text-sub); font-weight: 500; }
.cat-tile .ct-count {
  font-size: 0.58rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1px 6px;
}

/* ═══════════════════════════════════════
   MOBILE SIDEBAR DRAWER
═══════════════════════════════════════ */
.drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 900;
  backdrop-filter: blur(4px);
}
.drawer-overlay.open { display: block; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px; background: var(--surface);
  border-right: 1px solid var(--border); z-index: 920;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; overflow-y: auto;
  padding-top: var(--nav-h);
}
.drawer.open { transform: translateX(0); }
.drawer-section { padding: 16px 16px 8px; }
.drawer-label {
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.drawer-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--text-sub); font-size: 0.85rem;
  transition: background var(--tr), color var(--tr);
}
.drawer-item:hover, .drawer-item.active { background: var(--accent-dim); color: var(--accent); }
.drawer-divider { height: 1px; background: var(--border); margin: 8px 16px; }

/* ═══════════════════════════════════════
   LAYOUT SHELL
═══════════════════════════════════════ */
.shell { display: flex; min-height: 100vh; padding-top: var(--nav-h); }

/* Desktop Sidebar */
.sidebar {
  display: none; width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto; border-right: 1px solid var(--border);
  padding: 16px 0 80px; background: var(--surface);
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sb-logo {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 0.95rem; padding: 4px 16px 16px; color: var(--text);
}
.sb-logo .hi { color: var(--accent); }
.sb-section-label {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--muted);
  padding: 12px 16px 4px;
}
.sb-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px; color: var(--text-sub); font-size: 0.82rem;
  border-left: 2px solid transparent;
  transition: all var(--tr);
}
.sb-link:hover { background: var(--accent-dim); color: var(--accent); border-left-color: var(--accent); }
.sb-link.active { background: var(--accent-dim); color: var(--accent); border-left-color: var(--accent); }
.sb-count {
  font-size: 0.62rem; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 1px 7px; color: var(--muted);
}
.sb-divider { height: 1px; background: var(--border); margin: 10px 16px; }

/* ═══════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Filter Bar ── */
.filter-bar {
  position: sticky; top: var(--nav-h); z-index: 50;
  background: rgba(7,7,15,0.94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
html.light .filter-bar { background: rgba(240,242,248,0.96); }

.pill-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; overflow-x: auto; scrollbar-width: none;
}
.pill-row::-webkit-scrollbar { display: none; }
.pill {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 15px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border); color: var(--text-sub);
  background: transparent; flex-shrink: 0;
  transition: all var(--tr);
  -webkit-tap-highlight-color: transparent;
}
.pill:hover { border-color: var(--muted); color: var(--text); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #000; box-shadow: var(--glow); }

/* Tag chips row */
.tag-row {
  display: flex; gap: 6px; padding: 4px 14px 10px;
  overflow-x: auto; scrollbar-width: none;
}
.tag-row::-webkit-scrollbar { display: none; }
.tag-chip {
  flex-shrink: 0; padding: 4px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); font-size: 0.7rem; color: var(--muted);
  background: transparent; white-space: nowrap;
  transition: all var(--tr);
}
.tag-chip:hover { border-color: var(--accent2); color: var(--accent2); background: var(--accent2-dim); }

/* Section header */
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 10px;
}
.sec-head-left { display: flex; align-items: center; gap: 10px; }
.sec-bar {
  width: 3px; height: 18px; background: var(--accent);
  border-radius: 2px; box-shadow: var(--glow);
}
.sec-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem; font-weight: 700;
}
.view-toggle { display: flex; gap: 4px; }
.vt-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); color: var(--muted);
  border: 1px solid transparent; transition: all var(--tr);
}
.vt-btn:hover, .vt-btn.active {
  border-color: var(--border); color: var(--text); background: var(--surface);
}
.vt-btn svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════
   WALLPAPER GRID — MASONRY
═══════════════════════════════════════ */
.wall-grid {
  padding: 0 10px 80px;
  columns: 1; column-gap: 10px;
}
.wall-grid.view-list { columns: 1 !important; }

.wall-card {
  break-inside: avoid; margin-bottom: 10px;
  border-radius: var(--r); overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  cursor: pointer; position: relative;
}
.wall-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 44px rgba(0,0,0,0.55), var(--glow);
  border-color: rgba(0,255,136,0.35);
}
.wall-card img {
  width: 100%; object-fit: cover;
  transition: transform 0.35s ease;
  aspect-ratio: 16/9;
}
.wall-card:hover img { transform: scale(1.04); }

/* Overlay */
.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(3,3,14,0.88) 0%, rgba(3,3,14,0.05) 55%, transparent 100%);
  opacity: 0; transition: opacity var(--tr);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px; gap: 8px;
}
.wall-card:hover .card-overlay { opacity: 1; }
@media (hover: none) {
  .card-overlay { opacity: 1; background: linear-gradient(to top, rgba(3,3,14,0.78) 0%, transparent 50%); }
}

.overlay-btns { display: flex; gap: 6px; }
.ov-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: var(--r-sm);
  font-size: 0.72rem; font-weight: 700;
  transition: filter var(--tr);
}
.ov-btn svg { width: 12px; height: 12px; }
.ov-btn.pri { background: var(--accent); color: #000; }
.ov-btn.sec { background: rgba(255,255,255,0.14); color: #fff; backdrop-filter: blur(6px); }
.ov-btn:hover { filter: brightness(1.15); }

.card-meta {
  padding: 8px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card-meta-name {
  font-size: 0.7rem; color: var(--text-sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.res-badge {
  flex-shrink: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 7px; font-size: 0.6rem; font-weight: 700; color: var(--accent);
}

/* List view */
.wall-grid.view-list .wall-card { display: flex; flex-direction: row; height: 78px; }
.wall-grid.view-list .wall-card img { width: 130px; height: 100%; object-fit: cover; flex-shrink: 0; aspect-ratio: unset; }
.wall-grid.view-list .card-overlay { display: none; }
.wall-grid.view-list .card-meta {
  flex: 1; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px;
}
.wall-grid.view-list .card-meta-name { white-space: normal; font-size: 0.78rem; color: var(--text); }

/* ── Infinity Scroll Sentinel + Loader ── */
#infiniteLoader {
  display: flex; align-items: center; justify-content: center;
  padding: 28px 0;
}
.loader-dots { display: flex; gap: 8px; align-items: center; }
.loader-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); opacity: 0.4;
  animation: dotBounce 1.2s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce {
  0%,80%,100% { transform: scale(0.7); opacity: 0.3; }
  40% { transform: scale(1.15); opacity: 1; }
}
#infiniteLoader.hidden { display: none; }
.all-loaded-msg {
  text-align: center; padding: 24px 0 40px;
  font-size: 0.75rem; color: var(--muted);
  display: none;
}
.all-loaded-msg.show { display: block; }

/* ═══════════════════════════════════════
   DETAIL MODAL
═══════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(10px); z-index: 3000;
  padding: 0; overflow-y: auto;
  align-items: flex-end;
}
.modal-overlay.open { display: flex; }
@media (min-width: 768px) { .modal-overlay { align-items: center; justify-content: center; padding: 20px; } }

.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%; max-width: 540px; overflow: hidden;
  box-shadow: 0 -10px 50px rgba(0,0,0,0.5), var(--glow-lg);
  animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
@media (min-width: 768px) {
  .modal { border-radius: var(--r-xl); animation: fadeIn 0.22s ease; }
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-handle {
  width: 38px; height: 4px; background: var(--border-hov);
  border-radius: 2px; margin: 10px auto 4px;
}
@media (min-width: 768px) { .modal-handle { display: none; } }

.modal-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.modal-body { padding: 18px; }
.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 700; margin-bottom: 6px;
}
.modal-desc { font-size: 0.77rem; color: var(--text-sub); line-height: 1.65; margin-bottom: 16px; }
.modal-dl-col { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.dl-btn-full {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--r);
  font-size: 0.82rem; font-weight: 700; width: 100%;
  transition: filter var(--tr), box-shadow var(--tr);
}
.dl-btn-full svg { width: 15px; height: 15px; }
.dl-btn-full.primary { background: var(--accent); color: #000; }
.dl-btn-full.primary:hover { box-shadow: var(--glow); filter: brightness(1.08); }
.dl-btn-full.ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.dl-btn-full.ghost:hover { border-color: var(--accent); color: var(--accent); }

.modal-devices {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-bottom: 14px;
}
.modal-dev-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--border); font-size: 0.73rem; color: var(--text-sub);
  transition: all var(--tr);
}
.modal-dev-btn:hover { border-color: var(--accent2); color: var(--accent2); background: var(--accent2-dim); }

.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-tag {
  padding: 3px 10px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 0.67rem; color: var(--muted);
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); border-radius: 50%; color: #fff;
  backdrop-filter: blur(6px); font-size: 1rem; z-index: 10;
}
.modal-close:hover { background: rgba(0,0,0,0.85); }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; font-size: 0.71rem; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.breadcrumb a { color: var(--accent); }

/* ═══════════════════════════════════════
   POPULAR TAGS CLOUD
═══════════════════════════════════════ */
.pop-tags { padding: 26px 14px; border-top: 1px solid var(--border); margin-bottom: 16px; }
.pop-tags-label {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 1.3px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; line-height: 1.8; }
.tc-tag { color: var(--muted); font-weight: 500; transition: color var(--tr); }
.tc-tag:hover { color: var(--accent); }
.tc-tag.xl { font-size: 1.4rem; font-weight: 700; }
.tc-tag.lg { font-size: 1.05rem; font-weight: 600; }
.tc-tag.md { font-size: 0.88rem; }
.tc-tag.sm { font-size: 0.73rem; }

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  padding: 20px 14px 100px;
  text-align: center; font-size: 0.7rem; color: var(--muted);
}
.footer-links { display: flex; justify-content: center; gap: 18px; margin-bottom: 8px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--accent); }
@media (min-width: 768px) { footer { padding-bottom: 28px; } }

/* ═══════════════════════════════════════
   MOBILE BOTTOM NAV
═══════════════════════════════════════ */
.bottom-nav {
  display: flex; position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 700;
  background: rgba(7,7,15,0.96);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  height: var(--bot-h);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
html.light .bottom-nav { background: rgba(240,242,248,0.96); }
.bn-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-size: 0.56rem; font-weight: 600; letter-spacing: 0.3px;
  color: var(--muted); transition: color var(--tr);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.bn-item svg { width: 21px; height: 21px; }
.bn-item.active { color: var(--accent); }
.bn-item.active::after {
  content: ''; position: absolute; top: 4px;
  width: 20px; height: 2px; background: var(--accent);
  border-radius: 0 0 2px 2px; box-shadow: var(--glow);
}
.bn-item:hover { color: var(--text); }

/* ─ Upload / New CTA button in bottom nav ─ */
.bn-upload {
  flex: 0 0 52px; display: flex; align-items: center; justify-content: center;
}
.bn-upload-btn {
  width: 42px; height: 42px;
  background: var(--accent); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow); transition: filter var(--tr), transform 0.15s;
}
.bn-upload-btn:hover { filter: brightness(1.12); }
.bn-upload-btn:active { transform: scale(0.92); }
.bn-upload-btn svg { width: 20px; height: 20px; color: #000; }

/* No results */
.no-results { padding: 48px 16px; color: var(--muted); text-align: center; }

/* ═══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════════════ */

/* 480px — 2 cols */
@media (min-width: 480px) {
  .wall-grid { columns: 2; }
  .cat-sheet-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 640px */
@media (min-width: 640px) {
  .wall-grid { columns: 2; }
  .cat-sheet-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 768px — Tablet: hide bottom nav */
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .wall-grid { columns: 2; padding-bottom: 40px; }
  .wall-grid.view-3 { columns: 3; }
  footer { padding-bottom: 32px; }
  .wall-grid { padding: 0 14px 40px; }
}

/* 1024px — Desktop: show sidebar */
@media (min-width: 1024px) {
  .nav-ham { display: none; }
  .sidebar { display: block; }
  .wall-grid { columns: 3; padding: 0 16px 40px; }
  .wall-grid.view-2 { columns: 2; }
  .wall-grid.view-4 { columns: 4; }
  .cat-drop { min-width: 480px; }
}

/* 1280px */
@media (min-width: 1280px) {
  .wall-grid { columns: 4; }
  .wall-grid.view-2 { columns: 2; }
  .wall-grid.view-3 { columns: 3; }
  :root { --sidebar-w: 256px; }
}

/* 1600px */
@media (min-width: 1600px) {
  .wall-grid { columns: 5; }
}

/* 2560px — 4K screens */
@media (min-width: 2560px) {
  .wall-grid { columns: 6; }
  :root { --sidebar-w: 280px; --nav-h: 68px; }
  .navbar { font-size: 1.05rem; }
}

/* iPhone SE / very small */
@media (max-width: 360px) {
  .nav-logo { font-size: 0.88rem; }
  .cat-sheet-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─ Safe area for iPhone notch / Dynamic Island ─ */
.navbar { padding-top: env(safe-area-inset-top, 0); }
@supports (padding-top: env(safe-area-inset-top)) {
  .navbar {
    height: calc(var(--nav-h) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }
  .shell { padding-top: calc(var(--nav-h) + env(safe-area-inset-top)); }
  .filter-bar { top: calc(var(--nav-h) + env(safe-area-inset-top)); }
  .sidebar { top: calc(var(--nav-h) + env(safe-area-inset-top)); height: calc(100vh - var(--nav-h) - env(safe-area-inset-top)); }
}

/* ─ iPad specific ─ */
@media (min-width: 768px) and (max-width: 1023px) {
  .wall-grid { columns: 3; padding: 0 16px 40px; }
  .wall-grid.view-2 { columns: 2; }
  .wall-grid.view-4 { columns: 4; }
  .nav-ham { display: flex; }
  .sidebar { display: none; }
  .bottom-nav { display: none; }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
