body {
  min-height: 100vh;
  overflow-x: hidden;
}

body.uk-padding {
  padding-top: 56px;
}

.index-page {
  padding-top: 56px;
}

.sortable-list li,
.terms li,
.dropzone,
.mc-option {
  cursor: grab;
  background: #f3f7fa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  font-size: 1rem;
}

.mc-option {
  display: block;
}

.mc-option input {
  transform: scale(1.2);
  margin-right: 8px;
}

.sortable-list li:focus {
  outline: 2px solid #39f;
}

.dropzone {
  min-height: 3.5em;
  background: #f3f7fa;
  border: 1.5px dashed #aaa;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  white-space: normal;
}

.dropzone.over {
  border-color: #39f;
  background: #e0f7fa;
}

.dropzone:focus {
  border-color: #39f;
  outline: none;
}

.question {
  animation: fadeIn 0.3s ease;
  margin-top: 1em;
}

#results-slideshow {
  position: relative;
  min-height: 2.5em;
}

.result-slide {
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  z-index: 1000;
  box-sizing: border-box;
}

.theme-switch {
  display: inline-block;
  margin-left: 8px;
  margin-top: 0;
}

.theme-switch button {
  border: none;
  background: transparent;
}

.contrast-switch {
  display: inline-block;
  margin-left: 8px;
  margin-top: 0;
}

.contrast-switch button {
  border: none;
  background: transparent;
}

.topbar .uk-navbar-item {
  margin: 0;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  display: flex;
  align-items: center;
}
.topbar .uk-navbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}
.topbar .uk-navbar-center .uk-navbar-item {
  width: 100%;
  justify-content: center;
}

.nav-placeholder {
  height: 56px;
}

.event-header-bar {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 0.25rem 0.5rem;
  line-height: 1.2;
}

.bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottombar .uk-navbar-item {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  display: flex;
  align-items: center;
}

/* Footer item alignment */
.bottombar .uk-navbar-item > a {
  min-height: 38px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
}

/* Footer link height */
.bottombar .uk-navbar-nav > li > a {
  min-height: 38px;
  padding-top: 0;
  padding-bottom: 0;
}

.footer-placeholder {
  height: calc(38px + env(safe-area-inset-bottom));
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Link-Größe an Fließtext anpassen */
a.uk-accordion-title {
  font-size: 1rem;
}

@media (min-width: 640px) {
  .sortable-list li,
  .terms li,
  .dropzone,
  .mc-option {
    font-size: 1.3rem;
  }
}

@media (min-width: 960px) {
  .sortable-list li,
  .terms li,
  .dropzone,
  .mc-option {
    font-size: 1.5rem;
  }
  .mc-option input {
    transform: scale(1.3);
  }
}

@media (max-width: 639px) {
  .uk-container,
  body.uk-padding {
    padding-left: 8px;
    padding-right: 8px;
  }
  .legal-container {
    padding-left: 8px;
    padding-right: 8px;
  }
  .bottombar .uk-navbar-nav > li > a {
    min-height: 38px;
  }
  .bottombar .uk-navbar-item > a {
    min-height: 38px;
  }
  .footer-placeholder {
    height: calc(38px + env(safe-area-inset-bottom));
  }
}

/* Fester Bedienbereich im Admin-Editor */
.sticky-actions {
  position: sticky;
  bottom: calc(56px + 1rem);
  z-index: 900;
  background: rgba(255, 255, 255, 0.95);
  padding-top: 8px;
  padding-bottom: 8px;
}

body.dark-mode .sticky-actions {
  background: rgba(0, 0, 0, 0.95);
}

/* Vorschau innerhalb der Fragekarte */
.question-preview {
  min-height: 100px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 8px;
}

/* Einheitlicher Kartenrahmen fuer Admin-Tabs */
.tab-card {
  margin-top: 16px;
}

/* Kartenlayout fuer Export- und Zusammenfassungsseiten */
.card-grid > div {
  break-inside: avoid;
}

.export-card {
  border: 1px solid #ddd;
  padding: 20px;
  text-align: center;
  page-break-inside: avoid;
  position: relative;
}

.qr-print-btn {
  position: absolute;
  top: 4px;
  right: 4px;
}
@media print {
  .topbar,
  .bottombar,
  .sticky-tabs,
  .nav-placeholder,
  #adminTabs,
  .footer-placeholder,
  .uk-footer,
  .uk-navbar-container,
  .uk-navbar,
  button,
  .uk-button,
  .uk-icon-button,
  .uk-tooltip {
    display: none !important;
  }
}

.logo-placeholder {
  width: 160px;
  height: 240px;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  max-height: 100%;
}

.logo-frame {
  width: 160px;
  height: 240px;
  border: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 8px;
  background-color: #fff;
}

.proof-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
}

.js-upload {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-letter {
  font-size: 6rem;
  font-weight: bold;
}

/* Puzzle word input and feedback button */
#cfgPuzzleWordWrap .uk-input,
#cfgPuzzleWordWrap .uk-button {
  height: 44px;
  line-height: 44px;
  box-sizing: border-box;
}

/* Stacked layout for file upload fields */
.stacked-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stacked-upload input[type="text"],
.stacked-upload button {
  width: 100%;
}

.stacked-upload button {
  margin-top: 8px;
}

/* Start buttons layout */
.login-buttons button {
  width: 100%;
}

/* Stylized info card for catalog comments */
.modern-info-card {
  border-radius: 1.5rem;
  box-shadow: 0 6px 30px rgba(0,0,0,0.08);
  border: 1.5px solid #f3f4f6;
  padding: 2rem 1.5rem;
  margin: 1.5rem auto;
  max-width: 700px;
}

@media (min-width: 960px) {
  .modern-info-card {
    max-width: 900px;
  }
}

@media (min-width: 1200px) {
  .modern-info-card {
    max-width: 1100px;
  }
}

.modern-info-card .uk-card-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #1e293b;
}

.modern-info-card p {
  font-size: 1.08rem;
  line-height: 1.8;
  color: #212529;
}

.uk-text-danger.uk-text-italic {
  color: #e54b4b !important;
  font-style: italic;
}

@media (max-width: 600px) {
  .modern-info-card {
    padding: 1.1rem 0.7rem;
    max-width: 98vw;
  }
}

/* Wrapper for thumbnails with rotate button */
.photo-wrapper {
  position: relative;
  display: inline-block;
}

.lightbox-rotate-btn {
  position: absolute;
  right: 40px;
  bottom: 15px;
  z-index: 1100;
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
}

.lightbox-rotate-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
}

/* Flip card for "Hätten Sie es gewusst?" */
.flip-card { perspective: 800px; position: relative; }
.flip-card-inner { position: relative; width: 100%; min-height: 150px; transition: transform 0.6s; transform-style: preserve-3d; }
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; border-radius: 8px; background: #fff; backface-visibility: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.flip-card-back { transform: rotateY(180deg); }

@media (max-width: 639px) {
  .topbar {
    flex-wrap: wrap;
  }
  .topbar .uk-navbar-left,
  .topbar .uk-navbar-right {
    width: 50%;
  }
  .topbar .uk-navbar-right {
    justify-content: flex-end;
  }
  .topbar .uk-navbar-center {
    order: 1;
    width: 100%;
    position: static;
    transform: none;
  }
  #adminTabs {
    display: none;
  }
  body.uk-padding,
  .index-page {
    padding-top: 112px;
  }
  .nav-placeholder {
    height: 112px;
  }
}

/* Floating action buttons */
.fab {
  position: fixed;
  bottom: calc(4rem + env(safe-area-inset-bottom));
  right: 1rem;
  width: 56px;
  height: 56px;
  line-height: 56px;
  font-size: 24px;
  z-index: 1100;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.fab-save {
  bottom: calc(8rem + env(safe-area-inset-bottom));
}

/* Hide button text on small screens */
.button-text {
  margin-left: 6px;
}
@media (max-width: 639px) {
  .button-text {
    display: none;
  }
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 22px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
.switch input:checked + .slider {
  background-color: #39f;
}
.switch input:checked + .slider:before {
  transform: translateX(18px);
}

/* Event list enhancements */
#eventsList .event-row.active-event {
  background-color: #e7f9e7;
}
#eventsList td {
  padding: 8px 4px;
}
#eventsList .row-num {
  width: 3ch;
  text-align: right;
  color: #555;
}

#eventsTable {
  width: 100%;
  max-width: 100%;
}

/* Responsive event list */
@media (max-width: 639px) {
  #eventsTable thead {
    display: none;
  }
  #eventsList,
  #eventsList tr,
  #eventsList td {
    display: block;
  }
  #eventsList tr {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
  }
  #eventsList td {
    padding: 4px 0;
  }
  #eventsList td:first-child {
    position: absolute;
    top: 4px;
    right: 4px;
    display: block;
  }
  #eventsList tr {
    position: relative;
  }
  #eventsList input[type="text"],
  #eventsList input[type="datetime-local"] {
    width: 100%;
  }
}

/* Catalog list enhancements */
#catalogList td {
  padding: 8px 4px;
}

#catalogTable {
  width: 100%;
  max-width: 100%;
}

/* Responsive catalog list */
@media (max-width: 639px) {
  #catalogTable thead {
    display: none;
  }
  #catalogList,
  #catalogList tr,
  #catalogList td {
    display: block;
  }
  #catalogList tr {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
  }
  #catalogList td {
    padding: 4px 0;
  }
  #catalogList td:first-child {
    position: absolute;
    top: 4px;
    right: 4px;
    display: block;
  }
  #catalogList tr {
    position: relative;
  }
  #catalogList input[type="text"] {
    width: 100%;
  }
}

/* Team list enhancements */
#teamsList td {
  padding: 8px 4px;
}

#teamsTable {
  width: 100%;
  max-width: 100%;
}

/* Responsive team list */
@media (max-width: 639px) {
  #teamsTable thead {
    display: none;
  }
  #teamsList,
  #teamsList tr,
  #teamsList td {
    display: block;
  }
  #teamsList tr {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
  }
  #teamsList td {
    padding: 4px 0;
  }
  #teamsList td:first-child {
    position: absolute;
    top: 4px;
    right: 4px;
    display: block;
  }
  #teamsList tr {
    position: relative;
  }
  #teamsList input[type="text"] {
    width: 100%;
  }
}

/* Page editor styles */
.page-editor {
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 10px;
  background: #fff;
}

/* Prevent huge heights from UIkit's height-viewport plugin inside the editor */
.page-editor [uk-height-viewport] {
  min-height: auto !important;
  height: auto !important;
}


