/* Das Grid-System */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  padding: 20px 0;
}

/* Die Kurs-Kachel */
.course-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border-top: 16px solid var(--accent-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.course-card:hover {
  /* transform: translateY(-5px); */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Header */
.course-header {
  padding: 0 0 12px 24px;
  position: relative;
  min-height: 65px;
}

.course-badge {
  display: inline-block;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-color);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.course-number {
  color: #888888;
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 4px;
}

.course-header h3 {
  margin: 0px 0 0 0;
  font-size: 1rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.3;
  clear: both;
}
.course-header h4 {
  margin: 5px 0 0 0;
  font-size: 0.85rem;
  font-weight: 300;
  color: #1a1a1a;
  line-height: 1.3;
  clear: both;
}
.course-header h5 {
  margin: 5px 0 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.3;
  clear: both;
}

/* Meta-Angaben (Termine, Ort etc.) */
.course-meta-2 {
  background: #f9f9f9;
  padding: 16px 24px;
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
  font-size: 0.9rem;
  color: #444444;
}

.meta-item {
  margin-bottom: 6px;
  display: grid;
  /* gap: 1rem; */
}
.meta-item:last-child {
  margin-bottom: 0;
}

.meta-item.price {
  font-size: 1rem;
  color: #000000;
}

/* Beschreibungstext */
.course-body {
  padding: 20px 24px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555555;
  flex-grow: 1;
}

/* Dozenten-Bereich */
.course-instructor {
  padding: 16px 24px;
  background: #fafafa;
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
}

.instructor-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0; /* Verhindert, dass Flexbox das Bild zusammendrückt */
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.instructor-info h4 {
  margin: 0;
  font-size: 0.9rem;
  color: #333333;
}

.instructor-info .qualifikation {
  margin: 2px 0 0 0;
  font-size: 0.8rem;
  color: #777777;
}

/* Footer & Button */
.course-footer {
  padding: 0;
  /* background: #fafafa; */
}

.course-btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--btn-color);
  color: var(--btn-text-color);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  transition:
    filter 0.2s ease,
    transform 0.1s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.course-btn:hover {
  filter: brightness(92%);
  color: var(--btn-text-color);
  text-decoration: none;
}

.course-btn:active {
  transform: scale(0.99);
}

/* Container für die Detailansicht */
.course-detail-view {
  padding: 20px 0;
}

.btn-back {
  display: inline-block;
  margin-bottom: 20px;
  color: #666;
  text-decoration: none;
  font-size: 0.95rem;
}
.btn-back:hover {
  color: #000;
}

/* Detail Header */
.course-detail-header {
  border-bottom: 7px solid var(--accent-color);
  padding-bottom: 15px;
  margin-bottom: 30px;
}
.course-detail-header .badge {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 1.5rem;
}
.course-detail-header .number {
  /* float: right; */
  background: #eee;
  padding: 3px 10px;
  font-size: 0.85rem;
  border-radius: 4px;
}
.course-detail-header h1 {
  margin: 10px 0 0 0;
  font-size: 2.2rem;
  color: #111;
}

/* Flexibles 2-Spalten Layout */
.course-detail-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}
.course-detail-main {
  flex: 1 1 600px;
}
.course-detail-sidebar {
  flex: 1 1 300px;
}

/* Struktur-Karten */
.detail-card {
  background: #fff;
  border: 1px solid #eef0f2;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}
.detail-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.25rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

/* Fakten-Box */
.detail-card.facts p {
  margin: 8px 0;
  font-size: 1.05rem;
}
.detail-card.facts .price {
  font-size: 1.2rem;
  margin-top: 15px;
  color: #000;
}

/* Dozenten-Sidebar */
.single-instructor {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}
.single-instructor:last-child {
  margin-bottom: 0;
}

.detail-instructor-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #eee;
}
.instructor-details h4 {
  margin: 0;
  font-size: 1.1rem;
}
.instructor-details .quali {
  margin: 3px 0 10px 0;
  font-size: 0.85rem;
  color: #666;
}
.instructor-contact p {
  margin: 3px 0;
  font-size: 0.9rem;
  color: #444;
}
.instructor-contact a {
  color: #0066cc;
  text-decoration: none;
}

/* Call to Action Button */
.btn-register {
  display: block;
  background: var(--btn-color);
  color: #fff;
  text-align: center;
  padding: 15px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
.btn-register:hover {
  filter: brightness(92%);
}

.course-notice {
  padding: 20px;
  background-color: #f4f6f8;
  border-left: 4px solid #777;
  border-radius: 4px;
  margin: 20px 0;
}
.course-notice p {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
}
.course-notice p:last-child {
  margin-bottom: 0;
}
.btn-back-all {
  display: inline-block;
  color: #333;
  font-weight: 600;
  text-decoration: underline;
}

.course-filter-bar {
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 15px 20px;
  border-radius: 16px;
  margin-bottom: 30px;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  /* flex: 1; Diese Zeile entfernen oder auskommentieren, damit die Breite flexibel bleibt */
  flex-shrink: 0; /* Verhindert, dass die Boxen bei Platzmangel zusammengestaucht werden */
}

.filter-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  padding: 8px 35px 8px 5px; /* Rechts etwas mehr Platz für den nativen Browser-Pfeil */
  font-size: 0.85rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background-color: #fff;
  color: #495057;
  cursor: pointer;
  transition: border-color 0.15s ease-in-out;
}

/* Das Themenbereich-Feld gezielt breiter machen */
/* Standard für alle Bildschirmgrößen (normales, gleichmäßiges Verhalten) */
.filter-group.filter-group-wide {
  flex: 1 1 auto;
}

/* Erst ab einer Bildschirmbreite von 768px (Tablet / Desktop) bekommt das Feld mehr Raum */
@media (min-width: 768px) {
  .filter-group.filter-group-wide {
    flex: 1.5 1 430px;
  }
}

.filter-group.filter-group-wide select {
  width: 100%;
}

.filter-group select:focus {
  border-color: #86b7fe;
  outline: 0;
}

.filter-actions {
  display: flex;
  align-items: center;
  height: 38px; /* Richtet den Button optisch an den Selects aus */
}

.btn-reset-filters {
  font-size: 15.2px;
  font-weight: 700;
  color: #fff;
  background-color: #ff4646;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
}
a.btn-reset-filters {
  text-decoration: none !important;
  color: #fff;
}

.btn-reset-filters:hover {
  background-color: #dc3545;
  color: #fff;
}

/* Responsive Optimierung */
@media (max-width: 576px) {
  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-actions {
    justify-content: center;
  }
}

/* Styling für das neue Textsuchfeld */
/* Das Suchfeld soll weiterhin flexibel den restlichen Platz ausfüllen */
.search-field {
  flex: 1 !important;
  min-width: 200px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper input[type="text"] {
  width: 100%;
  padding: 8px 35px 8px 12px;
  font-size: 0.85rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background-color: #fff;
  color: #495057;
}

/* Das kleine 'x' zum schnellen Löschen des Suchbegriffs */
.clear-search {
  position: absolute;
  right: 10px;
  font-size: 1.3rem;
  color: #6c757d;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
}
.clear-search:hover {
  color: #dc3545;
}

/* Suchen-Button */
.filter-submit-group {
  flex: 0 0 auto !important;
  min-width: auto !important;
  flex-direction: row;
  align-items: center;
}

.btn-filter-submit {
  background-color: #495057;
  color: #fff;
  /* border: 1px solid #495057; */
  padding: 7px 12px 10px 12px;
  font-size: 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
  height: 38px;
}

.btn-filter-submit:hover {
  background-color: #212529;
  border-color: #212529;
}

.course-counter {
  font-size: 0.95rem;
  color: #495057;
  padding: 1.5rem 0 0 0;
  display: inline-block;
  width: 100%;
  text-align: right;
}

.course-counter strong {
  color: #212529;
  font-size: 1.05rem;
}

.course-counter .filter-note {
  font-size: 0.85rem;
  color: #6c757d;
  font-style: italic;
  margin-left: 5px;
}

.btn-register {
  display: block; /* ÄNDERUNG: Nimmt wieder die volle Breite ein */
  text-align: center; /* ÄNDERUNG: Zentriert den Text innerhalb des breiten Buttons */
  padding: 15px 24px; /* OPTIONAL: Etwas mehr vertikales Padding für den "großen" Look */
  font-weight: bold;
  text-decoration: none;
  border-radius: 4px;
  transition:
    background-color 0.2s ease,
    filter 0.2s ease;

  /* Hintergrundfarbe übergeben */
  background-color: var(--btn-color, #333333);

  /* Textfarbe übergeben mit Fallback und !important */
  color: var(--btn-text-color, #ffffff) !important;
}

.btn-register:hover {
  filter: brightness(90%);
  text-decoration: none;
}
