/* /assets/css/secretlair.css
   The Mana Forge — Secret Lair Tracker styling
   Scoped as much as possible to Secret Lair pages (secretlair.php + secretlair_drop.php)
*/

:root{
  --tmf-bg: #0f0f10;
  --tmf-panel: rgba(18,18,18,.72);
  --tmf-panel-2: rgba(26,26,26,.78);
  --tmf-border: rgba(255,77,77,.22);
  --tmf-border-strong: rgba(255,77,77,.38);
  --tmf-accent: #ff4d4d;
  --tmf-accent-2: #ff6b6b;
  --tmf-text: #e9e9ea;
  --tmf-muted: rgba(233,233,234,.72);
  --tmf-shadow: 0 14px 40px rgba(0,0,0,.55);
  --tmf-radius: 18px;
  --tmf-radius-sm: 14px;
}

/* ---- Page container alignment (match TMF content blocks) ---- */
.sl-wrap,
.content-wrapper .secretlair-container{
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 18px 44px;
}

/* Give the content a TMF “panel” feel like the Banned Cards page */
.sl-wrap{
  background: linear-gradient(180deg, rgba(0,0,0,.0), rgba(0,0,0,.0));
}

/* =========================
   HEADER (FIX: centered title + full-width line)
   ========================= */
.sl-head{
  position: relative;
  width: 100%;
  margin: 6px 0 16px;
  padding: 0 0 14px;

  /* Center title block, keep tabs floating right */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;

  /* make sure absolute tabs don’t overlap the centered title area */
  min-height: 74px;
}

/* Center the title/subtitle block and make it full width */
.sl-head > div:first-child{
  width: 100%;
  text-align: center;
}

/* Tabs: pin to the right on desktop without affecting centering */
.sl-head .sl-tabs{
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);

  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* Full-width divider line under the header (TMF style) */
.sl-head::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:2px;
  background: rgba(235,74,76,.55);
  box-shadow: 0 1px 0 rgba(0,0,0,.6);
  border-radius: 2px;
}

/* Title: force-center + prevent global h1 borders/underlines */
.sl-title{
  font-family: "Roboto", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  font-size: 34px;
  line-height: 1.1;
  margin: 0;
  color: var(--tmf-accent);
  text-shadow: 0 2px 0 rgba(0,0,0,.55);

  /* hard override against global styles */
  border: 0 !important;
  padding: 0 !important;
  text-align: center !important;
  display: block;
  width: 100%;
}

.sl-sub{
  margin-top: 6px;
  font-size: 13px;
  color: var(--tmf-muted);
}

/* Tabs (Upcoming / Released / All) */
.sl-tab{ display:block; }

.sl-tab a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.82);
  text-decoration:none;
  font-size: 12px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.sl-tab a:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
  background: rgba(0,0,0,.28);
}

.sl-tab a.active{
  border-color: rgba(255,77,77,.55);
  background: rgba(255,77,77,.12);
  color: #fff;
}

/* Empty message */
.sl-empty,
.secretlair-empty,
.secretlair-error{
  margin-top: 18px;
  padding: 16px 16px;
  border-radius: var(--tmf-radius);
  background: var(--tmf-panel);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.86);
  box-shadow: var(--tmf-shadow);
}

.secretlair-error{
  border-color: rgba(255,77,77,.35);
}

/* ---- Overview grid ---- */
.sl-grid{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

/* Cards */
.sl-card{
  overflow:hidden;
  border-radius: var(--tmf-radius);
  background: var(--tmf-panel);
  border: 1px solid var(--tmf-border);
  box-shadow: var(--tmf-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.sl-card:hover{
  transform: translateY(-2px);
  border-color: var(--tmf-border-strong);
  box-shadow: 0 18px 55px rgba(0,0,0,.62);
}

/* Hero image area */
.sl-hero{
  position:relative;
  height: 148px;
  background:
    radial-gradient(1200px 300px at 10% 0%, rgba(255,77,77,.16), transparent 55%),
    linear-gradient(180deg, rgba(36,36,36,.92), rgba(12,12,12,.92));
  border-bottom: 1px solid rgba(255,255,255,.08);
  overflow:hidden;
}

.sl-hero img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
  filter: saturate(1.05) contrast(1.02);
  opacity: .95;
  transform: scale(1.02);
}

.sl-hero:after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.70));
  pointer-events:none;
}

/* Title overlay on hero */
.sl-hero-title{
  position:absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  font-size: 12px;
  color: rgba(255,255,255,.72);
  letter-spacing: .2px;
  text-shadow: 0 2px 0 rgba(0,0,0,.55);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

/* Body */
.sl-body{
  padding: 12px 14px 14px;
}

.sl-name{
  margin: 4px 0 10px;
  font-size: 16px;
  line-height: 1.25;
  color: rgba(255,255,255,.94);
}

/* Meta row (Release + status pill) */
.sl-meta{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.78);
  font-size: 12px;
}

/* Status pill */
.sl-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.20);
  color: rgba(255,255,255,.88);
  text-transform: lowercase;
}

.sl-pill.upcoming{
  border-color: rgba(120,190,255,.42);
  background: rgba(120,190,255,.12);
  color: rgba(225,245,255,.96);
  text-transform: capitalize;
}

.sl-pill.released{
  border-color: rgba(255,77,77,.42);
  background: rgba(255,77,77,.10);
  color: #fff;
  text-transform: capitalize;
}

/* Actions row */
.sl-actions{
  margin-top: 12px;
  display:flex;
  gap: 10px;
}

.sl-btn{
  flex: 1 1 auto;
  height: 32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  color: rgba(255,255,255,.9);
  text-decoration:none;
  font-size: 12px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.sl-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
  background: rgba(0,0,0,.30);
}

.sl-btn.primary{
  border-color: rgba(255,77,77,.55);
  background: rgba(255,77,77,.12);
}

.sl-btn.primary:hover{
  border-color: rgba(255,77,77,.72);
  background: rgba(255,77,77,.18);
}

/* ---- Drop detail page ---- */
.content-wrapper{
  padding: 0;
}

.secretlair-container{
  margin-top: 6px;
}

/* Header area on drop page */
.drop-header{
  margin: 6px auto 18px;
  padding: 18px 18px 16px;
  border-radius: var(--tmf-radius);
  background: var(--tmf-panel);
  border: 1px solid var(--tmf-border);
  box-shadow: var(--tmf-shadow);
  text-align:center;
}

.drop-title{
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--tmf-accent);
  text-shadow: 0 2px 0 rgba(0,0,0,.55);
}

.drop-meta{
  display:flex;
  flex-wrap: wrap;
  justify-content:center;
  gap: 10px;
}

/* Pills on drop page */
.drop-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.86);
  font-size: 12px;
  white-space: nowrap;
}

.drop-link{
  text-decoration:none;
  border-color: rgba(255,77,77,.45);
  background: rgba(255,77,77,.10);
}

.drop-link:hover{
  border-color: rgba(255,77,77,.65);
  background: rgba(255,77,77,.16);
}

/* Cards grid in drop detail */
.card-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

/* Each card tile */
.card-item{
  display:block;
  text-decoration:none;
  border-radius: var(--tmf-radius);
  background: var(--tmf-panel);
  border: 1px solid var(--tmf-border);
  box-shadow: var(--tmf-shadow);
  overflow:hidden;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.card-item:hover{
  transform: translateY(-2px);
  border-color: var(--tmf-border-strong);
  box-shadow: 0 18px 55px rgba(0,0,0,.62);
}

/* Image area — keep a consistent “banned cards” tile vibe */
.card-img-wrap{
  background:
    radial-gradient(700px 180px at 30% 0%, rgba(255,77,77,.10), transparent 55%),
    linear-gradient(180deg, rgba(34,34,34,.95), rgba(10,10,10,.95));
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 12px 12px 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 320px;
}

.card-img-wrap img{
  width: 100%;
  max-width: 230px;
  height: auto;
  display:block;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(0,0,0,.55);
}

.card-img-ph{
  width: 100%;
  max-width: 230px;
  height: 320px;
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,.18);
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(255,255,255,.62);
  font-size: 12px;
}

/* Caption */
.card-caption{
  padding: 12px 14px 14px;
  text-align:left;
}

.card-name{
  font-size: 14px;
  color: rgba(255,255,255,.92);
  margin-bottom: 6px;
  line-height: 1.25;
}

.card-sub{
  font-size: 12px;
  color: rgba(255,255,255,.68);
}

/* === FIX: title truly centered + full-width divider like TMF === */
.sl-head{
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    "left title tabs"
    "line line line";
  align-items: center;
  column-gap: 16px;
  row-gap: 10px;

  min-height: unset !important;
  padding-bottom: 16px;
}

/* title/subtitle wrapper = middle column */
.sl-head > div:first-child{
  grid-area: title;
  width: auto !important;
  text-align: center !important;
  justify-self: center;
}

/* tabs = right column, no absolute positioning */
.sl-head .sl-tabs{
  grid-area: tabs;
  position: static !important;
  transform: none !important;
  justify-self: end;
}

/* full-width line under header */
.sl-head::after{
  grid-area: line;
  content: "";
  position: static !important;
  display: block;
  width: 100%;
  height: 2px;
  background: rgba(235,74,76,.55);
  box-shadow: 0 1px 0 rgba(0,0,0,.6);
  border-radius: 2px;
}

/* mobile: stack tabs under title */
@media (max-width: 860px){
  .sl-head{
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "tabs"
      "line";
    justify-items: center;
  }
  .sl-head .sl-tabs{
    justify-self: center;
  }
}


/* ---- Responsiveness ---- */
@media (max-width: 860px){
  .sl-head{
    min-height: 0;
    align-items: center;
  }

  /* tabs become normal flow and center nicely */
  .sl-head .sl-tabs{
    position: static;
    transform: none;
    width: 100%;
    justify-content: center;
    margin-top: 2px;
  }
}

@media (max-width: 520px){
  .sl-wrap,
  .content-wrapper .secretlair-container{
    padding-left: 12px;
    padding-right: 12px;
  }
  .sl-title{ font-size: 28px; }
  .sl-actions{ flex-direction: column; }
  .sl-btn{ width: 100%; }
  .card-img-wrap{ min-height: 300px; }
  .card-img-wrap img{ max-width: 210px; }
}
