/* ── Theme Variables ─────────────────────────────────────────── */
:root {
  --bg: #f0f2f6;
  --surface: #ffffff;
  --surface-alt: #f5f6fb;
  --surface-card: #ffffff;
  --text: #2d3040;
  --text-muted: #5e6278;
  --text-subtle: #9295a8;
  --border: #e2e4f0;
  --accent: #5c3d99;
  --accent-link: #1a6bc4;
  --btn-bg: #9b4dca;
  --btn-hover: #7a3ca2;
  --shadow: rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171d;
    --surface: #1e2028;
    --surface-alt: #292c3e;
    --surface-card: #22253a;
    --text: #c9cbd3;
    --text-muted: #888b98;
    --text-subtle: #585b68;
    --border: #3e4158;
    --accent: #9b7fd4;
    --accent-link: #5a9ad5;
    --btn-bg: #6545a0;
    --btn-hover: #7d5ab8;
    --shadow: rgba(0, 0, 0, 0.35);
  }
}

[data-theme="light"] {
  --bg: #f0f2f6;
  --surface: #ffffff;
  --surface-alt: #f5f6fb;
  --surface-card: #ffffff;
  --text: #2d3040;
  --text-muted: #5e6278;
  --text-subtle: #9295a8;
  --border: #e2e4f0;
  --accent: #5c3d99;
  --accent-link: #1a6bc4;
  --btn-bg: #9b4dca;
  --btn-hover: #7a3ca2;
  --shadow: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --bg: #16171d;
  --surface: #1e2028;
  --surface-alt: #292c3e;
  --surface-card: #22253a;
  --text: #c9cbd3;
  --text-muted: #888b98;
  --text-subtle: #585b68;
  --border: #3e4158;
  --accent: #9b7fd4;
  --accent-link: #5a9ad5;
  --btn-bg: #6545a0;
  --btn-hover: #7d5ab8;
  --shadow: rgba(0, 0, 0, 0.35);
}

/* ── Base ────────────────────────────────────────────────────── */
body {
  font-family: "Roboto", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 2rem 1rem;
  transition: background 0.25s ease, color 0.25s ease;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 3px 8px var(--shadow);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

h1 {
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 500;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--border);
}

a {
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background-color: var(--btn-bg);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

button.copy-btn:hover {
  background-color: var(--btn-hover);
  border-color: var(--btn-hover);
  outline: 0;
}

button.copy-btn .material-icons {
  font-size: 1.8rem;
  vertical-align: middle;
  line-height: 1;
}

/* ── Theme Toggle ────────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px var(--shadow);
  transition: background 0.2s ease, border-color 0.2s ease;
  z-index: 100;
  padding: 0;
  color: var(--text);
}

.theme-toggle:hover {
  background: var(--surface-alt);
}

/* ── Changelog ───────────────────────────────────────────────── */
.pr-section {
  margin-bottom: 3em;
  padding: 1.5em;
  border-left: 4px solid var(--accent-link);
  background-color: var(--surface-alt);
  transition: background 0.25s ease;
}

.changelog-link {
  color: var(--accent-link);
  text-decoration: none;
  font-weight: 500;
}

.changelog-link:hover {
  text-decoration: underline;
}

.text-muted {
  color: var(--text-muted);
}

.work-item-card {
  margin-bottom: 1em;
  padding: 1em;
  background-color: var(--surface-card);
  border-radius: 4px;
  transition: background 0.25s ease;
}

.no-data {
  color: var(--text-subtle);
  text-align: center;
  padding: 2em;
}

/* ── Filter Toggle Row ───────────────────────────────────────── */
.filter-toggle-row {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.btn-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 1.4rem;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-filter-toggle:hover {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text);
  outline: 0;
}

/* ── Filters ─────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: stretch;
  padding: 1.2rem 1.4rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 2rem;
}

.filter-input {
  flex: 1;
  min-width: 18rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1.4rem;
  line-height: 1.5;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent-link);
}

/* Select wrapper: icono de Material Icons como flecha, anula el doble arrow de milligram */
.select-wrapper {
  position: relative;
  display: inline-flex;
}

.select-icon {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 2rem;
  color: var(--text-muted);
}

.filter-select {
  padding: 0.6rem 3.2rem 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--surface) !important;
  background-image: none !important;
  color: var(--text);
  font-family: inherit;
  font-size: 1.4rem;
  line-height: 1.5;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color 0.15s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-link);
}

.btn-clear {
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 1.4rem;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.btn-clear:hover {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text);
  outline: 0;
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination button {
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1.4rem;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text);
  outline: 0;
}

.pagination span {
  color: var(--text-muted);
  font-size: 1.4rem;
  white-space: nowrap;
}

.btn-scroll-top {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 1.4rem;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.btn-scroll-top:hover {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text);
  outline: 0;
}

/* ── Material Icons in buttons ───────────────────────────────── */
.btn-filter-toggle .material-icons,
.btn-clear .material-icons,
.pagination button .material-icons,
.btn-scroll-top .material-icons {
  font-size: 2rem;
  vertical-align: middle;
  line-height: 1;
}

.btn-filter-toggle[data-active="true"] {
  color: var(--accent-link);
  border-color: var(--accent-link);
}
