/**
 * Frontend Stylesheet für TANZ-EVENT-MANAGER (Isoliert & Gekapselt)
 */

/* 1. Filter-Bar Styles */
.tem-filter-bar {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  border: 1px solid #e5e5e5;
}
.tem-filter-form-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
.tem-filter-field {
  flex: 1;
  min-width: 200px;
}
.tem-filter-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 14px;
}
.tem-filter-field select,
.tem-filter-field input[type="date"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  box-sizing: border-box;
  height: 42px;
}

/* 2. Responsive Grid-Kartenlayout */
.tem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}
.tem-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.tem-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}
.tem-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #eee;
}
.tem-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.tem-card:hover .tem-card-image img {
  transform: scale(1.04);
}
.tem-placeholder-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff7b00 0%, #e63946 100%);
  color: #fff;
  font-weight: bold;
}
.tem-card-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.tem-card-title {
  font-size: 20px;
  margin: 0 0 12px 0;
  color: #222;
  font-weight: 700;
}
.tem-card-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 15px;
}
.tem-card-meta-box {
  margin-top: auto;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  font-size: 13.5px;
}
.tem-badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: bold;
  border-radius: 3px;
  background: #e63946;
  color: #fff;
  margin-bottom: 12px;
  align-self: flex-start;
  text-transform: uppercase;
}
.tem-meta-info {
  margin: 4px 0;
  color: #444;
}
.tem-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: #222;
  color: #fff !important;
  padding: 12px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s;
  box-sizing: border-box;
}
.tem-btn:hover {
  background: #e63946;
}

/* 3. Single View Styles (Kapselung gegen Divi-Hauptmenü-Konflikte) */
.tem-single-meta-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #eaeaea;
  margin-bottom: 30px;
}
.tem-meta-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tem-meta-bar-item .dashicons {
  font-size: 30px;
  width: 30px;
  height: 30px;
  color: #e63946;
}
.tem-meta-bar-item strong {
  display: block;
  font-size: 12px;
  color: #777;
  text-transform: uppercase;
}
.tem-meta-bar-item span {
  font-size: 16px;
  font-weight: bold;
  color: #222;
}
.tem-single-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}
@media (max-width: 768px) {
  .tem-single-grid {
    grid-template-columns: 1fr;
  }
}
.tem-single-hero-image {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.tem-single-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}
.tem-single-title {
  font-size: 36px;
  margin: 0 0 20px 0;
  color: #111;
}
.tem-single-content {
  font-size: 16px;
  line-height: 1.7;
  color: #333;
  margin-bottom: 35px;
}
.tem-single-details-box {
  background: #f1f5f9;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 40px;
}
.tem-single-details-box h3 {
  margin-top: 0;
  margin-bottom: 15px;
}
.tem-detail-row {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 15px;
}
.tem-maps-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0284c7;
  color: #fff !important;
  padding: 10px 18px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  transition: background 0.2s;
}
.tem-maps-btn:hover {
  background: #0369a1;
}

/* 4. Anfragebox / Formular */
.tem-anfrage-box {
  background: #fff;
  padding: 25px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 20px;
}
.tem-form-group {
  margin-bottom: 15px;
}
.tem-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 14px;
}
.tem-anfrage-box input[type="text"],
.tem-anfrage-box input[type="email"],
.tem-anfrage-box input[type="number"],
.tem-anfrage-box textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-sizing: border-box;
}
.tem-captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tem-msg {
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 15px;
  display: none;
  font-size: 14px;
}
.tem-msg-success {
  background: #dcfce7;
  color: #15803d;
}
.tem-msg-error {
  background: #fee2e2;
  color: #b91c1c;
}

/* 5. Kalender - Streng limitiert auf das Plugin-Umfeld */
.tem-calendar-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}
.tem-calendar-table th {
  background: #222;
  color: #fff;
  padding: 12px;
  text-align: left;
}
.tem-calendar-table td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
}
.tem-calendar-table tr:hover {
  background: #f8f9fa;
}

/* Optimierungen für Button und Badges */
.tem-filter-bar button[type="button"] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 12px !important;
  font-size: 13px !important;
}
.tem-card-body .tem-badge {
  background-color: #34495e !important;
  color: #ffffff !important;
  border: 1px solid #2c3e50;
  text-transform: uppercase;
  font-size: 11px !important;
  letter-spacing: 0.5px;
}
/* ==========================================================================
   VISUELLE TRENNUNG: EINGABEFELDER OBEN - FARBIGE BUTTONS UNTEN
   ========================================================================== */
.tem-filter-form-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

/* Reihe 1: Die Suchfelder nutzen die volle Breite */
.tem-filter-field {
  flex: 1;
  min-width: 200px;
}

/* Reihe 2: Die farbigen Buttons als eigene Funktionsebene darunter */
.tem-filter-buttons-row {
  flex: 1 0 100% !important; /* Erzwingt den Zeilenumbruch nach den Feldern */
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px !important;
  margin-top: 15px !important; /* Schöner Abstand zur oberen Suchleiste */
  padding-top: 15px;
  border-top: 1px solid #eee; /* Dezent trennende Linie zwischen Suche und Buttons */
}

/* Basis-Design für die professionellen Buttons */
.tem-filter-buttons-row .tem-btn,
.tem-filter-buttons-row a.tem-btn {
  height: 40px !important;
  line-height: 40px !important;
  padding: 0 20px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  width: auto !important; /* Verhindert übergroße Buttons */
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  text-decoration: none !important;
  border: none !important;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

/* --- DIE UNTERSCHIEDLICHEN FARBEN FÜR DIE FUNKTIONEN --- */

/* 1. Haupt-Filterbutton (z.B. Dein Theme-Grün / Standard-Grün) */
.tem-filter-buttons-row .tem-btn-submit {
  background-color: #b8d338 !important;
  color: #fff !important;
}
.tem-filter-buttons-row .tem-btn-submit:hover {
  background-color: #a3bc2f !important;
}

/* 2. "Filter löschen"-Button (Klares Warn-Rot) */
.tem-filter-buttons-row .tem-btn-reset {
  background-color: #e74c3c !important;
  color: #fff !important;
}
.tem-filter-buttons-row .tem-btn-reset:hover {
  background-color: #c0392b !important;
}

/* 3. "Laufende Kurse"-Button (Edles, unaufdringliches Dunkelblau/Anthrazit) */
.tem-filter-buttons-row #tem-toggle-laufend-btn {
  background-color: #34495e !important;
  color: #fff !important;
}
.tem-filter-buttons-row #tem-toggle-laufend-btn:hover {
  background-color: #2c3e50 !important;
}

/* Klick-Effekt für alle Buttons */
.tem-filter-buttons-row .tem-btn:active,
.tem-filter-buttons-row a.tem-btn:active {
  transform: scale(0.98);
}

/* Mobil-Sicherheit: Auf Smartphones untereinander listen */
@media (max-width: 580px) {
  .tem-filter-buttons-row .tem-btn,
  .tem-filter-buttons-row a.tem-btn {
    width: 100% !important;
  }
}
