/* Gemeinsames Grundstyling fuer alle Seiten. Sobald das Design an
   buchhaltung-akademie.de angelehnt wird, hier zentral anpassen. */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e4e4e7;
  --text: #18181b;
  --text-muted: #71717a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

input[type="file"] {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  font-size: 0.9rem;
  background: var(--surface);
}

button {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: 6px;
  padding: 12px;
  font-size: 0.85rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  text-align: left;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: #f4f4f5;
  color: var(--text-muted);
  border-top: none;
}

.muted {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.italic {
  font-style: italic;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Druckansicht: nur sichtbar, wenn tatsächlich gedruckt wird (siehe @media print) */
#print-view {
  display: none;
}

@media print {
  @page {
    size: A4;
    margin: 18mm 14mm 32mm;
  }

  html,
  body {
    background: #fff;
  }

  body {
    margin: 0;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .no-print {
    display: none !important;
  }

  #print-view {
    display: block;
    padding: 0;
  }

  #print-title {
    font-size: 14pt;
    line-height: 1.2;
    margin: 0 0 12pt;
    break-after: avoid;
    page-break-after: avoid;
  }

  #print-list {
    display: block;
  }

  .print-vocabulary {
    box-sizing: border-box;
    overflow: visible;
    width: calc(100% - 4pt);
    font-size: 8.5pt;
    line-height: 1.3;
    padding-bottom: 4mm;
  }

  .print-vocabulary-header,
  .print-vocabulary-row {
    background-image:
      linear-gradient(#cfcfcf, #cfcfcf),
      linear-gradient(#cfcfcf, #cfcfcf);
    background-position: 27% 0, 55% 0;
    background-repeat: no-repeat;
    background-size: 0.5pt 100%, 0.5pt 100%;
    box-sizing: border-box;
    display: block;
    font-size: 0;
    position: relative;
    overflow: visible;
    width: 100%;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .print-vocabulary-header::after,
  .print-vocabulary-row::after {
    content: "";
    position: absolute;
    top: -0.5pt;
    right: 0;
    bottom: -0.5pt;
    width: 0.5pt;
    background: #cfcfcf;
  }

  .print-vocabulary-header {
    background-color: #f2f2f2;
    border: 0.5pt solid #cfcfcf;
    color: #333;
    font-weight: 600;
    break-after: avoid;
    page-break-after: avoid;
  }

  .print-vocabulary-row {
    background-color: #fff;
    border: 0.5pt solid #cfcfcf;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }

  .print-vocabulary-header > div,
  .print-vocabulary-row > div {
    box-sizing: border-box;
    display: inline-block;
    font-size: 8.5pt;
    min-width: 0;
    min-height: 100%;
    overflow: visible;
    overflow-wrap: anywhere;
    padding: 5pt 6pt;
    text-align: left;
    vertical-align: top;
    word-break: normal;
    hyphens: auto;
  }

  .print-vocabulary-header > div:nth-child(1),
  .print-vocabulary-row > div:nth-child(1) {
    width: 27%;
  }

  .print-vocabulary-header > div:nth-child(2),
  .print-vocabulary-row > div:nth-child(2) {
    width: 28%;
  }

  .print-vocabulary-header > div:nth-child(3),
  .print-vocabulary-row > div:nth-child(3) {
    width: 45%;
  }

  .print-word,
  .print-details,
  .print-example-de,
  .print-example-ru {
    display: block;
  }

  .print-word {
    font-weight: 600;
  }

  .print-details,
  .print-example-ru {
    color: #666;
    font-size: 7.3pt;
  }

  .print-example-ru {
    font-style: italic;
    margin-top: 2pt;
  }
}
