/* /content/styles.css — FULL REWRITE (drop-in)
   Targets:
   - Wrapper: .wrap
   - Search input: #worldSearch (and .searchInput fallback)
   - Clear button: #clearSearch (and .clearBtn fallback)
   - Filter buttons: .filterBtn within .filters
   - Cards: .card / .worldCard etc.
*/

/* ---------- Theme ---------- */
:root{
  --bg0:#07090d;
  --bg1:#0b0f17;

  --panel: rgba(15,22,36,.62);
  --panel2: rgba(11,15,23,.55);

  --stroke: rgba(34,49,79,.82);
  --strokeSoft: rgba(34,49,79,.55);

  --text: #e9f1ff;
  --muted: #a8b4cc;

  --accent: #31c7ff;
  --accent2:#7c5cff;
  --good: #3dff7a;

  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --shadow2: 0 16px 44px rgba(0,0,0,.45);

  --radius: 18px;
  --radiusSm: 14px;
}

/* ---------- Hard reset (scoped-ish) ---------- */
*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 20% 0%, rgba(49,199,255,.18), transparent 60%),
    radial-gradient(700px 500px at 90% 10%, rgba(124,92,255,.15), transparent 55%),
    radial-gradient(900px 600px at 50% 110%, rgba(61,255,122,.08), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  text-align:center;
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }

/* IMPORTANT: prevent random global site css from messing with things inside .wrap */
.wrap, .wrap *{
  /* Don’t use all: unset; (too destructive). This is a gentle “contain” instead. */
  font-family: inherit;
}

/* ---------- Layout ---------- */
.wrap{
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.title{
  display:inline-flex;
  align-items:center;
  gap:12px;
  padding:10px 14px;
  border:1px solid var(--strokeSoft);
  border-radius:999px;
  background: rgba(15,22,36,.55);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.badge{
  width:12px;height:12px;border-radius:999px;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent) 35%, rgba(49,199,255,.15) 70%);
  box-shadow: 0 0 0 6px rgba(49,199,255,.12);
}
.titleText{ font-size:12px; color:rgba(233,241,255,.78); letter-spacing:.3px; }

h1{
  margin: 14px 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing:.2px;
  line-height:1.08;
  text-shadow: 0 8px 30px rgba(0,0,0,.45);
}
.subtitle{
  margin:0 auto;
  max-width:780px;
  color: var(--muted);
  line-height:1.45;
  font-size:14px;
}

/* ---------- Controls (Search + Filters) ---------- */
.controls{
  margin: 18px auto 0;
  max-width: 920px;
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:center;
}

/* Search container — targets .searchWrap, but also works if you only have an input */
.searchWrap,
.controls form,
.controls [role="search"]{
  width: min(920px, 100%);
}

/* The actual bar */
.searchWrap{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 12px 12px;
  border-radius: 18px;
  border: 1px solid rgba(49,199,255,.35);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow2);
  position:relative;
  overflow:hidden;
}

/* subtle glow overlay */
.searchWrap::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(700px 220px at 10% 0%, rgba(49,199,255,.18), transparent 55%),
    radial-gradient(700px 220px at 90% 0%, rgba(124,92,255,.16), transparent 55%);
  opacity:.75;
  pointer-events:none;
}

.searchWrap:focus-within{
  border-color: rgba(49,199,255,.80);
  box-shadow:
    0 18px 60px rgba(0,0,0,.60),
    0 0 0 3px rgba(49,199,255,.18);
}

/* icon chip */
.searchIcon{
  opacity:.95;
  font-size: 14px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(11,15,23,.55);
  border: 1px solid rgba(34,49,79,.75);
}

/* input — hits #worldSearch OR .searchInput */
#worldSearch,
.searchInput{
  flex:1;
  width:100%;
  min-width: 140px;
  border:0 !important;
  outline:0 !important;
  background: transparent !important;
  color: rgba(233,241,255,.98);
  font-size: 14px;
  letter-spacing: .2px;
  padding: 8px 2px;
}
#worldSearch::placeholder,
.searchInput::placeholder{
  color: rgba(168,180,204,.70);
}

/* clear button — hits #clearSearch OR .clearBtn */
#clearSearch,
.clearBtn{
  border: 1px solid rgba(34,49,79,.85);
  background: rgba(11,15,23,.55);
  color: rgba(233,241,255,.9);
  border-radius: 14px;
  padding: 9px 12px;
  cursor:pointer;

  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
#clearSearch:hover,
.clearBtn:hover{
  border-color: rgba(49,199,255,.75);
  background: rgba(15,22,36,.90);
  transform: translateY(-1px);
}
#clearSearch:active,
.clearBtn:active{ transform: translateY(0px); }

/* Filter row */
.filters{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  justify-content:center;
}

/* Filter buttons */
.filters .filterBtn{
  border: 1px solid rgba(49,199,255,.30);
  background: rgba(11,15,23,.45);
  color: rgba(233,241,255,.88);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  cursor:pointer;
  box-shadow: 0 10px 26px rgba(0,0,0,.30);
  transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.filters .filterBtn:hover{
  border-color: rgba(49,199,255,.70);
  background: rgba(15,22,36,.80);
  transform: translateY(-1px);
}
.filters .filterBtn.is-active{
  border-color: rgba(49,199,255,.95);
  background: linear-gradient(180deg, rgba(49,199,255,.22), rgba(124,92,255,.12));
  color: #fff;
  box-shadow:
    0 16px 40px rgba(0,0,0,.45),
    0 0 0 1px rgba(255,255,255,.05) inset;
}

#resultCount,
.resultCount{
  color: rgba(233,241,255,.60);
  font-size: 12px;
  padding-left: 6px;
}

/* ---------- Grid / Cards ---------- */
.grid{
  display:grid;
  grid-template-columns: repeat( auto-fit, minmax(265px, 1fr) );
  gap:16px;
  margin-top: 22px;
}

.card{
  position:relative;
  text-align:left;
  border-radius: var(--radius);
  overflow:hidden;
  background: linear-gradient(180deg, rgba(15,22,36,.85), rgba(15,22,36,.60));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  isolation:isolate;

  display:flex;
  flex-direction:column;
  height:100%;
}
.card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(650px 220px at 20% 0%, rgba(49,199,255,.22), transparent 55%),
    radial-gradient(650px 220px at 80% 0%, rgba(124,92,255,.18), transparent 55%);
  opacity:.65;
  z-index:-1;
  pointer-events:none;
}
.card:hover{
  transform: translateY(-3px);
  border-color: rgba(49,199,255,.70);
  box-shadow: 0 26px 70px rgba(0,0,0,.62);
}

.mapLink{ display:block; padding:14px 14px 12px; flex:1; }

.thumb{
  width:100%;
  height:170px;
  border-radius: 16px;
  overflow:hidden;
  border:1px solid rgba(26,37,64,.95);
  background: rgba(15,22,36,.9);
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
  position:relative;
}
.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.01);
  transition: transform .25s ease, filter .25s ease;
}
.card:hover .thumb img{
  transform: scale(1.05);
  filter: saturate(1.15) contrast(1.05);
}
.thumb .shine{
  position:absolute; inset:0;
  background: linear-gradient(120deg, transparent 25%, rgba(255,255,255,.08) 40%, transparent 55%);
  transform: translateX(-65%);
  transition: transform .5s ease;
  pointer-events:none;
}
.card:hover .thumb .shine{ transform: translateX(65%); }

.meta{ margin-top:12px; }
.worldName{
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .2px;
  color: var(--accent);
}
.dates{
  margin: 0 0 8px;
  font-size: 13px;
  color: rgba(233,241,255,.86);
}
.desc{
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

/* Status chip */
.statusChip{
  position:absolute;
  top:10px; right:10px;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34,49,79,.85);
  background: rgba(11,15,23,.65);
  backdrop-filter: blur(8px);
}
.statusChip.is-active{
  border-color: rgba(61,255,122,.55);
  color: rgba(61,255,122,.95);
}
.statusChip.is-archived{
  border-color: rgba(49,199,255,.45);
  color: rgba(49,199,255,.95);
}

/* ---------- Actions / Buttons ---------- */
.actions{
  margin-top:auto;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  padding: 0 14px 14px;
}

/* Buttons (hit .btn and also plain buttons in actions if any) */
.actions .btn,
.btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(34,49,79,.88);
  background:
    radial-gradient(120px 50px at 50% 0%, rgba(255,255,255,.08), transparent 60%),
    rgba(11,15,23,.55);
  color: rgba(233,241,255,.92);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  user-select:none;

  box-shadow:
    0 10px 24px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,.04) inset;

  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
}

/* Hover glow strip */
.actions .btn::after,
.btn::after{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(49,199,255,.0), rgba(49,199,255,.20), rgba(124,92,255,.16), rgba(49,199,255,.0));
  opacity:0;
  pointer-events:none;
  transition: opacity .15s ease;
  z-index:-1;
}

.actions .btn:hover,
.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(49,199,255,.60);
  background:
    radial-gradient(120px 50px at 50% 0%, rgba(255,255,255,.10), transparent 60%),
    rgba(15,22,36,.85);
  box-shadow:
    0 16px 34px rgba(0,0,0,.50),
    0 0 0 1px rgba(255,255,255,.06) inset;
  color:#fff;
}
.actions .btn:hover::after,
.btn:hover::after{ opacity:1; }

.actions .btn:active,
.btn:active{ transform: translateY(0px); }

.btn.save{
  border-color: rgba(61,255,122,.40);
  color: rgba(61,255,122,.95);
}
.btn.save:hover{
  border-color: rgba(61,255,122,.85);
  color: #e8fff0;
  background:
    radial-gradient(120px 50px at 50% 0%, rgba(61,255,122,.10), transparent 60%),
    rgba(15,22,36,.90);
}
.btn.save::after{
  background: linear-gradient(90deg, rgba(61,255,122,.0), rgba(61,255,122,.22), rgba(49,199,255,.14), rgba(61,255,122,.0));
}

.btn.secondary{ color: rgba(49,199,255,.95); }
.btn.secondary:hover{ color:#fff; }

.actions .btn.save{ flex: 1 1 100%; }
.actions .btn.secondary{ flex: 1 1 calc(50% - 10px); }

.icon{ width:14px; height:14px; display:inline-block; opacity:.92; }

.footer{
  margin-top: 26px;
  color: rgba(233,241,255,.55);
  font-size: 12px;
}

/* ---------- Focus + reduced motion ---------- */
a:focus-visible, button:focus-visible, input:focus-visible{
  outline: 2px solid rgba(49,199,255,.85);
  outline-offset: 3px;
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce){
  .card, .thumb img, .thumb .shine, .btn, .filterBtn, #clearSearch, .clearBtn{ transition:none !important; }
  .card:hover{ transform:none; }
  .card:hover .thumb img{ transform:none; }
  .card:hover .thumb .shine{ transform:none; }
  .btn:hover, .filterBtn:hover{ transform:none; }
}

/* ---------- TEMP DEBUG (remove once you see it working) ----------
   If you still see no changes, your page is NOT using these selectors
   OR /content/styles.css isn’t actually loading.
*/
/*
.searchWrap{ outline: 3px solid red !important; }
.filterBtn{ outline: 2px solid lime !important; }
*/
