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

:root {
  --bg:           #1a1d24;
  --bg2:          #21242d;
  --bg3:          #272b35;
  --bg4:          #2e3340;
  --bg5:          #363b4a;
  --border:       #323744;
  --border2:      #3d4354;
  --text:         #e8eaf0;
  --text2:        #9ca3af;
  --text3:        #5a6072;
  --purple:       #7c3aed;
  --purple2:      #6d28d9;
  --purple-light: #a78bfa;
  --purple-dim:   rgba(124,58,237,.18);
  --purple-dim2:  rgba(124,58,237,.1);
  --teal:         #06b6d4;
  --green:        #10b981;
  --yellow:       #f59e0b;
  --red:          #ef4444;
  --mirror-bg:    #4c3b8a;
  --mirror-hover: #5b48a0;
  --radius:       8px;
  --radius-lg:    10px;
  --header-h:     90px;
  --sidebar-w:    200px;
  --ad-w:         176px;
  --font:         'Inter', system-ui, sans-serif;
  --ease:         150ms ease;
}

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; }
input { font-family: inherit; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 200;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  height: 100%; padding: 0 16px;
}

/* Logo image */
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-img {
  height: 70px; width: auto;
  max-width: 280px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(124,58,237,.5));
}

.header-search {
  flex: 1; max-width: 340px; position: relative;
  display: flex; align-items: center;
}
.search-icon-sm {
  position: absolute; left: 10px; color: var(--text3); font-size: 1.1rem; pointer-events: none;
}
.header-search input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); border-radius: 6px; padding: 6px 10px 6px 32px;
  font-size: .875rem; outline: none; transition: border-color var(--ease);
}
.header-search input:focus { border-color: rgba(124,58,237,.5); }
.header-search input::placeholder { color: var(--text3); }

.header-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-stat {
  font-size: .8rem; color: var(--text3);
  background: var(--bg3); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 20px; white-space: nowrap;
}
.hbtn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 6px; font-size: .8125rem; font-weight: 500;
  transition: all var(--ease); white-space: nowrap;
}
.hbtn-outline {
  background: transparent; color: var(--text2); border: 1px solid var(--border2);
}
.hbtn-outline:hover { background: var(--bg4); color: var(--text); }
.hbtn-primary { background: var(--purple); color: #fff; border: 1px solid var(--purple); }
.hbtn-primary:hover { background: var(--purple2); }

/* ── Warning Banner ───────────────────────────────────────────────────────── */
.warning-banner {
  background: rgba(245,158,11,.12); border-bottom: 1px solid rgba(245,158,11,.25);
  color: var(--yellow); text-align: center; padding: 7px 20px; font-size: .8125rem;
}

/* ── Top Banners (468×60) ─────────────────────────────────────────────────── */
.top-banners {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 8px 16px;
}
.top-banners-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap;
}
.top-banner-slot {
  width: 468px; height: 60px; overflow: hidden; flex-shrink: 0;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg3); display: block;
}
.top-banner-slot img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* ── App layout ───────────────────────────────────────────────────────────── */
.app {
  display: flex; min-height: calc(100vh - var(--header-h));
  align-items: flex-start;
}

/* ── Ad columns (160×600) ─────────────────────────────────────────────────── */
.ad-col {
  width: var(--ad-w); flex-shrink: 0;
  padding: 16px 8px;
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto; overflow-x: hidden;
}
.ad-col::-webkit-scrollbar { display: none; }
.ad-stack { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ad-banner-slot {
  width: 160px; height: 600px; overflow: hidden;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg3); flex-shrink: 0;
  display: block;
}
.ad-banner-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 14px 10px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.sb-section { margin-bottom: 14px; }
.sb-label {
  font-size: .7rem; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text3);
  padding: 0 6px; margin-bottom: 8px;
}

.sb-search { position: relative; display: flex; align-items: center; }
.sb-search-icon { position: absolute; left: 9px; color: var(--text3); font-size: 1rem; pointer-events: none; }
.sb-search input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); border-radius: 6px; padding: 7px 8px 7px 28px;
  font-size: .8125rem; outline: none; transition: border-color var(--ease);
}
.sb-search input:focus { border-color: rgba(124,58,237,.5); }
.sb-search input::placeholder { color: var(--text3); }

.sb-check {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 6px; cursor: pointer;
  font-size: .8125rem; color: var(--text2);
  transition: background var(--ease), color var(--ease);
  user-select: none; position: relative;
}
.sb-check:hover { background: var(--bg3); color: var(--text); }
.sb-check input[type="checkbox"] { display: none; }

.chk-indicator {
  width: 15px; height: 15px; border-radius: 3px; flex-shrink: 0;
  border: 1.5px solid var(--border2); background: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ease); position: relative;
}
.sb-check input:checked ~ .chk-indicator { border-color: var(--purple); background: var(--purple); }
.sb-check input:checked ~ .chk-indicator::after {
  content: '✓'; color: #fff; font-size: .6rem; font-weight: 700; position: absolute;
}
.chk-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chk-dot.verified { background: var(--green); }
.chk-dot.approved { background: var(--teal); }
.chk-dot.warning  { background: #f59e0b; }
.chk-dot.pending  { background: var(--yellow); }
.chk-dot.archived { background: #6b7280; }
.card-warning-badge {
  font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 10px; margin-left: 4px;
  background: rgba(245,158,11,.12); color: #f59e0b; border: 1px solid rgba(245,158,11,.25);
}
.cat-icon-sm { font-size: .85rem; }

.sb-actions { display: flex; gap: 8px; margin-top: auto; padding: 0 2px; }
.sb-clear {
  flex: 1; background: var(--bg4); border: 1px solid var(--border2);
  color: var(--text2); padding: 7px; border-radius: 6px;
  font-size: .8125rem; transition: all var(--ease);
}
.sb-clear:hover { background: var(--bg5); color: var(--text); }
.sb-filter {
  flex: 1.5; background: var(--purple); color: #fff;
  padding: 7px; border-radius: 6px;
  font-size: .8125rem; font-weight: 600; letter-spacing: .04em;
  transition: background var(--ease);
}
.sb-filter:hover { background: var(--purple2); }

/* ── Main content ─────────────────────────────────────────────────────────── */
.main-content { flex: 1; padding: 16px 14px; min-width: 0; }

/* ── Featured Banner ──────────────────────────────────────────────────────── */
.featured-wrap { margin-bottom: 18px; overflow: hidden; border-radius: var(--radius-lg); }
.featured-track { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.featured-card {
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); transition: opacity var(--ease);
  height: 76px; background: var(--bg3);
}
.featured-card:hover { opacity: .85; }
.featured-card-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg3), var(--bg4));
  color: var(--text2); font-size: .8125rem; font-weight: 600; padding: 10px; text-align: center;
}

/* ── Section header ───────────────────────────────────────────────────────── */
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-header span:first-child {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em; color: var(--text3); text-transform: uppercase;
}
.section-count {
  font-size: .7rem; color: var(--text3);
  background: var(--bg3); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 10px;
}

/* ── Sites grid ───────────────────────────────────────────────────────────── */
.sites-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }

/* ── Site card ────────────────────────────────────────────────────────────── */
.site-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color var(--ease), background var(--ease);
}
.site-card:hover { border-color: var(--border2); background: var(--bg4); }

.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-logo-fallback {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--bg5); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0; overflow: hidden;
}
.card-logo-fallback img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }

.card-info { flex: 1; min-width: 0; }
.card-name-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 4px; }
.card-name { font-size: .9375rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.verified-icon { color: var(--green); font-size: .9rem; flex-shrink: 0; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-cat {
  font-size: .7rem; color: var(--text3);
  background: var(--bg2); border: 1px solid var(--border);
  padding: 1px 7px; border-radius: 4px; text-transform: lowercase;
}

.card-desc {
  font-size: .7875rem; color: var(--text2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; margin-top: auto;
}
.card-mirrors { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.mirror-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--mirror-bg); color: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  font-size: .55rem; font-weight: 700;
  transition: background var(--ease); cursor: pointer;
  border: 1px solid rgba(255,255,255,.08);
}
.mirror-dot:hover { background: var(--mirror-hover); color: #fff; }
.mirror-extra { font-size: .75rem; color: var(--text3); white-space: nowrap; }

.card-view {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .8rem; color: var(--purple-light); font-weight: 500;
  padding: 4px 10px; border-radius: 5px;
  background: var(--purple-dim2); border: 1px solid var(--purple-dim);
  transition: all var(--ease); white-space: nowrap;
  flex-shrink: 0;
}
.card-view:hover { background: var(--purple-dim); color: #fff; }

/* ── Loading / Empty ──────────────────────────────────────────────────────── */
.loading-wrap { display: flex; justify-content: center; padding: 60px; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border2); border-top-color: var(--purple);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 80px 20px; color: var(--text3); }
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* ── Show More ────────────────────────────────────────────────────────────── */
.show-more-wrap { text-align: center; padding: 20px 0 10px; }
.show-more-btn {
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text2); padding: 9px 24px; border-radius: 20px;
  font-size: .875rem; transition: all var(--ease);
}
.show-more-btn:hover { background: var(--bg4); color: var(--text); }

/* ── Submit page ──────────────────────────────────────────────────────────── */
.page-wrap { max-width: 660px; margin: 40px auto; padding: 0 20px; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; }
.page-sub { color: var(--text2); font-size: .9rem; margin-bottom: 28px; }
.form-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
}
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .8125rem; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.form-label .req { color: var(--purple-light); }
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--border2);
  color: var(--text); border-radius: var(--radius); padding: 9px 13px;
  font-size: .9rem; outline: none; transition: border-color var(--ease);
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: rgba(124,58,237,.5); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-select option { background: var(--bg3); }
.form-hint { font-size: .75rem; color: var(--text3); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn-submit {
  width: 100%; background: var(--purple); color: #fff;
  border: none; border-radius: var(--radius); padding: 11px;
  font-size: .9375rem; font-weight: 600; cursor: pointer; transition: background var(--ease);
}
.btn-submit:hover { background: var(--purple2); }
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: .875rem; margin-bottom: 16px; }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.2); color: var(--green); }
.alert-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.2);  color: var(--red); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1400px) {
  .sites-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 1200px) {
  .ad-col { display: none !important; }
  .sites-grid { grid-template-columns: repeat(3,1fr); }
  .featured-track { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 960px) {
  .sites-grid { grid-template-columns: repeat(2,1fr); }
  .featured-track { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 760px) {
  :root { --sidebar-w: 180px; }
  .header-search { display: none; }
  .top-banner-slot { width: 320px; }
}
@media (max-width: 600px) {
  .sidebar { display: none; }
  .sites-grid { grid-template-columns: 1fr; }
  .featured-track { grid-template-columns: 1fr 1fr; }
  .logo-img { height: 52px; max-width: 200px; }
}

/* ── Placeholder Banners ──────────────────────────────────────────────────── */
.banner-placeholder {
  opacity: .75; transition: opacity var(--ease), border-color var(--ease);
}
.banner-placeholder:hover { opacity: 1; border-color: rgba(124,58,237,.4) !important; }
.placeholder-inner {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; border-radius: 6px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 6px,
    rgba(255,255,255,.015) 6px,
    rgba(255,255,255,.015) 12px
  );
}
.placeholder-title {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text3);
}
.placeholder-sub {
  font-size: .7rem; color: var(--text3);
}
.placeholder-cta {
  font-size: .7rem; color: var(--purple-light); font-weight: 600;
  margin-top: 2px;
}

/* ── Contact / Advertising Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.cmodal {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.cmodal-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.cmodal-title-wrap { display: flex; align-items: center; gap: 12px; }
.cmodal-icon { font-size: 1.6rem; line-height: 1; }
.cmodal-title { font-size: 1rem; font-weight: 700; }
.cmodal-sub { font-size: .8125rem; color: var(--text3); margin-top: 2px; }
.cmodal-close {
  background: var(--bg4); border: 1px solid var(--border2);
  color: var(--text3); width: 28px; height: 28px; border-radius: 50%;
  font-size: .75rem; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ease);
}
.cmodal-close:hover { background: var(--bg2); color: var(--text); }
.cmodal-body { padding: 20px 22px 24px; }
.cmodal-alert {
  padding: 10px 14px; border-radius: var(--radius);
  font-size: .875rem; margin-bottom: 14px;
}
.cmodal-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.2); color: var(--green); }
.cmodal-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.2);  color: var(--red); }
.cform-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.cform-group { margin-bottom: 14px; }
.cform-label { display: block; font-size: .8rem; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.cform-input {
  width: 100%; background: var(--bg2); border: 1px solid var(--border2);
  color: var(--text); border-radius: var(--radius); padding: 8px 12px;
  font-size: .875rem; outline: none; transition: border-color var(--ease);
  font-family: inherit;
}
.cform-input:focus { border-color: rgba(124,58,237,.5); }
.cform-textarea { resize: vertical; min-height: 100px; }
.cform-submit {
  width: 100%; background: var(--purple); color: #fff;
  border: none; border-radius: var(--radius); padding: 10px;
  font-size: .9375rem; font-weight: 600; cursor: pointer;
  transition: background var(--ease); margin-top: 4px; font-family: inherit;
}
.cform-submit:hover:not(:disabled) { background: var(--purple2); }
.cform-submit:disabled { opacity: .6; cursor: not-allowed; }
/* Banner upload inside contact modal */
.cform-upload-wrap { display:flex; flex-direction:column; gap:8px; }
.cform-drop-zone {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:4px; padding:16px; cursor:pointer; text-align:center;
  background:var(--bg2); border:2px dashed var(--border2); border-radius:var(--radius);
  font-size:.8rem; color:var(--text2); transition:border-color .15s,background .15s;
}
.cform-drop-zone:hover,.cform-drop-zone.dragover {
  border-color:rgba(124,58,237,.5); background:rgba(124,58,237,.04);
}
.cform-img-preview {
  display:flex; align-items:flex-start; gap:10px; position:relative;
}
.cform-img-preview img {
  max-width:100%; max-height:80px; border-radius:6px;
  border:1px solid var(--border2); object-fit:contain;
}
.cform-img-remove {
  position:absolute; top:-6px; right:-6px; width:20px; height:20px;
  border-radius:50%; background:#ef4444; color:#fff; border:none;
  font-size:.65rem; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
@media (max-width: 480px) {
  .cform-row { grid-template-columns: 1fr; }
}
