/* ============================================================
   INDEX PAGE (Browse Images)
   ============================================================ */

/* Hero header */
.idx-hero {
  position: relative;
  margin-bottom: 28px;
  padding: 26px 28px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(233,69,96,0.12), rgba(192,38,211,0.07) 60%, transparent);
  border: 1px solid rgba(233,69,96,0.20);
  overflow: hidden;
}
.idx-hero::before {
  content: "";
  position: absolute;
  top: -50px; left: -50px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(233,69,96,0.38), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
.idx-hero-inner {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.idx-hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.015em;
  background: linear-gradient(135deg, #ff7a8a, #e94560 50%, #c026d3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(233,69,96,0.32));
  line-height: 1.15;
}
.idx-hero h1::after {
  content: "";
  display: block;
  width: 48px; height: 3px;
  margin-top: 8px;
  border-radius: 3px;
  background: linear-gradient(90deg, #e94560, #c026d3);
  box-shadow: 0 0 12px rgba(233,69,96,0.55);
}
.idx-result-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: #666;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Search */
.idx-search {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  max-width: 720px;
}
.idx-search input[type=text] {
  flex: 1;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid #0f3460;
  background: #16213e;
  color: #cdd6f4;
  font-size: 0.9rem;
  transition: border-color .15s ease;
}
.idx-search input[type=text]::placeholder { color: #555; }
.idx-search input[type=text]:focus {
  outline: none;
  border-color: #e94560;
  box-shadow: 0 0 0 3px rgba(233,69,96,0.12);
}

/* Layout */
.idx-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* Sidebar */
.idx-sidebar {
  width: 210px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
  align-self: flex-start;
}

/* Tags card */
.idx-tags-card {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 10px;
  padding: 18px;
}
.idx-card-heading {
  font-size: 0.7rem;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 0 0 14px;
}
.idx-tag-empty { font-size: 0.82rem; color: #666; }
.idx-tag-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.idx-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 2px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: relative;
}
.idx-tag-row:last-child { border-bottom: none; }
.idx-tag-bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 1px;
  background: #e94560;
  opacity: .45;
}
.idx-tag-link {
  color: #888;
  font-size: 0.83rem;
  text-decoration: none;
  transition: color .15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.idx-tag-row:hover .idx-tag-link { color: #cdd6f4; }
.idx-tag-row.is-active .idx-tag-link { color: #e94560; font-weight: 600; }
.idx-tag-count {
  font-size: 0.7rem;
  color: #555;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Ad card */
.idx-ad-card {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 20px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
  isolation: isolate;
  overflow: visible;
  z-index: 0;
}
.idx-ad-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #444;
  text-transform: uppercase;
  letter-spacing: .12em;
  align-self: flex-start;
}
.idx-ad-slot {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  margin: 0 auto;
}

.idx-ad-slot iframe,
.idx-ad-slot img,
.idx-ad-slot ins {
  max-width: 100%;
  height: auto;
  border: 0;
}

/* Ad card when placed below pagination instead of in the sidebar */
.idx-ad-card--below-pagination {
  width: 100%;
  max-width: 728px;
  margin: 24px auto 0;
  align-items: center;
}

/* IMPORTANT: remove forced scaling */
.idx-ad-slot * {
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Empty state */
.idx-empty {
  text-align: center;
  padding: 56px 24px;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 10px;
  color: #666;
  font-size: 0.9rem;
}

/* Grid */
.idx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.idx-card {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.idx-card:hover {
  transform: translateY(-3px);
  border-color: #e94560;
  box-shadow: 0 8px 28px rgba(233,69,96,0.18);
}
.idx-card.idx-hidden { display: none; }

/* Status badge */
.idx-status-badge {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.idx-status-badge.badge-pending  { background: #f59e0b; color: #000; }
.idx-status-badge.badge-rejected { background: #e94560; color: #fff; }

/* Video badge */
.idx-video-badge {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(15,15,30,.82);
  border: 1px solid rgba(255,255,255,.12);
  color: #cdd6f4;
  letter-spacing: .04em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Thumb frame */
.idx-thumb {
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d1a;
  overflow: hidden;
  position: relative;
}
.idx-thumb img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  transition: transform .22s ease;
}
.idx-card:hover .idx-thumb img { transform: scale(1.04); }
.idx-thumb::after {
  content: '';
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(233,69,96,0);
  transition: box-shadow .18s ease;
  pointer-events: none;
}
.idx-card:hover .idx-thumb::after {
  box-shadow: inset 0 0 0 1px rgba(233,69,96,.35);
}

/* Video placeholder */
.idx-video-placeholder {
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(135deg, #111124 0 12px, #0d0d1a 12px 24px);
  position: relative;
}
.idx-video-placeholder::after {
  content: '';
  position: absolute; inset: 0;
  box-shadow: inset 0 0 40px rgba(0,0,0,.55);
  pointer-events: none;
}

/* Play glyph */
.idx-play {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1.5px solid rgba(233,69,96,.5);
  background: rgba(15,15,30,.6);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
  position: relative; z-index: 1;
}
.idx-play::before {
  content: '';
  width: 0; height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 15px solid #888;
  margin-left: 4px;
  transition: border-left-color .18s ease;
}
.idx-card:hover .idx-play {
  border-color: #e94560;
  background: rgba(233,69,96,.15);
  transform: scale(1.08);
}
.idx-card:hover .idx-play::before { border-left-color: #e94560; }

/* Video with real thumb */
.idx-video-thumb { position: relative; }
.idx-video-thumb .idx-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
}
.idx-video-thumb .idx-play::before {
  border-top-width: 7px; border-bottom-width: 7px; border-left-width: 12px;
}
.idx-card:hover .idx-video-thumb .idx-play {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Card info */
.idx-card-info { padding: 12px 14px 14px; }
.idx-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #cdd6f4;
  margin: 0 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.idx-card-title a { color: inherit; text-decoration: none; }
.idx-card-title a:hover { color: #e94560; opacity: 1; }
.idx-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.idx-card-stats {
  display: flex;
  gap: 10px;
  font-size: 0.74rem;
  color: #555;
}
.idx-card-stats span { display: inline-flex; align-items: center; gap: 3px; }
.idx-card-author {
  font-size: 0.76rem;
  color: #666;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s ease;
}
.idx-card-author:hover { color: #e94560; opacity: 1; }

/* Responsive */
@media (max-width: 960px) {
  .idx-layout { flex-direction: column; }
  .idx-sidebar { width: 100%; position: static; }
  .idx-tags-card { position: static; }
  .idx-ad-card { flex-direction: row; align-items: center; }
  .idx-ad-slot { min-height: auto; }
}
@media (max-width: 640px) {
  .idx-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .idx-thumb, .idx-video-placeholder { height: 160px; }
  .idx-search { flex-wrap: wrap; }
  .idx-hero h1 { font-size: 1.4rem; }
}
@media (max-width: 400px) {
  .idx-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .idx-thumb, .idx-video-placeholder { height: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  .idx-card, .idx-thumb img, .idx-play { transition: none; }
}


/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #1a1a2e;
  color: #cdd6f4;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === Layout === */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ============================================================
   NAVBAR + DROPDOWN
   ============================================================ */
.navbar {
  background: linear-gradient(180deg, rgba(22,22,46,0.92) 0%, rgba(15,15,32,0.92) 100%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(233,69,96,0.25);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 30px rgba(0,0,0,0.35);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e94560, #ff7a8a, #e94560, transparent);
  opacity: 0.7;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
}

.nav-brand {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #ff7a8a, #e94560 45%, #c026d3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
  filter: drop-shadow(0 0 12px rgba(233,69,96,0.45));
  transition: filter .2s ease;
}
.nav-brand:hover {
  filter: drop-shadow(0 0 18px rgba(233,69,96,0.7));
  opacity: 1;
}

.nav-toggle {
  display: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  margin-left: auto;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.nav-toggle:hover {
  border-color: rgba(233,69,96,0.5);
  box-shadow: 0 0 14px rgba(233,69,96,0.25);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links > li > a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #ccc;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .15s ease;
  position: relative;
}
.nav-links > li > a:hover {
  color: #fff;
  background: linear-gradient(135deg, rgba(233,69,96,0.22), rgba(192,38,211,0.18));
  box-shadow: 0 0 0 1px rgba(233,69,96,0.3) inset, 0 4px 16px rgba(233,69,96,0.2);
  transform: translateY(-1px);
}
.nav-links > li > a.active {
  color: #fff;
  background: linear-gradient(135deg, #e94560, #c026d3);
  box-shadow: 0 4px 18px rgba(233,69,96,0.45);
}

.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(233,69,96,0.6), 0 0 12px rgba(233,69,96,0.35);
}

/* Profile dropdown - click to toggle (matches the navbar.php JS) */
.dropdown {
  position: relative;
}
.dropdown-toggle {
  cursor: pointer;
}
.dropdown-toggle::after {
  content: "▾";
  font-size: .7rem;
  color: #777;
  margin-left: 2px;
  transition: transform .15s ease;
}
.dropdown.active .dropdown-toggle::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: linear-gradient(165deg, #1b2347, #141a35);
  border: 1px solid rgba(233,69,96,0.25);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04) inset, 0 0 24px rgba(233,69,96,0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #ccc;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.dropdown-menu li a:hover {
  background: linear-gradient(135deg, rgba(233,69,96,0.18), rgba(192,38,211,0.14));
  color: #fff;
}
.dropdown-menu li + li {
  margin-top: 2px;
}

@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .nav-container { position: relative; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
    flex-direction: column;
    align-items: stretch;
    background: #14142a;
    border-bottom: 2px solid rgba(233,69,96,0.25);
    padding: 8px;
    gap: 2px;
  }
  .nav-links.open {
    display: flex;
    animation: navSlideDown 0.18s ease;
  }
  @keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .nav-links > li { width: 100%; }
  .nav-links > li > a {
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    padding: 12px 16px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .nav-links > li > a:hover,
  .nav-links > li > a:focus {
    background: rgba(233,69,96,0.12);
    transform: none;
    box-shadow: none;
  }

  /* Profile dropdown: flat inline list inside the open nav panel */
  .dropdown-menu {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    display: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid rgba(233,69,96,0.3);
    background: rgba(233,69,96,0.05);
    border-radius: 0 0 8px 8px;
    margin: 0 0 4px 12px;
    padding: 4px;
    max-height: none;
    overflow: visible;
  }
  .dropdown.active .dropdown-menu { display: block; }
  .dropdown-menu li a {
    padding: 10px 14px;
    min-height: 44px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
  }
  .dropdown-toggle {
    padding: 12px 16px;
    min-height: 48px;
  }
  .dropdown-toggle::after { display: none; }
}

/* === Badge === */
.badge {
  background: #e94560;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* ============================================================
   FOOTER (updated)
   ============================================================ */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(17, 17, 34, 0.6);
  padding: 28px 24px;
  text-align: center;
  color: #888;
  font-size: 0.875rem;
}
.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.footer-links a {
  color: #999;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.footer-links a:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.footer-links a + a {
  position: relative;
}
.site-footer p {
  color: #666;
  font-size: .78rem;
  margin: 0;
}

/* === Cards & Image Grid === */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.image-card {
  background: #16213e;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #0f3460;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}
.image-card:hover { transform: translateY(-3px); border-color: #e94560; }
.image-card a { display: block; }
.image-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.image-card .card-info { padding: 10px 12px; }
.image-card .card-title { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.image-card .card-meta { font-size: 0.75rem; color: #888; margin-top: 4px; display: flex; gap: 10px; }
.image-card .card-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 700;
}
.badge-pending  { background: #f59e0b; color: #000; }
.badge-review   { background: #3b82f6; color: #fff; }
.badge-rejected { background: #e94560; color: #fff; }
.badge-approved { background: #10b981; color: #fff; }

/* === Buttons === */
.btn { display: inline-block; padding: 10px 20px; border-radius: 6px; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: opacity 0.2s, transform 0.1s; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary   { background: #e94560; color: #fff; }
.btn-secondary { background: #16213e; color: #cdd6f4; border: 1px solid #0f3460; }
.btn-success   { background: #10b981; color: #fff; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-warning   { background: #f59e0b; color: #000; }
.btn-sm        { padding: 6px 14px; font-size: 0.8rem; }
.btn-xs        { padding: 4px 10px; font-size: 0.75rem; }

/* === Forms === */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.875rem; margin-bottom: 6px; color: #adb5bd; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 6px;
  color: #cdd6f4;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: #e94560; }
.form-group textarea { resize: vertical; min-height: 100px; }

/* === Alerts === */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: #064e3b; border: 1px solid #10b981; color: #6ee7b7; }
.alert-error   { background: #450a0a; border: 1px solid #e94560; color: #fca5a5; }
.alert-info    { background: #1e3a5f; border: 1px solid #3b82f6; color: #93c5fd; }
.alert-warning { background: #451a03; border: 1px solid #f59e0b; color: #fcd34d; }

/* ============================================================
   PAGE HEADER (updated)
   ============================================================ */
.page-header {
  position: relative;
  margin-bottom: 28px;
  padding: 22px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(233,69,96,0.10), rgba(192,38,211,0.06) 60%, transparent);
  border: 1px solid rgba(233,69,96,0.18);
  overflow: hidden;
}
.page-header::before {
  content: "";
  position: absolute;
  top: -60px;
  left: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(233,69,96,0.35), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
.page-header h1 {
  position: relative;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.01em;
  background: linear-gradient(135deg, #ff7a8a, #e94560 50%, #c026d3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(233,69,96,0.35));
  display: inline-block;
}
.page-header h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e94560, #c026d3);
  box-shadow: 0 0 14px rgba(233,69,96,0.6);
}
.page-header p  {
  position: relative;
  color: #a8b0c8;
  margin-top: 8px;
  font-size: 0.92rem;
}

/* === Card Container === */
.card {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 { font-size: 1.1rem; margin-bottom: 16px; color: #e94560; padding-bottom: 8px; border-bottom: 1px solid #0f3460; }

/* === Pagination === */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px; justify-content: center; }
.page-btn {
  padding: 8px 14px; background: #16213e; border: 1px solid #0f3460;
  color: #cdd6f4; text-decoration: none; border-radius: 4px; font-size: 0.85rem;
}
.page-btn.active { background: #e94560; border-color: #e94560; color: #fff; }
.page-btn:hover:not(.active) { border-color: #e94560; }

/* === Table === */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #0f3460; padding: 12px; text-align: left; font-size: 0.85rem; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid #0f3460; font-size: 0.875rem; vertical-align: middle; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* === Profile === */
.profile-header { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 32px; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid #e94560; flex-shrink: 0; }
.profile-avatar-placeholder { width: 100px; height: 100px; border-radius: 50%; background: #0f3460; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; border: 3px solid #e94560; flex-shrink: 0; }
.profile-stats { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; }
.stat-item { text-align: center; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: #e94560; }
.stat-label { font-size: 0.75rem; color: #888; }

/* === Tickets === */
.ticket-status { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 700; }
.status-open     { background: #064e3b; color: #6ee7b7; }
.status-pending  { background: #451a03; color: #fcd34d; }
.status-closed   { background: #1f2937; color: #9ca3af; }
.ticket-reply { background: #0f3460; border-radius: 6px; padding: 14px; margin-bottom: 12px; }
.ticket-reply.staff-reply { border-left: 3px solid #e94560; }
.ticket-reply.user-reply  { border-left: 3px solid #3b82f6; }

/* === Messages === */
.message-bubble { padding: 12px 16px; border-radius: 8px; margin-bottom: 12px; max-width: 75%; }
.message-bubble.sent     { background: #0f3460; margin-left: auto; }
.message-bubble.received { background: #16213e; border: 1px solid #0f3460; }
.conversation-list { list-style: none; }
.conversation-item { display: flex; gap: 12px; padding: 14px; border-bottom: 1px solid #0f3460; text-decoration: none; color: inherit; transition: background 0.2s; }
.conversation-item:hover { background: #0f3460; }
.conversation-item.unread .conv-name { font-weight: 700; }
.conv-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.conv-avatar-placeholder { width: 40px; height: 40px; border-radius: 50%; background: #0f3460; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.conv-info { flex: 1; }
.messages-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
@media (max-width: 768px) { .messages-layout { grid-template-columns: 1fr; } }
.card-tight { padding: 12px; }
.card-flush { padding: 0; }
.msg-scroll { max-height: 400px; overflow-y: auto; margin-bottom: 16px; }
.empty-state { padding: 40px; text-align: center; }
.inline-form { display: inline; }

/* === Notifications === */
.notif-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #0f3460; transition: background 0.2s; }
.notif-item.unread { background: rgba(233,69,96,0.08); }
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #e94560; flex-shrink: 0; margin-top: 6px; }
.notif-dot.read { background: transparent; border: 1px solid #444; }
.notif-text { font-size: 0.875rem; }
.notif-time { font-size: 0.75rem; color: #888; margin-top: 2px; }

/* === Modals === */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 5000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: #16213e; border: 1px solid #e94560; border-radius: 8px; padding: 28px; max-width: 480px; width: 90%; }
.modal h3 { color: #e94560; margin-bottom: 16px; }

/* === Image View === */
.image-view-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
@media (max-width: 900px) { .image-view-wrap { grid-template-columns: 1fr; } }
.image-view-wrap .main-image img { max-width: 100%; border-radius: 8px; }
.image-sidebar { }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { background: #0f3460; padding: 4px 10px; border-radius: 12px; font-size: 0.78rem; color: #cdd6f4; text-decoration: none; }
.tag:hover { background: #e94560; }

/* === Admin === */
.admin-grid { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); gap: 0; }
.admin-sidebar { background: #0f3460; padding: 20px 0; border-right: 1px solid #e94560; }
.admin-sidebar h3 { color: #e94560; padding: 0 20px 12px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
.admin-sidebar a { display: block; padding: 10px 20px; color: #cdd6f4; text-decoration: none; font-size: 0.875rem; border-left: 3px solid transparent; transition: all 0.2s; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: #16213e; border-left-color: #e94560; color: #e94560; }
.admin-main { padding: 28px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #16213e; border: 1px solid #0f3460; border-radius: 8px; padding: 18px; text-align: center; }
.stat-card .stat-num { font-size: 2rem; font-weight: 700; color: #e94560; }
.stat-card .stat-label { font-size: 0.78rem; color: #888; margin-top: 4px; }

/* === Search bar === */
.search-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.search-bar input { flex: 1; min-width: 200px; padding: 10px 14px; background: #16213e; border: 1px solid #0f3460; border-radius: 6px; color: #cdd6f4; font-size: 0.9rem; }
.search-bar input:focus { outline: none; border-color: #e94560; }

/* === Upload Drop Zone === */
.drop-zone {
  border: 2px dashed #0f3460; border-radius: 8px; padding: 48px;
  text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s;
  background: #16213e;
}
.drop-zone.dragover { border-color: #e94560; background: rgba(233,69,96,0.05); }
.drop-zone p { color: #888; margin-top: 8px; font-size: 0.875rem; }

/* === Responsive === */
@media (max-width: 768px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: none; border-bottom: 1px solid #e94560; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   TABLET (≤1024px)
   Tighten desktop spacing, shrink the admin sidebar, and let
   wide layouts (image view, profile) breathe a little less.
   ============================================================ */
@media (max-width: 1024px) {
  .main-content { padding: 20px 16px; }

  .image-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

  .admin-sidebar { width: 100%; }
  .admin-grid { grid-template-columns: 180px 1fr; }
  .admin-main { padding: 20px; }

  .image-view-wrap { grid-template-columns: 1fr 280px; gap: 16px; }

  .card { padding: 18px; }

  .profile-header { gap: 16px; }
  .profile-stats { gap: 16px; }
}

/* ============================================================
   PHONES & SMALL TABLETS (≤640px)
   Stack anything still side-by-side, give touch targets more
   room, and let wide content (tables, modals) scroll instead
   of overflow.
   ============================================================ */
@media (max-width: 640px) {
  .main-content { padding: 16px 12px; }

  /* Navbar */
  .nav-container { padding: 12px 16px; }
  .nav-brand { font-size: 1.15rem; }

  /* Page header */
  .page-header { padding: 16px 16px; border-radius: 12px; }
  .page-header h1 { font-size: 1.3rem; }

  /* Cards */
  .card { padding: 16px; }
  .card h2 { font-size: 1rem; }

  /* Buttons get a slightly larger tap target on touch screens */
  .btn { padding: 11px 18px; }
  .btn-sm { padding: 8px 14px; }

  /* Image grid */
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .image-card img { height: 140px; }
  .image-card .card-title { font-size: 0.8rem; }

  /* Profile */
  .profile-header { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .profile-stats { justify-content: center; gap: 18px; }

  /* Tables: scroll horizontally instead of squashing/overflowing */
  .table-responsive { overflow-x: auto; }
  .data-table { min-width: 480px; }
  .data-table th, .data-table td { padding: 8px 10px; font-size: 0.8rem; }

  /* Search bar stacks so the input isn't squeezed next to a button */
  .search-bar { flex-direction: column; }
  .search-bar input { min-width: 0; width: 100%; }
  .search-bar .btn { width: 100%; text-align: center; }

  /* Pagination: smaller buttons so more fit per row */
  .pagination { gap: 4px; }
  .page-btn { padding: 7px 11px; font-size: 0.8rem; }

  /* Modals: less padding, fits small screens without edge-to-edge crowding */
  .modal { padding: 18px; width: 94%; max-width: none; }
  .modal h3 { font-size: 1.05rem; }

  /* Messages */
  .message-bubble { max-width: 88%; }
  .conv-avatar, .conv-avatar-placeholder { width: 36px; height: 36px; }

  /* Admin */
  .admin-main { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-num { font-size: 1.6rem; }

  /* Image view */
  .image-view-wrap { gap: 14px; }

  /* Drop zone needs less padding so it doesn't dominate the screen */
  .drop-zone { padding: 28px 16px; }
}

/* ============================================================
   VERY SMALL PHONES (≤400px)
   Final pass for narrow devices (e.g. older/compact phones).
   ============================================================ */
@media (max-width: 400px) {
  .nav-brand { font-size: 1rem; }
  .profile-avatar, .profile-avatar-placeholder { width: 80px; height: 80px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .btn { padding: 10px 14px; font-size: 0.85rem; }
}

/* === Misc === */
.divider { height: 1px; background: #0f3460; margin: 20px 0; }
.text-muted { color: #888; font-size: 0.875rem; }
.text-danger { color: #e94560; }
.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.w-100 { width: 100%; }
a { color: #e94560; }
a:hover { opacity: 0.85; }
hr { border: none; border-top: 1px solid #0f3460; margin: 20px 0; }


/* ============================================================
   Merged from assets/style.css
   ============================================================ */
:root {
  --bg: #0f0f17;
  --surface: #1a1a2e;
  --surface2: #222236;
  --border: #2e2e48;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --text: #e2e2f0;
  --muted: #888aaa;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* LINKS */
a {
  color: var(--accent-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================================================
   Page styles: settings.php
   ============================================================ */
/* ============================================================
     Modernized settings page styling.
     Scoped to .settings-wrap / .settings-section so the shared
     stylesheet (.card, .btn, .form-group, etc.) is left untouched —
     only spacing/structure/visuals on this page change.
     ============================================================ */

  .settings-wrap {
    max-width: 680px;
    margin: 0 auto;
  }

  .settings-wrap .page-header {
    margin-bottom: 28px;
  }
  .settings-wrap .page-header h1 {
    margin: 0;
  }
  .settings-wrap .page-header p {
    color: #999;
    margin-top: 4px;
    font-size: .9rem;
  }

  /* Sticky in-page nav so long settings pages are easy to jump around */
  .settings-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px;
    margin-bottom: 28px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    position: sticky;
    top: 12px;
    z-index: 5;
    backdrop-filter: blur(6px);
  }
  .settings-nav a {
    flex: 1;
    text-align: center;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: .8rem;
    font-weight: 600;
    color: #999;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
  }
  .settings-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
  }

  /* Each settings block: clear card separation with icon + title row */
  .settings-section {
    margin-bottom: 24px;
    padding: 24px;
    border-radius: 14px;
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.06);
    scroll-margin-top: 70px;
  }
  .settings-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px 0;
    font-size: 1.05rem;
  }
  .settings-section .section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(233,69,96,0.25), rgba(15,52,96,0.4));
    font-size: 1rem;
    flex-shrink: 0;
  }
  .settings-section .section-desc {
    color: #999;
    font-size: .85rem;
    margin: 0 0 18px 0;
  }
  .settings-section form {
    margin-top: 4px;
  }

  .settings-section .form-group {
    margin-bottom: 16px;
  }
  .settings-section .form-group label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 6px;
  }
  .settings-section input[type="text"],
  .settings-section input[type="email"],
  .settings-section input[type="password"],
  .settings-section input[type="file"],
  .settings-section textarea {
    width: 100%;
    box-sizing: border-box;
    background: #0f1629;
    border: 1px solid #2e2e48;
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-size: .9rem;
    transition: border-color .15s ease;
  }
  .settings-section input:focus,
  .settings-section textarea:focus {
    outline: none;
    border-color: #e94560;
  }
  .settings-section textarea {
    min-height: 90px;
    resize: vertical;
  }

  .avatar-current {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
  }
  .avatar-current img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px rgba(233,69,96,0.5);
  }
  .avatar-current span {
    font-size: .8rem;
    color: #888;
  }

  .masked-email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: .85rem;
    color: #fff;
    font-weight: 600;
  }

  @media (max-width: 600px) {
    .settings-section { padding: 18px; }
    .settings-nav { position: static; }
  }

/* ============================================================
   Page styles: register.php
   ============================================================ */
.auth-wrap {
    max-width: 480px;
    margin: 48px auto;
  }
  .auth-card {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 36px 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  }
  .auth-logo {
    text-align: center;
    margin-bottom: 8px;
  }
  .auth-logo i {
    font-size: 2.4rem;
    background: linear-gradient(135deg, #e94560, #ff7a8a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .auth-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
  }
  .auth-subtitle {
    text-align: center;
    color: #888;
    font-size: 0.875rem;
    margin-bottom: 28px;
  }
  .auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #555;
    font-size: 0.8rem;
  }
  .auth-divider::before,
  .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #0f3460;
  }
  .auth-footer-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: #888;
    flex-wrap: wrap;
    gap: 8px;
  }
  .tos-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #aaa;
    line-height: 1.5;
  }
  .tos-check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #e94560;
  }
  @media (max-width: 520px) {
    .auth-card { padding: 24px 18px; }
    .auth-wrap { margin: 24px auto; }
  }

/* ============================================================
   Page styles: forum.php
   ============================================================ */
.forum-wrap { max-width: 900px; margin: 0 auto; }
.forum-category { margin-bottom: 32px; }
.forum-category-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e94560;
    padding: 10px 16px;
    background: rgba(233,69,96,0.08);
    border-left: 3px solid #e94560;
    border-radius: 0 6px 6px 0;
    margin-bottom: 2px;
}
.forum-board-row {
    display: grid;
    grid-template-columns: 1fr 90px 90px 260px;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #16213e;
    border: 1px solid #0f3460;
    border-top: none;
    transition: background .15s;
}
.forum-board-row:first-of-type { border-top: 1px solid #0f3460; }
.forum-board-row:last-child { border-radius: 0 0 8px 8px; }
.forum-board-row:hover { background: #1a2a50; }
.board-icon { font-size: 1.5rem; flex-shrink: 0; }
.board-name { font-weight: 700; color: #fff; font-size: .95rem; text-decoration: none; }
.board-name:hover { color: #e94560; }
.board-desc { color: #888; font-size: .8rem; margin-top: 3px; }
.board-stat { text-align: center; }
.board-stat-num { font-size: 1rem; font-weight: 700; color: #cdd6f4; }
.board-stat-label { font-size: .7rem; color: #666; text-transform: uppercase; }
.board-last { font-size: .78rem; color: #888; }
.forum-header-row {
    display: grid;
    grid-template-columns: 1fr 90px 90px 260px;
    gap: 12px;
    padding: 6px 16px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #555;
    border-bottom: 1px solid #0f3460;
    margin-bottom: 0;
}
@media (max-width: 640px) {
    .forum-board-row { grid-template-columns: 1fr; gap: 6px; }
    .board-stat { display: none; }
}

/* ============================================================
   Page styles: image.php
   ============================================================ */
#main-image {
    transition: filter 0.5s ease-out;
  }
  #main-image.lqip-loading {
    filter: blur(20px);
  }

  /* ---- Display size modes ---- */
  .main-image {
    min-width: 0; /* lets the column shrink to fit in fit/actual-width modes */
  }
  #image-frame {
    border-radius: 8px;
  }

  /* Fit to screen: capped so very large images never force endless scrolling */
  #image-frame.mode-fit {
    max-height: 85vh;
    display: flex;
    justify-content: center;
    overflow: auto;
    width: 100%;
    max-width: 100%;
  }
  #image-frame.mode-fit #main-image,
  #image-frame.mode-fit #main-video {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    display: block;
  }

  /* Original: true pixel size, no scaling, no internal scrollbars/cropping.
     image-view-wrap.stack-original forces .main-image to take the FULL row
     width (flex-basis:100%), so the sidebar is always pushed to a new line
     below it rather than sitting beside/under a wide image and overlapping it. */
  .image-view-wrap.stack-original {
    flex-direction: column;
  }
  .image-view-wrap.stack-original .main-image {
    width: 100%;
  }
  .image-view-wrap.stack-original .image-sidebar {
    width: 100%;
  }
  #image-frame.mode-original {
    width: auto;
    max-width: none;
    overflow: visible;
  }
  #image-frame.mode-original #main-image,
  #image-frame.mode-original #main-video {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    display: block;
  }

  /* Actual width: fills the available column width, height follows naturally */
  #image-frame.mode-actual-width {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }
  #image-frame.mode-actual-width #main-image,
  #image-frame.mode-actual-width #main-video {
    max-width: 100%;
    max-height: none;
    width: 100%;
    height: auto;
    display: block;
  }

  /* While the tiny LQIP placeholder is showing, ignore the active size mode's
     natural-size rules — the placeholder is only 24px wide internally, so we
     force it to fill the frame at a reasonable size until the real image swaps in. */
  #image-frame #main-image.lqip-loading {
    max-width: 100% !important;
    max-height: 85vh !important;
    width: auto !important;
    height: auto !important;
  }

  /* Video player never needs the LQIP blur treatment, but it does still
     respect the same fit/original/actual-width sizing rules above. */
  #main-video {
    background: #000;
    border-radius: 8px;
  }

/* ============================================================
   Page styles: forum_board.php
   ============================================================ */
.forum-wrap { max-width: 900px; margin: 0 auto; }
.breadcrumb { font-size: .82rem; color: #888; margin-bottom: 16px; }
.breadcrumb a { color: #e94560; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.thread-list { display: flex; flex-direction: column; }
.thread-list .thread-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px 180px;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #16213e;
    border: 1px solid #0f3460;
    border-top: none;
    transition: background .15s;
    text-decoration: none;
    color: inherit;
}
.thread-list .thread-row:first-child { border-top: 1px solid #0f3460; border-radius: 8px 8px 0 0; }
.thread-list .thread-row:last-child { border-radius: 0 0 8px 8px; }
.thread-list .thread-row:hover { background: #1a2a50; }
.last-user { color: #cdd6f4; font-weight: 600; }
.thread-title { font-weight: 700; color: #fff; font-size: .93rem; }
.thread-title:hover { color: #e94560; }
.thread-meta { font-size: .76rem; color: #888; margin-top: 3px; }
.thread-stat { text-align: center; font-size: .85rem; color: #aaa; }
.thread-last { font-size: .76rem; color: #888; }
.thread-last a { color: #cdd6f4; text-decoration: none; }
.thread-last a:hover { color: #e94560; }
.pin-badge { background: #f59e0b; color: #000; font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.lock-badge { background: #555; color: #fff; font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }
.col-header-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px 180px;
    gap: 12px;
    padding: 6px 16px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #555;
}
@media (max-width: 640px) {
    .thread-list .thread-row { grid-template-columns: 1fr; }
    .col-header-row { display: none; }
    .thread-stat, .thread-last { display: none; }
}

/* ============================================================
   Page styles: category.php
   ============================================================ */
:root{
    --gw-bg:#0c0c0f;--gw-surface:#15151a;--gw-surface-2:#1b1b21;
    --gw-line:#232329;--gw-ink:#e8e6e1;--gw-ink-dim:#8a8780;
    --gw-ink-faint:#565550;--gw-brass:#c9893f;
  }
  /* body background intentionally not overridden — uses global #1a1a2e */

  .cat-hero {
    padding: 32px 0 20px;
    text-align: center;
  }
  .cat-hero h1 {
    font-family:'Fraunces',serif;
    font-size:clamp(1.8rem,4vw,2.8rem);
    color:var(--gw-ink);
    margin:0 0 8px;
  }
  .cat-hero p { color:var(--gw-ink-dim); margin:0; }

  .cat-tabs {
    display:flex;
    gap:8px;
    justify-content:center;
    flex-wrap:wrap;
    margin: 0 0 28px;
  }
  .cat-tab {
    padding:8px 22px;
    border-radius:20px;
    border:2px solid var(--gw-line);
    color:var(--gw-ink-dim);
    text-decoration:none;
    font-size:0.9rem;
    transition:all 0.15s;
  }
  .cat-tab:hover { border-color:var(--gw-brass); color:var(--gw-brass); }
  .cat-tab.active { border-color:var(--gw-brass); background:rgba(201,137,63,.15); color:var(--gw-brass); font-weight:600; }

  .gw-layout{display:flex;gap:24px;max-width:1600px;margin:0 auto;padding:0 16px 60px;}
  .gw-sidebar{width:200px;flex-shrink:0;}
  .gw-sidebar-box{background:var(--gw-surface);border:1px solid var(--gw-line);border-radius:10px;padding:16px;margin-bottom:16px;}
  .gw-sidebar-title{font-size:.7rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--gw-ink-faint);margin-bottom:12px;}
  .gw-tag-cloud{display:flex;flex-wrap:wrap;gap:6px;}
  .gw-tag-pill{display:inline-block;padding:3px 9px;border-radius:12px;background:var(--gw-surface-2);border:1px solid var(--gw-line);color:var(--gw-ink-dim);font-size:.75rem;text-decoration:none;transition:all .15s;}
  .gw-tag-pill:hover{border-color:var(--gw-brass);color:var(--gw-brass);}
  .gw-tag-pill.tag-lg{font-size:.85rem;padding:4px 11px;}
  .gw-main{flex:1;min-width:0;}
  .gw-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;}
  .gw-card{background:var(--gw-surface);border:1px solid var(--gw-line);border-radius:10px;overflow:hidden;transition:transform .15s,border-color .15s;}
  .gw-card:hover{transform:translateY(-2px);border-color:#3a3a42;}
  .gw-card-thumb{aspect-ratio:4/3;overflow:hidden;position:relative;background:var(--gw-surface-2);}
  .gw-card-thumb img{width:100%;height:100%;object-fit:cover;display:block;}
  .gw-card-info{padding:10px 12px 12px;}
  .gw-card-title a{color:var(--gw-ink);font-size:.875rem;font-weight:500;text-decoration:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
  .gw-card-title a:hover{color:var(--gw-brass);}
  .gw-card-meta{display:flex;justify-content:space-between;align-items:center;margin-top:6px;}
  .gw-card-stats{display:flex;gap:10px;font-size:.75rem;color:var(--gw-ink-faint);}
  .gw-card-author{font-size:.75rem;color:var(--gw-ink-dim);text-decoration:none;}
  .gw-card-author:hover{color:var(--gw-brass);}
  .gw-badge{position:absolute;top:8px;left:8px;font-size:.65rem;padding:2px 7px;border-radius:4px;font-weight:600;text-transform:uppercase;}
  .badge-pending{background:#7c5a00;color:#ffd86e;}
  .gw-empty{padding:60px 20px;text-align:center;color:var(--gw-ink-dim);}
  .gw-search-bar{display:flex;gap:8px;margin-bottom:20px;}
  .gw-search-bar input{flex:1;background:var(--gw-surface);border:1px solid var(--gw-line);border-radius:8px;padding:10px 14px;color:var(--gw-ink);font-size:.9rem;}
  .gw-search-bar input:focus{outline:none;border-color:var(--gw-brass);}
  .gw-search-bar button{background:var(--gw-brass);color:#fff;border:none;border-radius:8px;padding:10px 18px;cursor:pointer;font-size:.9rem;}

  .video-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:6px;color:var(--gw-ink-dim);}
  .video-placeholder svg{opacity:.5;}
  .video-placeholder span{font-size:.7rem;}

  @media(max-width:900px){.gw-sidebar{display:none;}.gw-layout{padding:0 10px 40px;}}
  @media(max-width:600px){.gw-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:8px;}}

/* ============================================================
   Page styles: forum_new_thread.php
   ============================================================ */
.forum-wrap { max-width: 760px; margin: 0 auto; }
.breadcrumb { font-size: .82rem; color: #888; margin-bottom: 16px; }
.breadcrumb a { color: #e94560; text-decoration: none; }

/* ============================================================
   Page styles: forum_thread.php
   ============================================================ */
.forum-wrap { max-width: 900px; margin: 0 auto; }
.breadcrumb { font-size: .82rem; color: #888; margin-bottom: 16px; }
.breadcrumb a { color: #e94560; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Post card ── */
.post-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    border: 1px solid #0f3460;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #16213e;
}
.post-author {
    background: #0f2040;
    border-right: 1px solid #0f3460;
    padding: 18px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.post-author-avatar { width:56px;height:56px;border-radius:50%;object-fit:cover;border:2px solid rgba(233,69,96,.5); }
.post-author-placeholder { width:56px;height:56px;border-radius:50%;background:#1f3460;border:2px solid rgba(233,69,96,.4);display:flex;align-items:center;justify-content:center;font-size:1.5rem; }
.post-author-name { font-weight:700;font-size:.88rem;color:#e94560;text-decoration:none;word-break:break-word;transition:color .15s; }
.post-author-name:hover { color:#ff7a8a;text-decoration:underline; }
.post-count-label { font-size:.68rem;color:#666; }

/* ── Role badge ── */
.role-badge { display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:999px;border:1px solid;font-size:.67rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;margin-top:2px; }
.role-badge-dot { width:6px;height:6px;border-radius:50%;flex-shrink:0; }

/* ── Post body area ── */
.post-body-wrap { padding:16px 18px;display:flex;flex-direction:column; }
.post-meta { font-size:.75rem;color:#666;margin-bottom:12px;border-bottom:1px solid #0f3460;padding-bottom:8px;display:flex;align-items:center;gap:6px;flex-wrap:wrap; }
.post-meta-right { margin-left:auto;display:flex;align-items:center;gap:6px; }
.post-body { font-size:.9rem;line-height:1.65;color:#cdd6f4;white-space:pre-wrap;word-break:break-word;flex:1; }
.post-signature { margin-top:16px;padding-top:10px;border-top:1px dashed #0f3460;font-size:.76rem;color:#666;white-space:pre-wrap; }

/* ── Quote / reply preview block ── */
.post-quote {
    background: #0d1b35;
    border-left: 3px solid #e94560;
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: .82rem;
    color: #99a8c6;
}
.post-quote-header {
    font-size: .72rem;
    font-weight: 700;
    color: #e94560;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.post-quote-header a { color: #e94560; text-decoration: none; }
.post-quote-header a:hover { text-decoration: underline; }
.post-quote-body {
    color: #7a8fb0;
    white-space: pre-wrap;
    word-break: break-word;
    /* clamp long quotes */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Action buttons ── */
.post-action-btn { background:none;border:1px solid transparent;border-radius:4px;padding:2px 8px;font-size:.72rem;cursor:pointer;transition:all .15s;display:inline-flex;align-items:center;gap:4px; }
.post-btn-edit   { color:#60a5fa;border-color:rgba(96,165,250,.3); }
.post-btn-edit:hover { background:rgba(96,165,250,.1);border-color:#60a5fa; }
.post-btn-delete { color:#f87171;border-color:rgba(248,113,113,.3); }
.post-btn-delete:hover { background:rgba(248,113,113,.1);border-color:#f87171; }
.post-btn-reply  { color:#34d399;border-color:rgba(52,211,153,.3); }
.post-btn-reply:hover { background:rgba(52,211,153,.1);border-color:#34d399; }

/* ── Inline edit form ── */
.edit-form-wrap { background:#0f2040;border:1px solid #e94560;border-radius:6px;padding:14px;margin-top:10px; }
.edit-form-wrap textarea { min-height:100px;font-family:inherit;margin-bottom:10px; }
.edit-form-actions { display:flex;gap:8px; }

/* ── Reply box (bottom) ── */
.reply-box { background:#16213e;border:1px solid #0f3460;border-radius:8px;padding:22px;margin-top:24px; }
.reply-box h3 { font-size:1rem;color:#e94560;margin-bottom:16px; }
.reply-box textarea { min-height:140px;font-family:inherit; }

/* ── Replying-to preview inside reply box ── */
.reply-to-preview {
    background: #0d1b35;
    border: 1px solid #0f3460;
    border-left: 3px solid #e94560;
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: .82rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.reply-to-preview-info { flex: 1; min-width: 0; }
.reply-to-preview-who { font-size:.72rem;font-weight:700;color:#e94560;margin-bottom:4px; }
.reply-to-preview-body { color:#7a8fb0;white-space:pre-wrap;word-break:break-word;
    display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden; }
.reply-to-preview-cancel { color:#666;font-size:.8rem;text-decoration:none;flex-shrink:0;margin-top:2px; }
.reply-to-preview-cancel:hover { color:#f87171; }

.thread-controls { display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:16px; }

@media (max-width:600px) {
    .post-card { grid-template-columns:1fr; }
    .post-author { flex-direction:row;text-align:left;border-right:none;border-bottom:1px solid #0f3460;padding:10px 14px; }
    .post-author-avatar,.post-author-placeholder { width:36px;height:36px;font-size:1rem; }
}

/* ============================================================
   Page styles: login.php
   ============================================================ */
.auth-wrap {
    max-width: 480px;
    margin: 48px auto;
  }
  .auth-card {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 36px 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  }
  .auth-logo {
    text-align: center;
    margin-bottom: 8px;
  }
  .auth-logo i {
    font-size: 2.4rem;
    background: linear-gradient(135deg, #e94560, #ff7a8a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .auth-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
  }
  .auth-subtitle {
    text-align: center;
    color: #888;
    font-size: 0.875rem;
    margin-bottom: 28px;
  }
  .auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #555;
    font-size: 0.8rem;
  }
  .auth-divider::before,
  .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #0f3460;
  }
  .auth-footer-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: #888;
    flex-wrap: wrap;
    gap: 8px;
  }
  @media (max-width: 520px) {
    .auth-card { padding: 24px 18px; }
    .auth-wrap { margin: 24px auto; }
  }

/* ============================================================
   Page styles: profile.php
   ============================================================ */
/* ============================================================
     Modernized profile page styling.
     Scoped to .profile-header / .tab-btn / .image-card so nothing
     in the shared stylesheet is touched — only this page changes.
     ============================================================ */

  .profile-header {
    position: relative;
    display: flex;
    gap: 28px;
    align-items: flex-start;
    padding: 28px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(233,69,96,0.10), rgba(15,52,96,0.25));
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
  }
  .profile-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at 0% 0%, rgba(233,69,96,0.12), transparent 60%);
    pointer-events: none;
  }

  .profile-avatar,
  .profile-avatar-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgba(233,69,96,0.55), 0 8px 24px rgba(0,0,0,0.35);
  }
  .profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    background: #0f3460;
  }

  .badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .05em;
    padding: 3px 9px;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 6px;
  }
  .admin-badge { background: linear-gradient(135deg, #e94560, #c81e45); color: #fff; }
  .staff-badge { background: linear-gradient(135deg, #0f3460, #1f5fa8); color: #fff; }
  .forummanager-badge { background: linear-gradient(135deg, #f59e0b, #b45309); color: #fff; }

  .profile-stats {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
  }
  .stat-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 10px 18px;
    min-width: 96px;
    text-align: center;
    transition: transform .15s ease, border-color .15s ease;
  }
  .stat-item:hover {
    transform: translateY(-2px);
    border-color: rgba(233,69,96,0.4);
  }
  .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
  }
  .stat-label {
    font-size: .7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 2px;
  }

  /* ---- Tabs: modern pill toggle instead of plain underline links ---- */
  .profile-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
  }
  .tab-btn {
    border: none;
    background: transparent;
    color: #999;
    font-size: .85rem;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 9px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
  }
  .tab-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
  }
  .tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #e94560, #c81e45);
    box-shadow: 0 4px 14px rgba(233,69,96,0.35);
  }

  /* ---- Image grid cards: subtle lift + zoom on hover ---- */
  .image-card {
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
  }
  .image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.4);
  }
  .image-card img {
    transition: transform .35s ease;
  }
  .image-card:hover img {
    transform: scale(1.06);
  }
  .card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 10px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
  }
  .badge-rejected { background: rgba(233,69,96,0.85); color: #fff; }
  .badge-removed  { background: rgba(107,114,128,0.85); color: #fff; }

  @media (max-width: 600px) {
    .profile-header {
      flex-direction: column;
      align-items: center;
      text-align: center;
      padding: 20px;
    }
    .profile-stats { justify-content: center; }
    .flex.gap-8.mt-16 { justify-content: center; }
  }


/* ============================================================
   PHONE / TOUCH ENHANCEMENTS
   Fixes glitches on mobile: tap highlighting, overscroll,
   momentum scrolling, minimum touch target sizes, and
   horizontal overflow prevention.
   ============================================================ */

/* Prevent blue flash on tap for all interactive elements */
a, button, [role="button"], .btn, .nav-toggle,
.dropdown-toggle, .like-btn, .fav-btn, .page-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* removes 300ms tap delay on iOS/Android */
}

/* Prevent horizontal scroll on any screen */
html {
  overflow-x: hidden;
  overscroll-behavior-x: none;
}
body {
  overflow-x: hidden;
}

@media (max-width: 1024px) {
  /* Minimum touch target size for non-nav interactive elements */
  .btn, .page-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* Hamburger button: square touch target */
  .nav-toggle {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /* Modals: fill more of the screen and allow internal scrolling */
  .modal {
    width: 96%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* On phones, ensure form inputs don't trigger iOS auto-zoom (requires ≥16px) */
@media (max-width: 640px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px;
  }
  /* Stack image action buttons so they don't overflow */
  .image-actions {
    flex-wrap: wrap;
  }
}

/* ============================================================
   MENU BUTTON - ONLY VISIBLE ON PHONES (MINIMAL)
   ============================================================ */

.browse-btn {
  display: none !important;
}

/* Show Menu button on tablets and phones only */
@media (max-width: 1024px) {
  .browse-btn {
    display: flex !important;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    margin-left: auto;
    transition: border-color .2s ease, box-shadow .2s ease;
  }
  
  .browse-btn:hover {
    border-color: rgba(233,69,96,0.5);
    box-shadow: 0 0 14px rgba(233,69,96,0.25);
  }
  
  .browse-btn i {
    font-size: 1.1rem;
  }
}

/* Further adjustments for mobile phones */
@media (max-width: 640px) {
  .browse-btn {
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    gap: 5px !important;
  }
  
  .browse-btn i {
    font-size: 1rem !important;
  }
}


/* ============================================================
   INDEX PAGE - AGGRESSIVE GRID FIX FOR MOBILE 3 COLUMNS
   ============================================================ */

/* Force 3 columns on phones - override ANY existing styles */
@media (max-width: 640px) {
  .idx-grid,
  #gwGrid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    grid-auto-rows: auto !important;
    grid-auto-flow: row !important;
  }
  
  .idx-grid > .idx-card,
  #gwGrid > .idx-card {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  
  .idx-thumb,
  .idx-video-placeholder {
    height: 120px !important;
  }
  
  .idx-card-info {
    padding: 8px 10px !important;
  }
  
  .idx-card-title {
    font-size: 0.75rem !important;
  }
  
  .idx-card-stats {
    font-size: 0.65rem !important;
  }
  
  .idx-card-author {
    font-size: 0.65rem !important;
  }
}

/* Very small phones - still 3 columns but tighter */
@media (max-width: 400px) {
  .idx-grid,
  #gwGrid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  
  .idx-thumb,
  .idx-video-placeholder {
    height: 100px !important;
  }
  
  .idx-card-info {
    padding: 6px 8px !important;
  }
}

/* Tablet - better spacing */
@media (max-width: 960px) and (min-width: 641px) {
  .idx-grid,
  #gwGrid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 12px !important;
  }
  
  .idx-layout {
    display: flex;
    flex-direction: column;
  }
  
  .idx-layout > .idx-sidebar {
    order: 2;
    width: 100%;
    position: static;
    margin-top: 28px;
  }
  
  .idx-layout > div:last-child {
    order: 1;
  }
}

/* ============================================================
   INDEX PAGE MOBILE LAYOUT - Tags Below Images, 3 Columns
   ============================================================ */

/* On mobile/tablet, move sidebar below images and adjust grid */
@media (max-width: 960px) {
  .idx-layout {
    display: flex;
    flex-direction: column;
  }
  
  /* Show sidebar AFTER images on mobile */
  .idx-layout > .idx-sidebar {
    order: 2;
    width: 100%;
    position: static;
    margin-top: 28px;
  }
  
  /* Images container appears first */
  .idx-layout > div:last-child {
    order: 1;
  }
  
  .idx-tags-card {
    position: static;
  }
  
  .idx-ad-card {
    flex-direction: row;
    align-items: center;
  }
  
  .idx-ad-slot {
    min-height: auto;
  }
}

/* 3 columns on phones */
@media (max-width: 640px) {
  .idx-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }
  
  .idx-thumb,
  .idx-video-placeholder {
    height: 120px !important;
  }
  
  .idx-card-info {
    padding: 8px 10px !important;
  }
  
  .idx-card-title {
    font-size: 0.75rem !important;
  }
  
  .idx-card-stats {
    font-size: 0.65rem !important;
  }
  
  .idx-card-author {
    font-size: 0.65rem !important;
  }
}

/* Very small phones - still 3 columns but tighter */
@media (max-width: 400px) {
  .idx-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  
  .idx-thumb,
  .idx-video-placeholder {
    height: 100px !important;
  }
  
  .idx-card-info {
    padding: 6px 8px !important;
  }
}

/* ============================================================
   TRENDING PAGE - IMAGE GRID MOBILE LAYOUT
   ============================================================ */

/* Desktop - Keep original layout */
@media (min-width: 961px) {
  .image-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 16px !important;
  }
}

/* Tablet - 2-3 columns */
@media (max-width: 960px) and (min-width: 641px) {
  .image-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 12px !important;
  }
  
  .image-card img {
    height: auto !important;
  }
}

/* Phone - 3 columns */
@media (max-width: 640px) {
  .image-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    grid-auto-rows: auto !important;
  }
  
  .image-card {
    overflow: hidden !important;
    border-radius: 8px !important;
    background: #1a1a2e !important;
  }
  
  .image-card div:first-child {
    height: 120px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #111827 !important;
    overflow: hidden !important;
  }
  
  .image-card img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }
  
  .card-info {
    padding: 8px 10px !important;
  }
  
  .card-title {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  .card-meta {
    font-size: 0.65rem !important;
    color: #888 !important;
    margin-top: 4px !important;
    display: flex !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
}

/* Very small phones - tight spacing */
@media (max-width: 400px) {
  .image-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  
  .image-card div:first-child {
    height: 100px !important;
  }
  
  .card-info {
    padding: 6px 8px !important;
  }
  
  .card-meta {
    font-size: 0.6rem !important;
  }
}


/* ============================================================
   FIX: Bell Icon Visibility in Navbar
   ============================================================ */

/* Ensure bell icon and all navbar icons are visible */
.nav-links > li > a i {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: inherit;
  font-size: 1rem;
  min-width: 16px;
}

/* Specific styling for the notifications bell */
.nav-links > li > a[href="/notifications.php"] {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.nav-links > li > a[href="/notifications.php"] i {
  font-size: 1.1rem;
  color: #ccc;
  transition: color .2s ease;
}

.nav-links > li > a[href="/notifications.php"]:hover i {
  color: #fff;
}

/* Badge positioning fix */
.nav-links > li > a[href="/notifications.php"] .badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #e94560;
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 10px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* Mobile/tablet adjustments */
@media (max-width: 640px) {
  .nav-links > li > a[href="/notifications.php"] i {
    font-size: 1rem;
  }
  
  .nav-links > li > a[href="/notifications.php"] .badge {
    top: -2px;
    right: -4px;
  }
}


/* ============================================================
   AGE GATE / 18+ POPUP MODAL
   ============================================================ */

.age-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.age-gate-modal {
  background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
  border: 2px solid #e94560;
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 520px;
  width: 90%;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(233, 69, 96, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
  animation: slideUp 0.4s ease-out;
  position: relative;
  overflow: hidden;
}

.age-gate-modal::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.2), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.age-gate-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  display: inline-block;
  background: linear-gradient(135deg, #e94560, #ff7a8a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(233, 69, 96, 0.4));
}

.age-gate-modal h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ff7a8a, #e94560 50%, #c026d3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.age-gate-modal p {
  color: #adb5bd;
  font-size: 1rem;
  line-height: 1.6;
  margin: 20px 0;
  position: relative;
  z-index: 1;
}

.age-gate-warning {
  background: rgba(233, 69, 96, 0.12);
  border-left: 4px solid #e94560;
  padding: 16px;
  border-radius: 8px;
  margin: 24px 0;
  font-size: 0.95rem;
  color: #fca5a5;
  position: relative;
  z-index: 1;
}

.age-gate-tos-link {
  display: inline-block;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

.age-gate-tos-link a {
  color: #e94560;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
  border-bottom: 1px solid rgba(233, 69, 96, 0.3);
  padding-bottom: 2px;
}

.age-gate-tos-link a:hover {
  color: #ff7a8a;
  border-bottom-color: #ff7a8a;
}

.age-gate-checkbox {
  margin: 24px 0;
  position: relative;
  z-index: 1;
}

.age-gate-checkbox label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #adb5bd;
  user-select: none;
}

.age-gate-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #e94560;
  flex-shrink: 0;
}

.age-gate-checkbox input[type="checkbox"]:hover {
  filter: brightness(1.2);
}

.age-gate-buttons {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  position: relative;
  z-index: 1;
}

.age-gate-btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.age-gate-btn:active {
  transform: translateY(1px);
}

.age-gate-btn-accept {
  background: linear-gradient(135deg, #e94560, #c026d3);
  color: #fff;
  box-shadow: 0 8px 20px rgba(233, 69, 96, 0.3);
}

.age-gate-btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(233, 69, 96, 0.5);
}

.age-gate-btn-accept:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.age-gate-btn-decline {
  background: transparent;
  color: #adb5bd;
  border: 1px solid #444;
}

.age-gate-btn-decline:hover {
  border-color: #adb5bd;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.age-gate-checkbox-hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .age-gate-modal {
    padding: 32px 24px;
    max-width: 90vw;
  }

  .age-gate-modal h1 {
    font-size: 1.6rem;
  }

  .age-gate-icon {
    font-size: 3rem;
  }

  .age-gate-buttons {
    flex-direction: column;
  }

  .age-gate-modal p {
    font-size: 0.95rem;
  }
}

/* Hide main content until age gate is accepted */
.age-gate-blocking body {
  overflow: hidden;
}

.age-gate-hidden {
  display: none;
}