/* Mastodon Hidden Posts Stats – style.css (Dark Violet Theme) */
/* © 2025 Moritz Glantz */

:root {
  --bg: #0f0d17;
  --bg-grad-a: #100a1f;
  --bg-grad-b: #1a1330;
  --bg-grad-c: #241745;
  --card: #1a1822;
  --border: #2d2a3d;
  --accent: #7b5cff;
  --accent-2: #a58aff;
  --text: #eae9ef;
  --text-dim: #b9b7c6;
}

/* ============================================================
   Base
   ============================================================ */
html {
  height: 100%;
  scroll-behavior: smooth;
  background: linear-gradient(315deg, var(--bg-grad-c), var(--bg-grad-b) 55%, var(--bg-grad-a));
  background-attachment: fixed;
  color-scheme: dark;
  scrollbar-gutter: stable;
}

body {
  min-height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: transparent;
  overflow-x: hidden;
}

/* ============================================================
   Header
   ============================================================ */
body > header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(16, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

@media (max-height: 500px) {
  header {
    position: static;
  }
}

body > header .inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

body > header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  text-wrap: pretty;
}

.🐘::before {
  content: "🦣" / "";
}

@media (max-width: 480px) {
  body > header h1 {
    font-size: 1.1rem;
  }
  .🐘::before {
    content: "" / "";
  }
}

#instanceName {
  font-size: 1rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* ============================================================
   Layout
   ============================================================ */
main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  box-sizing: border-box;
}

/* When login is visible, center it */
main:has(#login:not(.hidden)) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   Login form
   ============================================================ */
#login:not(.hidden) {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 1.2rem;
  margin-top: -5vh; /* slightly above vertical center */
}

.start-heading {
  font-size: clamp(2.2rem, 6vw + 1rem, 5.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.start-subline {
  font-size: clamp(1rem, 1.5vw + 0.5rem, 2rem);
  font-weight: 400;
  color: var(--text-dim);
  max-width: 580px;
  margin: 0 auto 1rem;
  line-height: 1.4;
}

#login label {
  font-weight: 600;
}

#login input,
#login button {
  width: 100%;
  max-width: 320px;
}

/* ============================================================
   Form elements
   ============================================================ */
input,
select,
button {
  font-size: 1rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  color: var(--text);
}

input,
select {
  background: rgba(255, 255, 255, 0.05);
}

input::placeholder {
  color: #9a96ad;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123, 92, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   Buttons
   ============================================================ */
button {
  background: linear-gradient(90deg, #4a35b5, var(--accent));
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(123, 92, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(123, 92, 255, 0.55);
}

button:active {
  transform: translateY(0);
}

/* ============================================================
   Post form
   ============================================================ */
#postsForm {
  margin: 2rem auto;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
}

#postsForm .inner {
     display: flex;
     flex-wrap: wrap;
      align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;

}

#postsForm label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

#postsForm select,
#postsForm button {
  width: auto;
  min-width: 140px;
}

/* ============================================================
   Table
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  /* border-radius: 0.75rem; */
  overflow-x: auto;
}

@media (max-width: 500px) {
  table {
    width: calc(100% + 2.4rem);
    font-size: 12px;
    margin: 0.5rem -1.2rem 0;
  }
  caption {
    padding-left: 1.2rem;
  }
}

caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: var(--text);
}

th,
td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
  color: var(--text-dim);
}

th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  color: var(--text);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* ============================================================
   Cards
   ============================================================ */
.hidden {
  display: none;
}

section.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1.25rem;
  margin-top: 1.5rem;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
}

section.card > h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  font-weight: 700;
}

/* ============================================================
   Stat Grid
   ============================================================ */
.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  text-align: center;
}

.stat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.9rem;
  font-size: 0.95rem;
}

.stat span {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--accent-2);
  margin-top: 0.25rem;
}

/* ============================================================
   Matches
   ============================================================ */
details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.55rem 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  display: inline-block;
}

details[open] summary {
  background: rgba(123, 92, 255, 0.15);
  border-color: rgba(123, 92, 255, 0.35);
}

article.match {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  margin: 0.6rem 0;
  line-height: 1.5;
}

article.match header {
  background: none !important;
  margin-bottom: 0.4rem;
  color: var(--text-dim);
  font-weight: 500;
  border: none;
  padding: 0;
  box-shadow: none;
}

@media (max-width: 500px) {
  article.match {
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    margin: 0.6rem -1.3rem;
    background: transparent;
  }
}

/* ============================================================
   Links
   ============================================================ */
a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  color: #d2c5ff;
  text-decoration: underline;
}

/* ============================================================
   Keyword Chips
   ============================================================ */
.kw {
  display: inline-block;
  background: rgba(123, 92, 255, 0.18);
  color: #e1dbff;
  padding: 0.25em 0.6em;
  margin: 0;
  border-radius: 0.6em;
  font-size: 0.8em;
  font-weight: 600;
  border: 1px solid rgba(123, 92, 255, 0.25);
}

.kw-list {
  list-style: none;
  margin: 0.5em 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

/* ============================================================
   Screen Reader Only
   ============================================================ */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  max-width: 900px;
  margin: 2rem auto 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-dim);
}

footer a {
  color: var(--accent-2);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  #login:not(.hidden) {
    margin-top: -3vh;
  }
}

#instanceName.user {
  display: block;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 500;
}
#instanceName.user small {
    display: block;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-left: 0.25rem;
  margin-top: .5rem;
}
