/**
 * Admin-Bereich. Ergänzt styles.css — Marke, Knöpfe, Formularfelder und
 * Statusmeldungen kommen von dort, hier steht nur, was es ausschliesslich im
 * Admin-Bereich gibt.
 */

/* Anmeldung */

.adminLoginScreen {
  display: grid;
  min-height: 100vh;
  padding: 32px 20px;
  place-items: center;
  background: radial-gradient(circle at 50% 20%, rgba(201, 163, 77, .1), transparent 38%);
}

.adminLoginCard {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.adminLoginCard .brand { margin-bottom: 24px; }
.adminLoginCard .brand img { width: 220px; }
.adminLoginCard h1 { margin: 8px 0; font-size: 38px; }
.adminLoginCard > p:not(.eyebrow) { margin: 0 0 24px; color: var(--muted); }
.adminLoginCard form { text-align: left; }
.adminLoginCard form .primaryButton { width: 100%; }

/* Der Code wird abgetippt oder eingefügt — grosse Ziffern mit viel Abstand
   machen einen Zahlendreher sofort sichtbar. */
.codeInput {
  font-family: "SF Mono", Consolas, Menlo, monospace;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .35em;
  text-align: center;
}

.codeInput::placeholder { color: rgba(245, 241, 230, .14); }

.loginFooterActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
}

.loginFooterActions .quietLink { margin: 0; }

/* Rahmen */

.adminScreen {
  width: min(1220px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 28px 80px;
}

.adminTopbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.adminTopbarActions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.adminWho {
  color: var(--faint);
  font-size: 12px;
  font-weight: 750;
}

/* Reiter */

.adminTabs {
  display: flex;
  gap: 6px;
  margin: 26px 0 24px;
  padding-bottom: 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.adminTabs::-webkit-scrollbar { display: none; }

.adminTab {
  position: relative;
  flex: 0 0 auto;
  padding: 12px 18px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.adminTab:hover { color: var(--cream); }

.adminTab.active { color: var(--gold-light); }

.adminTab.active::after {
  position: absolute;
  right: 12px;
  bottom: -3px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  content: "";
}

.adminTabPanel > .statusMessage { margin-bottom: 18px; }

.adminColumns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.adminPanel {
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.adminPanel h2 { margin: 0 0 8px; }
.adminPanel > p { margin: 0 0 22px; color: var(--muted); }

/* Voting-Schalter */

.votingControl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 17px;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: rgba(201, 163, 77, .08);
  color: rgba(245, 241, 230, .78);
}

.votingControl > div { display: flex; flex-direction: column; }
.votingControl strong { font-size: 15px; }
.votingControl span { color: var(--muted); font-size: 13px; }
.votingControl.closed { border-left-color: var(--danger); background: rgba(238, 154, 135, .07); }
.votingControl.closed strong { color: var(--danger); }

/* Kennzahlen */

.adminStats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.adminStats > div {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.adminStats strong {
  display: block;
  color: var(--gold-light);
  font-size: 32px;
}

.adminStats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

/* Inhalte bearbeiten */

.adminRowActions.start { justify-content: flex-start; }

.contentCategory .contentRowHead { margin-bottom: 18px; }
.contentCategory h2 { margin: 0; }
.contentCategory.isHidden { opacity: .62; }

.contentRowHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.contentRowHead small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.contentRows {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.contentRow { border-bottom: 1px solid var(--line); }
.contentRow:last-child { border-bottom: 0; }
.contentRow > .contentRowHead { padding: 12px 14px; }
.contentRow.isOpen { background: rgba(255, 255, 255, .022); }

/* Ausgeblendetes bleibt lesbar, tritt aber sichtbar zurück. */
.contentRow.isHidden > .contentRowHead strong {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(238, 154, 135, .6);
}

.inlineEditor {
  padding: 4px 14px 16px;
  border-top: 1px dashed var(--line);
}

.contentCategory > .inlineEditor {
  margin-bottom: 18px;
  padding: 16px 0 0;
}

.fieldRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
}

.fieldLabel {
  display: block;
  margin-bottom: 6px;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 800;
}

.editorImages { margin-bottom: 16px; }

.imageStrip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.imageTile {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0a0c12;
}

.imageTile img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
}

.imageTile figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
}

.imageTile figcaption span {
  overflow: hidden;
  color: var(--faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editorActions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.editorActions .quietLink { margin: 0; }

.adminResultRow.isHidden strong { color: var(--muted); }
.adminResultRow.isHidden .resultBarFill { background: rgba(255, 255, 255, .16); }

.adminStats strong em {
  color: var(--muted);
  font-size: 16px;
  font-style: normal;
}

/* Inhaltsübersicht */

.adminCategory { border-top: 1px solid var(--line); }

.adminCategory summary {
  padding: 15px 0;
  color: var(--gold-light);
  cursor: pointer;
  font-weight: 800;
}

.adminNominee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .05);
}

.adminNominee p { margin: 0; }
.adminNominee small { color: var(--muted); }

/* Ergebnisse */

.adminResults {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.adminResultCategory + .adminResultCategory { border-top: 1px solid var(--line); }

.adminResultCategory h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 13px 15px;
  background: rgba(201, 163, 77, .08);
  color: var(--gold-light);
  font-size: 12px;
}

.adminResultCategory h3 small {
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.adminResultRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 34%) 28px;
  align-items: center;
  gap: 14px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.adminResultRow:last-child { border-bottom: 0; }

.adminResultRow strong {
  display: block;
  overflow: hidden;
  color: var(--cream);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resultBarTrack {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, .06);
}

.resultBarFill {
  height: 100%;
  border-radius: 3px;
  background: rgba(201, 163, 77, .45);
  transition: width .3s ease;
}

.adminResultRow.leading .resultBarFill {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.adminResultRow > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(201, 163, 77, .12);
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 800;
}

.adminResultRow.leading > span {
  background: rgba(201, 163, 77, .28);
  color: var(--cream);
}

/* API */

.freshKey {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: rgba(201, 163, 77, .08);
}

.freshKey strong { display: block; }

.freshKey > p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.freshKeyRow {
  display: flex;
  gap: 8px;
}

.freshKeyRow input {
  min-width: 0;
  flex: 1;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #090b10;
  color: var(--gold-light);
  font-family: "SF Mono", Consolas, Menlo, monospace;
  font-size: 12px;
}

.adminLinkRow code {
  color: var(--gold-light);
  font-size: 10px;
}

.apiSnippet {
  margin: 0 0 16px;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #090b10;
}

.apiSnippet code {
  color: var(--muted);
  font-family: "SF Mono", Consolas, Menlo, monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre;
}

/* Zugänge */

.adminLinks {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.adminLinkRow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.adminLinkRow:last-child { border-bottom: 0; }
.adminLinkRow > div { min-width: 0; flex: 1; }
.adminLinkRow strong,
.adminLinkRow small { display: block; }
.adminLinkRow small { color: var(--muted); font-size: 10px; }
.adminLinkRow.isBanned { background: rgba(238, 154, 135, .07); }
.adminLinkRow.isBanned strong { color: var(--danger); }

.adminRowActions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.miniButton {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(245, 241, 230, .2);
  border-radius: 7px;
  background: transparent;
  color: var(--cream);
  font-size: 11px;
  font-weight: 800;
}

.miniButton.danger {
  border-color: rgba(238, 154, 135, .45);
  color: var(--danger);
}

.miniButton[disabled] {
  cursor: not-allowed;
  opacity: .4;
}

@media (max-width: 900px) {
  .adminColumns { grid-template-columns: 1fr; }
  .fieldRow { grid-template-columns: 1fr; }
  .contentRowHead { align-items: stretch; flex-direction: column; }
  .contentRowHead .adminRowActions { justify-content: flex-start; }
  .adminStats { grid-template-columns: repeat(2, 1fr); }
  .votingControl { align-items: stretch; flex-direction: column; }
  .adminLinkRow { align-items: stretch; flex-direction: column; }
  .adminRowActions { justify-content: flex-start; }
  .adminResultRow { grid-template-columns: minmax(0, 1fr) 28px; }
  .resultBarTrack { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 480px) {
  .adminScreen { padding: 18px 14px 60px; }
  .adminTopbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .adminTopbar .brand.compact img { width: 120px; }
  .adminTab { padding: 11px 13px; font-size: 12px; }
  .adminPanel { padding: 18px; }
  .codeInput { font-size: 24px; letter-spacing: .25em; }
}
