/* ============================================================
   Pix · Gifaya — Dark Theme
   ============================================================ */

:root {
  --bg:          #0a0e1a;
  --bg-elev:     #141b2d;
  --bg-elev-2:   #1a2235;
  --border:      #2a3448;
  --text:        #e8eef8;
  --text-muted:  #8b95a9;
  --accent:      #00d4ff;
  --accent-2:    #a855f7;
  --accent-grad: linear-gradient(135deg, #00d4ff, #a855f7);
  --success:     #10b981;
  --danger:      #ef4444;
  --warning:     #f59e0b;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 16px 40px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
*::selection { background: var(--accent); color: #0a0e1a; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

main { flex: 1; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--text); }
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--accent-grad);
  border-radius: 10px;
  color: #0a0e1a;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}
.main-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s;
  padding: 6px 0;
  position: relative;
}
.main-nav a:hover {
  color: var(--text);
}
.main-nav a:hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-grad);
  border-radius: 2px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 72px 0 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.15), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero > .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 40px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
}
.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  display: block;
}
.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 212, 255, 0.15);
}
.stat-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
  line-height: 1;
}
.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section-block {
  padding: 48px 0;
}
.section-head {
  margin-bottom: 28px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section-head h1, .section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.section-desc {
  color: var(--text-muted);
  margin: 6px 0 0;
  font-size: 1rem;
}

/* ============================================================
   IMAGE GRID
   ============================================================ */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.image-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.image-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 212, 255, 0.18);
}
.image-card-thumb {
  aspect-ratio: 1 / 1;
  background: #05080f;
  overflow: hidden;
  position: relative;
}
.image-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.image-card:hover .image-card-thumb img {
  transform: scale(1.05);
}
.image-card-body {
  padding: 12px 14px 14px;
}
.image-card-body h3 {
  margin: 8px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
  color: var(--text);
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}
.page-num:hover {
  background: var(--bg-elev-2);
  border-color: var(--accent);
  color: var(--accent);
}
.page-num.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #0a0e1a;
}
.page-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  color: var(--text-muted);
}

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  align-items: center;
}
.filters-bar .filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 6px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-chip.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #0a0e1a;
  font-weight: 700;
}

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.article-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs .current { color: var(--text); }

.article-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  margin: 0 0 28px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.article-featured {
  background: #05080f;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}
.article-featured img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  display: block;
}

/* Action bar — Use tool + Share */
.action-bar {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-grad);
  color: #0a0e1a;
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.5);
  color: #0a0e1a;
}
.btn-secondary {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-elev-2);
  border-color: var(--accent);
  color: var(--accent);
}

/* Share row */
.share-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
  text-transform: uppercase;
}
.share-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}
.share-btn[data-platform="fb"]:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.share-btn[data-platform="wa"]:hover { background: #25d366; color: #fff; border-color: #25d366; }
.share-btn[data-platform="tw"]:hover { background: #1da1f2; color: #fff; border-color: #1da1f2; }
.share-btn[data-platform="tg"]:hover { background: #0088cc; color: #fff; border-color: #0088cc; }
.share-btn[data-platform="pin"]:hover { background: #e60023; color: #fff; border-color: #e60023; }
.share-btn[data-platform="cp"]:hover { background: var(--accent); color: #0a0e1a; border-color: var(--accent); }

/* Tool mount area */
#tool-mount {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
#tool-mount:empty,
#tool-mount.tool-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 24px;
}

/* Description */
.description-block {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}
.description-block h2 {
  font-size: 1.15rem;
  margin: 0 0 12px;
  color: var(--text);
}
.description-block p {
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.7;
}
.description-block details {
  margin-top: 12px;
}
.description-block summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  padding: 8px 0;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.description-block summary::-webkit-details-marker { display: none; }
.description-block summary::before {
  content: '▸';
  transition: transform 0.2s;
  display: inline-block;
}
.description-block details[open] summary::before {
  transform: rotate(90deg);
}
.description-block .full-content {
  margin-top: 16px;
  color: var(--text-muted);
  line-height: 1.8;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.description-block .full-content h2,
.description-block .full-content h3 {
  color: var(--text);
  margin: 20px 0 10px;
  font-size: 1.05rem;
}
.description-block .full-content ul,
.description-block .full-content ol {
  padding-left: 24px;
}
.description-block .full-content li {
  margin: 6px 0;
}
.description-block .full-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 212, 255, 0.3);
  text-underline-offset: 3px;
}
.description-block .full-content a:hover {
  text-decoration-color: var(--accent);
}
.description-block .full-content p {
  margin: 12px 0;
}

/* Related */
.related-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.related-section h2 {
  font-size: 1.3rem;
  margin: 0 0 20px;
  font-weight: 700;
}
.related-section .image-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Prev/Next */
.prev-next-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.prev-next-nav .btn {
  flex: 1;
  min-width: 200px;
  justify-content: flex-start;
  font-size: 0.9rem;
}
.prev-next-nav .btn.next {
  justify-content: flex-end;
  text-align: right;
}

/* ============================================================
   AD CONTAINERS
   ============================================================ */
.ad-container {
  margin: 24px auto;
  text-align: center;
  overflow: hidden;
  max-width: 100%;
}
.ad-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  opacity: 0.6;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #05080f;
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-col h4 {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.footer-col a {
  display: block;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--accent); }
.footer-tagline {
  color: var(--text-muted);
  margin: 12px 0 0;
  font-size: 0.9rem;
  max-width: 320px;
}
.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-copy p { margin: 0; }

/* ============================================================
   EMPTY STATE / 404
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state h2 {
  color: var(--text);
  font-size: 1.5rem;
  margin: 0 0 12px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .header-inner { height: 56px; gap: 12px; }
  .main-nav { gap: 16px; font-size: 0.85rem; }
  .main-nav a { padding: 4px 0; }
  .logo-text { font-size: 20px; }

  .hero { padding: 48px 0 32px; }
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 400px;
  }
  .stat-card { padding: 18px 16px; }
  .stat-icon { font-size: 1.6rem; }
  .stat-number { font-size: 1.5rem; }

  .image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .image-card-body { padding: 10px 10px 12px; }
  .image-card-body h3 { font-size: 0.8rem; min-height: 2.4em; }
  .badge { font-size: 0.6rem; padding: 2px 8px; }

  .article-wrap { padding: 20px 16px 48px; }
  .article-title { font-size: 1.3rem; margin-bottom: 20px; }
  .btn { padding: 10px 20px; font-size: 14px; }
  .share-btn { width: 38px; height: 38px; font-size: 0.65rem; }

  #tool-mount { padding: 16px; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  .footer-tagline { margin-left: auto; margin-right: auto; }
  .footer-col a { display: inline-block; margin: 0 8px 8px; }

  .prev-next-nav .btn { min-width: 100%; }
}

@media (max-width: 480px) {
  .main-nav a:not(:first-child):not(:nth-child(2)) { display: none; }
  .image-grid { gap: 8px; }
  .image-card-body { padding: 8px 8px 10px; }
  .image-card-body h3 { font-size: 0.75rem; }
}