@charset "UTF-8";

html,
body {
  margin: 0;
}

/* Wichtig: Live-DOM nutzt #qm-main als Wrapper (kein #qm-page). */
#qm-main {
  font-family: 'Open Sans', sans-serif !important;
}

#qm-main label,
#qm-main p,
#qm-main span,
#qm-main div {
  font-family: inherit;
}

#qm-main button,
#qm-main input,
#qm-main select,
#qm-main textarea {
  font: inherit;
  font-family: inherit;
}

#qm-main button,
.qm-panel-header {
  letter-spacing: normal;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.qm-intro {
  padding: 0 16px;
  margin-top: 32px;
  padding-bottom: 0;
}

.qm-intro .hero {
  padding-top: 0;
}

#qm-header {
  padding: 1.5rem 1.5rem 0.5rem;
  text-align: center;
}

#qm-header h1 {
  margin: 0;
  font-size: 1.3rem; /* Haupt-Headline etwas größer als Panel-Titel */
  color: #c20000;
}

#qm-subtitle {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.95rem;
  color: #555;
}

#qm-header-graphic {
  margin: 0.75rem auto 0;
  width: 220px;
  max-width: 80%;
  height: 110px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url("quizmixer_mixer.png");
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.55);
}

#qm-main {
  padding: 0 1.5rem 1.5rem;
  max-width: 1120px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.qm-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 1rem 1.25rem 1.25rem;
  margin-top: 1rem;
  border: 1px solid #e7e7e7;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

/* Wenn der Hero-Block im linken Grid-Container sitzt, soll er bündig mit der rechten Spalte starten */
#qm-left #qm-hero.qm-card {
  margin-top: 0;
}

/* Ergebnis-Card ohne zusätzlichen oberen Abstand, damit sie auf gleicher Höhe wie die Panels startet */
#qm-results-section {
  margin-top: 0;
}

#qm-results-frame {
  position: relative;
  overflow: hidden;
}

#qm-results-corner-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  opacity: 1;
  pointer-events: none;
  user-select: none;
  border-radius: 10px;
  z-index: 0;
}

#qm-results-frame.qm-has-results #qm-results-corner-image {
  opacity: 0;
}

#qm-results-list {
  position: relative;
  z-index: 1;
}

.qm-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.22rem;
  color: #c20000;
  font-weight: 600;
}

.qm-hint {
  margin: 0 0 0.75rem;
  font-size: 0.98rem;
  color: #666;
}

#qm-results-hint {
  font-weight: 400;
}

/* Rote Hervorhebung, wenn keine Quizzes gefunden wurden */
.qm-noresults {
  color: #c20000 !important;
  font-weight: 400;
}

.qm-field-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

/* Optischer Separator unterhalb des Suchbegriffs */
.qm-main-separator {
  padding-bottom: 0.7rem;   /* Linie etwas weiter nach unten */
  margin-bottom: 0.4rem;    /* Abstand zum folgenden Feld ähnlich wie zuvor */
  border-bottom: 1px solid #e7e7e7;
}

.qm-field-row label,
.qm-field-col label,
.qm-label {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.qm-field-row input[type="text"],
.qm-field-col input[type="text"],
.qm-field-row select,
.qm-field-col select {
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #d8d8d8;
  background: #ffffff;
  color: #222;
  font-size: 0.9rem;
}

.qm-field-row input[type="text"]:focus,
.qm-field-col input[type="text"]:focus,
.qm-field-row select:focus,
.qm-field-col select:focus {
  outline: none;
  border-color: #c20000;
  box-shadow: 0 0 0 1px rgba(194, 0, 0, 0.25);
}

.qm-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.qm-field-col {
  display: flex;
  flex-direction: column;
}

.qm-inline,
.qm-inline-group {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.qm-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.qm-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.qm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

#qm-hero-search,
#qm-search-button,
.qm-result-actions button {
  border: none !important;
  outline: none !important;
  border-radius: 10px !important;
  background-clip: padding-box;
  box-shadow: none !important;
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}

#qm-hero-search:focus,
#qm-search-button:focus,
.qm-result-actions button:focus,
#qm-hero-search:focus-visible,
#qm-search-button:focus-visible,
.qm-result-actions button:focus-visible {
  outline: none !important;
}

#qm-hero-search:hover,
#qm-search-button:hover,
.qm-result-actions button:hover {
  transform: translateY(-1px);
  box-shadow: none !important;
  filter: brightness(1.03);
}

#qm-hero-search:active,
#qm-search-button:active,
.qm-result-actions button:active {
  transform: translateY(0);
  box-shadow: none !important;
  filter: brightness(0.98);
}

#qm-hero-search:disabled,
#qm-search-button:disabled,
.qm-result-actions button:disabled {
  box-shadow: none !important;
  filter: none;
  transform: none;
  opacity: 0.75;
}

#qm-search-button,
#qm-reset-button {
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

#qm-search-button {
  background: #c20000;
  color: #ffffff;
  font-weight: 600;
}

#qm-search-button:hover {
  background: #a80000;
}

.qm-secondary {
  background: transparent;
  color: #333;
  border: 1px solid #d0d0d0;
  cursor: pointer;
  border-radius: 999px;
}

#qm-auto-search-toggle,
#qm-hero-reset {
  font-size: 0.78rem !important;
  padding: 0 0.6rem !important;
  border-radius: 10px !important;
  height: 40px !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.qm-secondary:disabled {
  cursor: default;
  opacity: 0.55;
}

.qm-secondary:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Für die kleinen Hero-Buttons ist der Default-Hover zu subtil (weil sie schon eine Rot-Tönung haben) */
#qm-hero-reset:hover {
  background: rgba(194, 0, 0, 0.14);
}

#qm-results-list {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#qm-results-frame {
  margin-top: 0.75rem;
  border-radius: 10px;
  border: 1px solid #e7e7e7;
  background: #ffffff;
  padding: 0.75rem;
  overflow-y: auto;
  flex: 0 0 auto;
  height: 525px;
}

.qm-result-item {
  padding: 0.6rem 0.7rem;
  border-radius: 4px;
  background: #fafafa;
  border: 1px solid #e7e7e7;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.qm-result-header {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.qm-result-header .qm-select-checkbox {
  margin-top: 5px;
}

.qm-result-title {
  font-size: 0.95rem;
  font-weight: 400;
}

.qm-result-meta {
  font-size: 0.8rem;
  color: #666;
}

.qm-result-actions {
  margin-top: 0.3rem;
}

.qm-result-actions button {
  padding: 0.35rem 0.6rem !important;
  border-radius: 10px !important;
  border: none !important;
  cursor: pointer;
  font-size: 0.78rem !important;
  background: #c20000 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  box-shadow: none !important;
}

.qm-result-actions button:hover {
  background: #a80000 !important;
  color: #ffffff !important;
}

/* Hero-Bereich */
#qm-hero {
  margin-top: 0.75rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

#qm-hero-text-block {
  max-width: 960px;
  margin: 0 auto;
}

.qm-hero-h2 {
  margin: 0 0 0.5rem;
  text-align: center;
}

.qm-hero-actions {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.qm-hero-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

#qm-hero-search {
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800 !important;
  background: #c20000;
  color: #ffffff;
}

#qm-hero-search:hover {
  background: #a80000;
}

#qm-hero-reset,
#qm-auto-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.75);
  font-family: inherit;
}

#qm-auto-search-toggle {
  min-width: 138px;
  text-align: center;
}

#qm-hero-reset:hover {
  border-color: rgba(194, 0, 0, 0.35);
  background: rgba(194, 0, 0, 0.14);
  color: #c20000;
}

#qm-auto-search-toggle.qm-on {
  border-color: rgba(0, 0, 0, 0.25) !important;
  background: #E4FFD9 !important;
}

@keyframes qm-attention-pulse {
  0% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    background: #c20000;
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    background: #a80000;
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    background: #c20000;
  }
}

#qm-hero-search.qm-attention {
  animation: qm-attention-pulse 900ms ease-in-out infinite;
}

.qm-hero-actions-row-secondary {
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

/* MIX-Info-Zeile unter der Ergebnis-Überschrift */
#qm-mix-info {
  font-size: 0.85rem; /* wie .qm-hint / Ergebnishinweis */
}

/* MIX-Button optisch wie kleiner Sekundär-Button */
#qm-mix-button {
  padding: 0.35rem 0.6rem !important;
  font-size: 0.78rem !important;
  border-radius: 10px !important;
  border: none !important;
  background: #c20000 !important;
  color: #ffffff !important;
  font-family: inherit !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

#qm-mix-button:hover {
  background: #a80000 !important;
  color: #ffffff !important;
}

#qm-mix-button:disabled {
  background: #f1f1f1;
  border-color: #d0d0d0;
  color: #8a8a8a;
  opacity: 1;
}

#qm-mix-button:disabled:hover {
  background: #f1f1f1;
}

/* Zwei-Spalten-Layout */
#qm-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  align-items: stretch;
}

#qm-left {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#qm-right {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#qm-results-section {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Panels (Akkordeon) */
.qm-panel {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e7e7e7;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.qm-panel-header {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: none;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.95rem;
}

.qm-panel-title {
  font-family: "Open Sans", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: normal;
  letter-spacing: normal;
  text-rendering: auto;
  -webkit-font-smoothing: auto;
  color: #c20000;
}

.qm-panel-toggle-indicator {
  font-size: 1rem;
  opacity: 0.8;
}

.qm-panel-body {
  padding: 0 0.9rem 0.9rem;
  display: none;
}

.qm-panel.open .qm-panel-body {
  display: block;
}

.qm-panel.open .qm-panel-toggle-indicator {
  transform: rotate(45deg);
}

/* Echter Tooltip für Features die noch nicht belegt sind */
#qm-panel-special .qm-panel-header {
  position: relative;
}

#qm-panel-special .qm-panel-header[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 9999;
}

#qm-panel-special .qm-panel-header[data-tooltip]::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 6px 6px 0;
  border-style: solid;
  border-color: transparent rgba(0, 0, 0, 0.88) transparent transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 9999;
}

#qm-panel-special .qm-panel-header:hover::after,
#qm-panel-special .qm-panel-header:hover::before {
  opacity: 1;
}

/* JS-Tooltip (zentriert über Cursor/Finger) */
#qm-hover-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 999999;
}

#qm-hover-tooltip.qm-show {
  opacity: 1;
}

/* CSS-Pseudo-Tooltip deaktivieren (JS übernimmt) */
#qm-panel-special .qm-panel-header[data-tooltip]::after,
#qm-panel-special .qm-panel-header[data-tooltip]::before {
  display: none;
}

.qm-subsection {
  margin-top: 1rem;
}

.qm-subsection > h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.qm-checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 0.4rem;
}

/* Spezial-Filter zweispaltig: links Fachbereiche, rechts Fächer-Mix */
/* Grundzustand: .qm-panel-body bleibt display:none; bei offenem Panel als Grid anzeigen */
#qm-panel-special.open .qm-panel-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

#qm-panel-special h3 {
  font-size: 1.0rem; /* wie 'Gefundene Quizzes' */
  color: #333;
  margin: 0 0 0.5rem;
}

/* Abstand des 3. Spezial-Filter-Panels nach oben etwas verringern */
#qm-panel-special {
  margin-top: 0;
}

#qm-footer {
  margin-top: auto;
  padding: 0.75rem 1.5rem;
  font-size: 0.75rem;
  color: #a0a0a0;
}

@media (max-width: 768px) {
  #qm-main {
    padding: 0 0.75rem 1rem;
  }

  .qm-card {
    padding: 0.85rem 0.9rem 1rem;
  }

  .qm-checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #qm-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  #qm-results-frame {
    height: auto;
  }
}
