@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-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.1rem;
  color: #c20000;
  font-weight: 600;
}

.qm-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  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-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-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,
#qm-auto-search-toggle: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: center;
  gap: 0.4rem;
}

.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.3rem 0.7rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  background: #c20000;
  color: #ffffff;
}

.qm-result-actions button:hover {
  background: #a80000;
}

/* 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-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: 600;
  background: #c20000;
  color: #ffffff;
}

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

#qm-hero-reset {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(194, 0, 0, 0.35);
  background: rgba(194, 0, 0, 0.08);
  color: #333;
  font-size: 0.8rem;
  font-family: "Open Sans", sans-serif;
}

#qm-auto-search-toggle {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(194, 0, 0, 0.35);
  background: rgba(194, 0, 0, 0.08);
  color: #333;
  font-size: 0.8rem;
  font-family: "Open Sans", sans-serif;
}

@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.3rem 0.6rem;
  font-size: 0.8rem;
  background: rgba(194, 0, 0, 0.08);
  border-color: #c20000;
  color: #333;
  border-radius: 999px;
}

#qm-mix-button:hover {
  background: rgba(194, 0, 0, 0.14);
}

#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);
}

.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;
  }
}
