/* ===== Theme ===== */
:root{
  --bg: #05070d;
  --bg-grad-1: #0a0f1f;
  --bg-grad-2: #05070d;
  --text: #eaf2ff;
  --muted: #b6c3d6;
  --card: rgba(16, 24, 40, .45);
  --card-strong: rgba(16, 24, 40, .7);
  --stroke: rgba(255,255,255,.08);
  /* Bold accent (single hue family, audacious but not rainbow) */
  --accent: #7cf0ff;         /* cyan electric */
  --accent-2: #7f5af0;       /* violet punch */
  --accent-3: #00d1b2;       /* teal alt for glow */
  --shadow: 0 10px 30px rgba(0,0,0,.4);
  --radius: 16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial;
  color:var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(127,90,240,.18), transparent 60%),
              radial-gradient(1200px 600px at 110% 20%, rgba(124,240,255,.18), transparent 60%),
              linear-gradient(140deg, var(--bg-grad-1), var(--bg-grad-2));
}

/* Links */
a{color: var(--accent); text-decoration:none; transition: .2s ease}
a:hover{opacity:.9; text-decoration:underline}

/* Header / Footer (glass) */
.site-header,.site-footer{
  position: sticky;
  top: 0;
  z-index: 20;
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 16px;
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom:1px solid var(--stroke);
  box-shadow: var(--shadow);
}
.site-footer{position: static; border-top:1px solid var(--stroke); border-bottom:none; margin-top:24px}

.brand{font-weight:800;letter-spacing:.5px}
nav a{margin:0 6px;padding:8px 12px;border-radius:999px;border:1px solid transparent}
nav a.active,nav a:hover{background:rgba(124,240,255,.08);border-color:rgba(124,240,255,.2)}

/* Layout */
.container{max-width:1100px;margin:0 auto;padding:16px}

/* Glass panel */
.panel{
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
  box-shadow: var(--shadow);
}

/* Controls */
.controls{
  display:grid;
  /* allow the switch column to size to content so the label doesn't wrap */
  grid-template-columns: 1fr 140px auto 120px;
  gap:10px;
  align-items:center;
  margin:0;
}

/* When the controls are rendered inside a panel with panel padding removed,
   give the controls container its own internal padding so inputs aren't flush */
.controls.panel{
  padding:10px 12px;
}
.controls input{
  padding:12px 14px;
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  color:var(--text);
  border-radius: 12px;
  outline: none;
  transition: border .2s ease, box-shadow .2s ease;
}
.controls input:focus{
  border-color: rgba(124,240,255,.45);
  box-shadow: 0 0 0 3px rgba(124,240,255,.15);
}

/* Material-like switch */
.switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;user-select:none;white-space:nowrap}
.switch input{display:none}
.switch-slider{
  display:inline-block;
  vertical-align:middle;
  /* slightly larger so knob has equal horizontal & vertical breathing room */
  width:48px; height:26px; border-radius:999px; position:relative;
  background:rgba(255,255,255,.04); box-shadow:inset 0 1px 2px rgba(0,0,0,.12);
  transition:background .18s ease,border-color .18s ease;
  border:1px solid rgba(255,255,255,.04);
}
.switch-slider::after{
  content:'';
  position:absolute;
  /* match vertical spacing with horizontal spacing: (height - knob)/2 = (26 - 18)/2 = 4px */
  left:4px;
  top:50%;
  width:18px; height:18px; border-radius:50%; background:#ffffff;
  transform: translateY(-50%);
  transition: transform .18s ease, background .18s ease;
  box-shadow:0 2px 6px rgba(0,0,0,.18);
}
/* checked = green gradient */
.switch input:checked + .switch-slider{
  background: linear-gradient(90deg, #00d1b2 0%, #00a37f 100%);
  border-color: rgba(0,209,178,.22);
  box-shadow: 0 8px 24px rgba(0,209,178,.06);
}
.switch input:checked + .switch-slider::after{transform:translate(22px, -50%);background:#ffffff}
/* color label when enabled */
.switch input:checked + .switch-slider + .switch-label{ color: #bff7ee }
.witch-label{font-size:.9rem;color:var(--muted);margin-left:6px}
.switch-label{font-size:.9rem;color:var(--muted);margin-left:6px;margin-right:10px}

/* Buttons - audacious accent, glassy */
.btn{
  position: relative;
  display:inline-flex;align-items:center;justify-content:center;
  gap:8px;
  padding:12px 16px;
  border-radius: 12px;
  border:1px solid transparent;
  cursor:pointer;
  font-weight:700;
  letter-spacing:.2px;
  transition: transform .08s ease, box-shadow .2s ease, border .2s ease, background .2s ease;
  user-select:none;
  background: linear-gradient(180deg, rgba(127,90,240,.22), rgba(127,90,240,.12));
  color:var(--text);
  border-color: rgba(127,90,240,.45);
  box-shadow: 0 6px 16px rgba(127,90,240,.22), inset 0 0 0 999px rgba(255,255,255,.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(127,90,240,.28);
}
.btn:active{
  transform: translateY(0);
}
.btn--accent{
  background: linear-gradient(180deg, rgba(124,240,255,.28), rgba(124,240,255,.12));
  border-color: rgba(124,240,255,.5);
  box-shadow: 0 6px 16px rgba(124,240,255,.25), inset 0 0 0 999px rgba(255,255,255,.02);
}
.btn--ghost{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border-color: var(--stroke);
}
.btn:focus-visible{outline:none; box-shadow: 0 0 0 3px rgba(124,240,255,.25)}

/* Table (glass) */
.table-wrap{overflow:hidden}
.panel > .table-wrap{ /* remove extra margins so table sits naturally */
  margin: 0;
}

.panel > #meta{ /* keep spacing for the Total / sort line (reduced) */
  margin-top: 8px;
}
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}
.table thead th{
  position: sticky; top:0; z-index: 1;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom:1px solid var(--stroke);
}
.table th,.table td{padding:12px 14px;text-align:left}
.table tbody tr{border-bottom:1px solid var(--stroke)}
.table tbody tr:hover{background: rgba(255,255,255,.03)}

/* Meta & pagination */
#meta{margin:10px 0;color:var(--muted);font-size:.95rem}
.pagination{display:flex;gap:10px;align-items:center;justify-content:flex-end;margin-top:12px}

/* Pagination controls (numbers + arrows) */
.pagination-group{ display:inline-flex; align-items:center; overflow:hidden; box-shadow:none; border-radius:calc(var(--radius) - 6px); }
.page-btn{
  min-width:32px; height:32px; padding:0 8px; border:0; border-left:1px solid rgba(255,255,255,.03);
  background: transparent;
  color:var(--text); font-weight:700; cursor:pointer; margin:0; display:inline-flex; align-items:center; justify-content:center;
  transition: background-color .12s ease, color .12s ease, transform .08s ease;
  font-size:0.95rem;
}
.page-btn:first-child{ border-left: none }
.page-btn:hover{ box-shadow: 0 4px 8px rgba(0,0,0,.18); transform: translateY(-1px); }
.page-btn.active{ background: linear-gradient(180deg, rgba(124,240,255,.10), rgba(124,240,255,.04)); color:var(--text); }
.page-btn.arrow{ min-width:34px }
.page-ellipsis{ padding:0 10px; color:var(--text); font-weight:700; margin:0 8px; align-self:center }

/* limit select */
.limit-select{ padding:8px 10px; border-radius:10px; background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)); border:1px solid var(--stroke); color:var(--text); font-weight:700 }
.limit-select:focus{ outline:none; box-shadow:0 0 0 3px rgba(124,240,255,.08) }

/* Make pagination container transparent, right-aligned and visually consistent */
#pagination{ background:transparent; box-shadow:none; padding:6px 12px 0 12px; display:flex; justify-content:space-between; align-items:center; width:100%; max-width:1100px; margin:12px auto }

/* Put border on the merged button group so it matches page panels */
.pagination-group{ border:1px solid var(--stroke); background: var(--card); }

.pagination-left{ display:flex; align-items:center; gap:20px }
.pagination-left .limit-select{ margin-left:0 }

.show-group{ display:flex; align-items:center; gap:4px }
.show-group > span{
  display:inline-flex;
  align-items:center;
  height:28px;
  padding:0 8px;
  border-radius:8px;
  background: transparent;
  color: var(--muted);
  font-weight:700;
  font-size:0.85rem;
  border:1px solid transparent;
  margin-right:0 !important;
}

.limit-select{
  height:28px;
  /* leave extra right padding to make room for the caret */
  padding:0 34px 0 8px;
  border-radius:8px;
  font-weight:700;
  background: var(--card-strong);
  border: 1px solid var(--stroke);
  color: var(--text);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* SVG caret (light) embedded so native arrow isn't required */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23eaf2ff'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 12px;
}

/* Ensure option list is readable (some browsers allow styling) */
.limit-select option{
  color: var(--text);
  background: var(--card);
}

/* Inline meta shown to the right of the Show control */
.meta-inline{
  margin-left:20px; /* comfortable gap between select and Total */
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
  white-space:nowrap;
  align-self:center;
  opacity:0.9;
}

/* Sortable table headers */
.sortable{ cursor: pointer; user-select: none }
.sortable.sorted-asc, .sortable.sorted-desc{ font-weight:800; color: var(--accent) }
/* smaller, lighter sort indicator glyph */
.sort-indicator{ font-size:0.78rem; opacity:0.8; margin-left:6px; line-height:1; vertical-align:middle }

/* gentler hover effect for buttons */
.page-btn:hover{ background: rgba(255,255,255,.03); transform:none; box-shadow:none }

/* Utility chips */
.badge{
  padding:4px 8px; border-radius:999px; font-weight:700; font-size:.85rem;
  border:1px solid rgba(124,240,255,.35); color:var(--text);
  background: linear-gradient(180deg, rgba(124,240,255,.14), rgba(124,240,255,.06));
}

/* Small screens */
@media (max-width: 720px){
  .controls{grid-template-columns:1fr 1fr; grid-auto-rows: auto}
}

/* Row wrapper for controls + actions (refresh button) */
.controls-row{ display:flex; align-items:stretch; gap:12px; margin:14px 0 }
.controls-row .controls{ flex:1 }
.controls-actions, .controls-action { display:flex; align-items:stretch; margin:0; flex:0 0 auto; height: auto }

/* direct-button variant: when the button is placed directly inside .controls-row
   (class `controls-action` applied to the button itself) we need an explicit
   selector to style it like the previous wrapper + child button. */
.controls-row > .btn.controls-action{
  height:100%;
  box-sizing: border-box;
  padding:14px;
  aspect-ratio: 1 / 1;
  display:inline-grid;
  place-items:center;
  min-width:44px;
  max-width:100%;
}

@media (max-width:720px){
  .controls-row > .btn.controls-action{ height:44px; padding:10px }
}
.controls-actions .btn, .controls-action .btn{
  /* make the action button fill the controls row height and be square (1:1) */
  height:100%;
  box-sizing: border-box;
  /* keep the same internal padding as the panel while keeping the element square */
  padding:14px;
  aspect-ratio: 1 / 1;
  display:inline-grid;
  place-items:center;
  min-width:44px;
  max-width:100%;
}

@media (max-width:720px){
  .controls-row{ flex-direction:column; align-items:stretch }
  .controls-actions{ justify-content:flex-end }
  .controls-actions .btn, .controls-action .btn{ height:44px; padding:10px }
}


/* Centered layout: 90% width, centered both horizontally & vertically */
.outer{
  min-height: 100vh;
  display: flex;
  align-items: center; /* vertical center */
}
.shell{
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== Status pill (index + player) ===== */
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke, rgba(255,255,255,.15));
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight:800;
  letter-spacing:.2px;
  line-height:1;
}
.pill .dot{
  width:10px; height:10px; border-radius:50%;
  display:inline-block;
}
.pill.on{
  border-color: rgba(0,209,178,.5);
  background: linear-gradient(180deg, rgba(0,209,178,.28), rgba(0,209,178,.10));
  color:#eafffb;
}
.pill.on .dot{
  background:#00d1b2;
  box-shadow: 0 0 0 0 rgba(0,209,178,.55);
  animation: pillpulse 1.6s ease-out infinite;
}
.pill.off{
  color: rgba(255,255,255,.7);
}
.pill.off .dot{
  background: rgba(255,255,255,.45);
}
@keyframes pillpulse{
  0%{ box-shadow: 0 0 0 0 rgba(0,209,178,.55) }
  70%{ box-shadow: 0 0 0 10px rgba(0,209,178,0) }
  100%{ box-shadow: 0 0 0 0 rgba(0,209,178,0) }
}

/* ===== Table/list polish (optionnel) ===== */
table.list{ width:100%; border-collapse:collapse }
table.list tr{ border-bottom:1px solid rgba(255,255,255,.06) }
table.list tr:hover{ background:rgba(255,255,255,.03) }
table.list th, table.list td{ padding:10px 12px; vertical-align:middle }
th.col-handle, td.col-handle{ white-space:nowrap }

/* RSI avatar shown in index list before handle */
.rsi-avatar{
  width:28px; height:28px; border-radius:50%; object-fit:cover; vertical-align:middle;
  margin-right:8px; display:inline-block; border:1px solid rgba(255,255,255,0.04);
}

/* Tooltip for activity chart points */
.chart-tooltip{
  position:fixed;
  z-index:9999;
  background: rgba(12,18,24,0.95);
  color: #dff9ff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  pointer-events: none;
  transition: transform .06s ease, opacity .06s linear;
}


/* Location pill (small) */
.location-pill{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 10px;border-radius:999px;font-weight:800;font-size:.95rem;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border:1px solid rgba(255,255,255,.04);
  color:var(--text);
}
.location-pill{ cursor: pointer }
.location-pill .material-icons{ font-size:18px; line-height:1; color:var(--muted); margin-right:6px }
.location-pill.type-coords .material-icons{ color: #ffd166 }
.location-pill.type-water .material-icons{ color: #00b4ff }
.location-pill.type-terrain .material-icons{ color: #8be38b }
.location-pill.type-city .material-icons{ color: #f8b500 }
.location-pill.type-outpost .material-icons{ color: #d6a3ff }
.location-pill.type-station .material-icons{ color: #9ad0ff }

/* Shard pill (reuses location-pill visuals) */
.shard-pill{ padding:6px 10px; gap:8px; font-weight:800; }
.shard-pill .material-icons{ font-size:16px; color:var(--muted); margin-right:6px }
.shard-pill .loc-text{ font-size:.95rem }
.shard-pill .material-icons{ display:none }
.shard-flag{ font-size:16px; line-height:1; margin-right:8px; display:inline-block }
.shard-flag-img{ width:20px; height:20px; object-fit:cover; border-radius:50%; margin-right:0; display:inline-block; vertical-align:middle; border:1px solid rgba(255,255,255,0.04) }
.shard-raw{ font-size:.95rem; padding:6px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.04); background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)); color:var(--text); font-weight:700 }
.shard-eu{ border-color: rgba(64,128,255,.12); background: linear-gradient(180deg, rgba(64,128,255,.06), rgba(64,128,255,.02)); }
.shard-us{ border-color: rgba(0,200,120,.10); background: linear-gradient(180deg, rgba(0,200,120,.06), rgba(0,200,120,.02)); }
.shard-asia{ border-color: rgba(255,200,80,.10); background: linear-gradient(180deg, rgba(255,200,80,.06), rgba(255,200,80,.02)); }
.shard-aus{ border-color: rgba(200,120,255,.10); background: linear-gradient(180deg, rgba(200,120,255,.06), rgba(200,120,255,.02)); }
.shard-unknown{ border-color: rgba(255,255,255,.04); }


/* Tweak: slightly smaller icons and tighter pagination buttons */
.sort-indicator .material-icons.sort-icon{ font-size:14px; line-height:1; vertical-align:middle; display:inline-block }
.page-btn .material-icons{ font-size:13px; line-height:1; vertical-align:middle }
.page-btn{ padding:0 6px; min-width:28px; height:28px; font-size:0.85rem }
.page-btn.arrow{ min-width:30px }
.pagination-group{ border-radius:10px }

