/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.hidden {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.as-danger-button {
  background-color: var(--pico-del-color);
  color: var(--pico-primary-inverse);
  border: none;
  padding: var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);
  border-radius: 0.25rem;
  cursor: pointer;
  margin-bottom: var(--pico-spacing);
  text-decoration: none;
  display: inline-block;
}

.nested-answer-fields {
  background-color: #f2f2f2;
  padding: var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);
  margin-left: 12px;
  margin-bottom: 10px;
  border-radius: var(--pico-border-radius);
}

.form-check-label {
  margin-top: 1rem;
}

/* targets directly following each other */
.form-check-label+.form-check-label {
  margin-top: 0rem;
}

:where(input, select, textarea, fieldset, .grid)~small {
  display: block;
  width: 100%;
  margin-top: calc(var(--pico-spacing) * -.75);
  margin-bottom: var(--pico-spacing);
  margin-left: calc(var(--pico-spacing) * 0.25);
  color: var(--pico-muted-color)
}

/* Input Card Styles */
:root {
  /* Or a wrapper class like .admin-ui */
  --color-text: hsl(210, 10%, 23%);
  /* Dark gray for main text */
  --color-text-muted: hsl(210, 10%, 45%);
  /* Lighter gray for secondary text */
  --color-surface: hsl(210, 20%, 98%);
  /* Very light off-white for main background */
  --color-surface-muted: hsl(210, 20%, 96%);
  /* Slightly darker gray for headers/footers */
  --color-border: hsl(210, 15%, 88%);
  /* Light gray for borders */
  --color-accent: hsl(210, 90%, 58%);
  /* A strong, clear blue for links and actions */
  --color-destructive: hsl(0, 72%, 51%);
  /* A clear but not jarring red */
}

.input-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  /* Slightly softer corners */
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
  /* Subtle shadow */
  overflow: hidden;
  /* Ensures child borders don't stick out */
}

.input-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.3rem 0.5rem;
  background-color: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
}

article>header {
  margin-bottom: 0;
}

.input-key {
  font-family: monospace;
  font-size: 1em;
  font-weight: bold;
  color: var(--color-text);
}

.input-type-badge {
  font-size: 0.75em;
  font-weight: 500;
  background-color: var(--color-border);
  color: var(--color-text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  /* Pill shape */
  margin-left: 0.75rem;
  text-transform: capitalize;
}

.input-card-actions {
  display: flex;
  gap: 0.5rem;
}

.input-card-actions .destructive-link {
  /* Reset button styles to look like a link */
  background-color: transparent;
  border: none;
  padding: 0;
  height: auto;
  box-shadow: none;

  margin-bottom: 0;

  /* Apply destructive color and smaller size */
  color: var(--color-destructive);
  font-size: 0.85em;
  font-weight: 500;

  /* Add underline on hover for clear feedback */
  text-decoration: none;
}

.input-card-actions .destructive-link:hover {
  background-color: transparent;
  /* Ensure no background on hover */
  text-decoration: underline;
  /* Optional: Make the red slightly darker on hover */
  filter: brightness(0.85);
}



.input-card-body {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1.5rem;
  padding: 0.75rem 1rem 0.25rem;
}

section {
  margin-bottom: 0;
}

.input-card-preview {
  flex-basis: 60%;
  border-right: 1px solid var(--color-border);
  padding-right: 1.5rem;
}

.preview-title {
  display: block;
  font-size: 0.8em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  margin-left: -1rem
}

.input-card-details {
  flex-basis: 40%;
  font-size: 0.9em;
}

.input-card-details dl div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.input-card-details dt {
  color: var(--color-text-muted);
}

.input-card-details dd {
  color: var(--color-text);
  font-weight: 500;
}

.input-card-translations {
  padding: 0;
}

details {
  margin-bottom: 0;
  padding: 0 1rem;
}

article>footer {
  margin-top: 0;
}

.input-card-translations summary {
  cursor: pointer;
  color: var(--color-accent);
  font-size: 0.9em;
  padding: 0.5rem 0 0;
}

.input-card-translations dl {
  margin-top: 1rem;
  margin-bottom: 0;
  font-size: 0.85em;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

/*
 * Styles for the Document Card component
 * Uses the same custom color palette as the input-card.
 */

.document-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.document-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
}

.document-identity h2 {
  margin-bottom: 0;
  font-size: 1.5em;
  color: var(--color-text);
}

.version-badge {
  font-size: 0.8em;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-left: 0.25rem;
}

.document-actions {
  display: flex;
  gap: 0.75rem;
}

.document-card-body {
  display: grid;
  grid-template-columns: 3fr 5fr;
  /* Two equal columns */
  gap: 2rem;
  padding: 0.75rem 1.5rem;
}

.document-card-body h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
}

.document-card-body dl div {
  display: flex;
  font-size: 0.9em;
  margin-bottom: 0.5rem;
}

.document-card-body dt {
  color: var(--color-text-muted);
  width: 40px;
  /* Aligns the colons */
  flex-shrink: 0;
}

.document-card-body dd {
  color: var(--color-text);
  font-weight: 500;
}

.document-card-footer {
  padding: 0.75rem 1.5rem;
  background-color: var(--color-surface-muted);
  border-top: 1px solid var(--color-border);
  text-align: right;
  font-size: 0.9em;
}

/*
 * Styles for the responsive document list table
 */
.documents-list-container {
  overflow-x: auto;
  /* Allows table to scroll on very small screens */
}

/* Add some vertical spacing between table rows */
table tbody tr {
  border-bottom: 1px solid var(--color-border);
}

table td,
table th {
  vertical-align: middle;
  /* Aligns content in the middle of the cell */
}

/* Styles for the action groups in the table */
.action-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Space between elements in a group */
}

.copy-link-group input[type="text"] {
  margin-bottom: 0;
  /* Pico adds margin, we remove it here */
  width: 120px;
  padding: 2px 8px;
}

/* Ensure all buttons and links in the action groups have a consistent size */
.action-group button,
.action-group a.button,
.action-group .button_to button {
  margin-bottom: 0;
  white-space: nowrap;
  /* Prevents text from wrapping */
}

.question-battery {
  margin-top: 2rem;
}

/* Styles for the question battery */
.question-battery-table {
  /* Wichtig: table-layout: fixed benötigt eine definierte Gesamtbreite. */
  width: 100%;
  table-layout: fixed;

  /* Sorgt für saubere Abstände und verhindert doppelte Ränder */
  border-collapse: collapse;
}

/* Die erste Spalte (mit der Frage) bekommt mehr Platz. */
.question-battery-table th:first-child {
  width: 30%;
  /* z.B. 40% der Gesamtbreite */
  text-align: left;
}

/* Alle anderen Header-Zellen (die Antwort-Optionen) werden zentriert. */
.question-battery-table thead th {
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}

/* Die Daten-Zellen (mit den Radio-Buttons) werden ebenfalls zentriert. */
.question-battery-table td {
  /* text-align: center; */
  padding-left: 0;
  padding-right: 0;
  /* Die restlichen 60% werden gleichmäßig auf die verbleibenden Spalten aufgeteilt. */
  /* Bei 3 Optionen also je 20%. Das muss nicht explizit gesetzt werden. */
}

.radio-center {
  display: inline-block;
  text-align: center;
  width: 100%;
}
.radio-center label {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}


.question-battery-table input[type="radio"] {
  vertical-align: middle;
  margin-inline-end: 0;
}

.question-battery-table td label {
  width: 100%;
}

#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #fff;
  border-top: 1px solid #ddd;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
  opacity: 0;
  transition: opacity 0.4s ease;
}
#cookie-banner.is-connected {
  opacity: 1;
}