/* ============================================================
   emojis.sock.social — Hub Website Styles
   Philosophy: minimal, fast, no external dependencies
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0f0f11;
  --surface:     #1a1a1f;
  --surface-2:   #242429;
  --border:      #2e2e36;
  --text:        #e8e8ee;
  --text-muted:  #888896;
  --accent:      #7c6af5;
  --accent-dim:  #3d3474;
  --success:     #4caf7d;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 4px 24px rgba(0,0,0,.45);
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.logo span { color: var(--accent); }

.header-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}

.main-layout {
  display: flex;
  flex: 1;
}

.sidebar {
  width: 200px;
  flex-shrink: 0;
  padding: 1.25rem 1rem;
  border-right: 1px solid var(--border);
}

.sidebar h3 {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.category-list { list-style: none; }

.category-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .45rem .6rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .9rem;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.category-list li a:hover,
.category-list li a.active {
  background: var(--surface-2);
  color: var(--text);
}
.category-list li a.active { color: var(--accent); }

.cat-count {
  font-size: .72rem;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: .1rem .4rem;
  border-radius: 99px;
}
.category-list li a.active .cat-count {
  background: var(--accent-dim);
  color: var(--accent);
}

.content {
  flex: 1;
  padding: 1.25rem 1.5rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Search bar ──────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: .6rem .9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }

/* ── Results meta ────────────────────────────────────── */
.results-meta {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ── Emoji grid ──────────────────────────────────────── */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: .75rem;
  flex: 1;
  align-content: start;
}

.emoji-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem .5rem .6rem;
  height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}
.emoji-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateY(-2px);
  text-decoration: none;
}

.emoji-card img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  object-fit: contain;
  image-rendering: auto;
}

.emoji-shortcode {
  font-size: .68rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.empty-state p { margin-top: .5rem; font-size: .9rem; }

/* ── Pagination ──────────────────────────────────────── */
.pagination {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  padding: .75rem 0;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.pagination a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pagination .disabled { opacity: .35; pointer-events: none; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity .15s, background .15s;
  text-decoration: none;
}
.btn:hover { opacity: .85; text-decoration: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 480px;
  width: 100%;
  padding: 1.75rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: .25rem;
}
.modal-close:hover { color: var(--text); }

/* Emoji detail modal */
#detail-modal .modal-emoji-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}
#detail-modal .modal-emoji-preview img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

#detail-modal h2 {
  font-size: 1.1rem;
  margin-bottom: .25rem;
}

.detail-shortcode {
  font-family: monospace;
  font-size: .9rem;
  color: var(--accent);
  margin-bottom: .75rem;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1.25rem;
  font-size: .85rem;
  color: var(--text-muted);
}

.detail-attribution {
  font-size: .8rem;
  color: var(--text-muted);
  margin: -.75rem 0 1rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: 1.25rem;
}

.tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .72rem;
  padding: .15rem .5rem;
  border-radius: 99px;
}

.modal-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

/* Add to SOCK modal */
#sock-modal pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .8rem;
  color: var(--accent);
  margin: .75rem 0;
  overflow-x: auto;
}

#sock-modal h2 { margin-bottom: .75rem; }
#sock-modal p  { font-size: .9rem; color: var(--text-muted); margin-bottom: .5rem; }

/* ── Toast ───────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(4rem);
  background: var(--success);
  color: #fff;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: transform .25s ease;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── Detail modal — SOCK hint ────────────────────────── */
.detail-sock-hint {
  margin-top: 1rem;
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Use-these-emojis modal ─────────────────────────── */
.use-option {
  margin-bottom: 1.25rem;
}
.use-option h3 {
  font-size: .95rem;
  margin-bottom: .35rem;
}
.use-option p {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .35rem;
}
.use-option ol {
  font-size: .85rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  margin-top: .25rem;
}
.use-option ol li { margin-bottom: .2rem; }
.use-option pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .9rem;
  font-size: .8rem;
  color: var(--accent);
  margin: .5rem 0;
  overflow-x: auto;
}
.use-option-featured {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}
.use-option-featured pre {
  background: var(--surface);
}

/* ── Footer ─────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}
.site-footer p {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.site-footer .footer-sub {
  margin-top: .35rem;
  font-size: .72rem;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  .sidebar { display: none; }
  .emoji-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}
