/* ============================================================
   teacher-catalog-card.css — Kompakte Lehrerkarte (tc-* Prefix)
   Kontext: catalog-teachers.html
   Tokens: premium-design-tokens.css → combined-all.css

   FARB-STRATEGIE:
   Die App nutzt Bootstrap-Neutrals (--neutral-500: #adb5bd),
   das genehmigte Mockup nutzt Tailwind-Neutrals (#6b7280).
   Alle Farben sind daher als Hex-Literale gesetzt (wie profile-overlay.css),
   damit sie exakt dem Mockup entsprechen.
   Ausnahmen: var(--color-900), var(--brand-orange*), var(--danger-*) —
   diese stimmen in App und Mockup überein.

   SPEZIFITÄTS-STRATEGIE:
   Konflikt: combined-all.css .card-actions-vertical (0,1,0)
             + catalog-teachers.css .teacher-card-optimized (0,1,0)
   Fix: .teacher-card-optimized.tc-card = (0,2,0), .tc-card .tc-actions .btn = (0,3,0)
   ============================================================ */

/* ── Karte ───────────────────────────────────────────────────── */
.teacher-card-optimized.tc-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 4px 16px 4px 4px;          /* 4px oben/unten/links, 16px rechts */
  background: #ffffff;
  border: 3px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(6,15,28,0.08);
  cursor: pointer;
  overflow: visible;                   /* override: teacher-card-optimized { overflow:hidden } */
  margin-bottom: 12px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  text-decoration: none;
  color: inherit;
}

@media (hover: hover) and (pointer: fine) {
  .teacher-card-optimized.tc-card:not(.teacher-card-blocked):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(6,15,28,0.10);
    border-color: #93b8f0;
  }
}

/* Admin-Hervorhebung ("push"): goldener Rahmen + sanfter Glow. */
.teacher-card-optimized.tc-card--highlight {
  border-color: #e0a800;
  box-shadow: 0 0 0 2px #ffe6a8, 0 1px 3px rgba(6,15,28,0.08);
}

/* Verifiziert-Häkchen (Berufserfahrung – Nachweis geprüft). */
.tc-verified { color: #047857; font-weight: 700; }

.teacher-card-optimized.tc-card.is-open {
  border-color: #5b8de0;
  box-shadow: 0 0 0 2px #c9dcf7;
}

.teacher-card-optimized.tc-card.card-removing {
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 200ms ease, transform 200ms ease;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.tc-card .tc-avatar {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  margin: 0;                           /* Abstand kommt vom Card-Padding (4px) */
  border-radius: 4px;
  overflow: hidden;
  background: #e5e7eb;
}

.tc-card .tc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tc-card .tc-avatar__initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  color: #090909;
  background: #e5e7eb;
}

/* Video-Badge */
.tc-card .tc-avatar__badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: #060f1c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  pointer-events: none;
}

.tc-card .tc-avatar__badge svg {
  width: 10px;
  height: 10px;
  fill: #ffffff;
  display: block;
}

/* ── Inhalt ──────────────────────────────────────────────────── */
.tc-card .tc-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}


/* Zeile 1: Name + Preis */
.tc-card .tc-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.tc-card .tc-name {
  font-size: 16px;
  font-weight: 600;
  color: #060f1c;           /* --color-900 — stimmt in App und Mockup überein */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.tc-card .tc-price {
  font-size: 16px;
  font-weight: 600;
  color: #111827;           /* Mockup: --neutral-900 = #111827 */
  white-space: nowrap;
  flex-shrink: 0;
}

/* Blockiert-Badge */
.tc-card .tc-blocked-badge {
  font-size: 11px;
  font-weight: 600;
  color: #b91c1c;           /* --danger-text — stimmt überein */
  margin-left: 6px;
}

/* Zeile 2: Sprachen */
.tc-card .tc-row-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #090909;           /* Mockup: --text-secondary = #6b7280 */
  min-width: 0;
  overflow: hidden;
}

.tc-card .tc-row-sub .tc-sep {
  color: #d1d5db;
  flex-shrink: 0;
}

/* Zeile 3: Meta-Icons */
.tc-card .tc-row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tc-card .tc-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #090909;           /* Mockup: --text-secondary = #6b7280 */
  white-space: nowrap;
}

.tc-card .tc-meta-item svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

.tc-card .tc-meta-item--new {
  font-size: 12px;
  color: #9ca3af;           /* Mockup: --text-muted */
  font-style: italic;
}

/* Bio */
.tc-card .tc-bio {
  font-size: 14px;
  color: #090909;           /* Mockup: --neutral-700 = #374151 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Zeile 4: Chips + Aktionen */
.tc-card .tc-row-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* ── Chips ───────────────────────────────────────────────────── */
.tc-card .tc-chips {
  flex: 1;
  display: flex;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
}

.tc-card .tc-chip {
  padding: 3px 10px;
  border: 1px solid #2451a3; /* Mockup: --color-primary = #2451a3 (NICHT app-orange!) */
  border-radius: 9999px;
  background: #f4f8fe;       /* Mockup: --color-50 */
  color: #1a3a6e;            /* Mockup: --color-primary-dark = #1a3a6e */
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.tc-card .tc-chip--trial {
  background: #fefce8;
  border-color: #ca8a04;
  color: #92400e;
}

/* ══════════════════════════════════════════════════════════════
   AKTIONS-BEREICH — Proxy-Styling für existierende Buttons

   Konflikt: combined-all.css .card-actions-vertical (0,1,0):
     flex-direction:column; border-left:1px solid; padding-left:12px; min-width:120px
   Fix: .tc-card .tc-actions = (0,2,0) überschreibt alles aus combined-all.css
   ══════════════════════════════════════════════════════════════ */

/* Reset .card-actions-vertical */
.tc-card .tc-actions {
  display: flex;
  flex-direction: row;        /* override: column */
  align-items: center;        /* override: flex-end */
  gap: 8px;
  flex-shrink: 0;
  padding: 0;                 /* override: padding-left: 12px */
  border: none;               /* override: border-left: 1px solid */
  border-left: none;
  min-width: 0;               /* override: min-width: 120px */
}

/* Alle Buttons auf Icon-Button-Basis setzen — (0,3,0) schlägt combined-all (0,2,0) */
.tc-card .tc-actions .favorites-btn,
.tc-card .tc-actions .accept-btn,
.tc-card .tc-actions .contact-btn,
.tc-card .tc-actions .calendar-cta-btn,
.tc-card .tc-actions .hide-teacher-btn,
.tc-card .tc-actions .flag-teacher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: none;            /* override: max-width: 120px */
  padding: 0;
  border: 1px solid #d1d5db; /* Mockup: --neutral-300 */
  border-radius: 6px;
  background: #ffffff;
  color: #090909;             /* Mockup: --text-secondary */
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  box-shadow: none;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

/* btn-label verstecken — (0,3,0) */
.tc-card .tc-actions .favorites-btn .btn-label,
.tc-card .tc-actions .accept-btn    .btn-label,
.tc-card .tc-actions .contact-btn   .btn-label,
.tc-card .tc-actions .hide-teacher-btn .btn-label,
.tc-card .tc-actions .flag-teacher-btn .btn-label {
  display: none;
}
/* calendar-cta-btn label bleibt sichtbar — primäre CTA */
.tc-card .tc-actions .calendar-cta-btn .btn-label {
  display: inline;
}

/* btn-icon zentrieren */
.tc-card .tc-actions .btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 0;
}

/* SVG-Größe */
.tc-card .tc-actions .btn-icon svg,
.tc-card .tc-actions .favorites-btn svg,
.tc-card .tc-actions .contact-btn svg,
.tc-card .tc-actions .hide-teacher-btn svg,
.tc-card .tc-actions .flag-teacher-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ── Accept-Button: primäre CTA ─────────────────────────────── */
.tc-card .tc-actions .accept-btn {
  width: auto;
  min-width: auto;
  padding: 8px 16px;
  gap: 6px;
  background: #469ea0;       /* var(--brand-orange) — stimmt überein */
  color: #ffffff;
  border: none;
  border-radius: 6px;
}

/* btn-label im accept-btn einblenden — (0,4,0) */
.tc-card .tc-actions .accept-btn .btn-label {
  display: inline;
}

@media (hover: hover) and (pointer: fine) {
  .tc-card .tc-actions .accept-btn:hover:not(:disabled) {
    background: #50adaf;     /* var(--brand-orange-active) */
  }
}

.tc-card .tc-actions .accept-btn:focus-visible {
  outline: 2px solid rgba(70, 158, 160, 0.85);
  outline-offset: 2px;
}

.tc-card .tc-actions .accept-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tc-card .tc-actions .accept-btn.waiting {
  background: #6b7280;
  border: none;
  color: #ffffff;
}

.tc-card .tc-actions .accept-btn.received {
  background: #C06020;
  border: none;
  color: #ffffff;
}

.tc-card .tc-actions .accept-btn.mutual {
  background: #16a34a;       /* Mockup: --color-success = #16a34a */
  border: none;
  color: #ffffff;
}

@media (hover: hover) and (pointer: fine) {
  .tc-card .tc-actions .accept-btn.mutual:hover:not(:disabled) {
    background: #15803d;
  }
}

/* ── Hover für Icon-Buttons ──────────────────────────────────── */
@media (hover: hover) and (pointer: fine) {
  .tc-card .tc-actions .favorites-btn:hover {
    color: #e11d48;
    border-color: rgba(225,29,72,0.30);
    background: #f9fafb;
  }

  .tc-card .tc-actions .contact-btn:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #9ca3af;
  }

  .tc-card .tc-actions .hide-teacher-btn:hover {
    background: #f3f4f6;
    color: #111827;
  }

  .tc-card .tc-actions .flag-teacher-btn:hover {
    color: #b91c1c;
    background: #fee2e2;
    border-color: rgba(185,28,28,0.30);
  }
}

/* Favorit aktiv */
.tc-card .tc-actions .favorites-btn.favorited {
  color: #e11d48;
  border-color: rgba(225,29,72,0.40);
  background: #fff0f3;
}

.tc-card .tc-actions .favorites-btn.favorited .btn-icon svg {
  fill: #e11d48;
}

/* Flag blockiert */
.tc-card .tc-actions .flag-teacher-btn.flag-teacher-btn--blocked {
  color: #b91c1c;
  background: #fee2e2;
  border-color: rgba(185,28,28,0.40);
}

/* Thumbs-Button ausblenden — im Overlay */
.tc-card .tc-actions .thumbs-up-btn {
  display: none !important;
}

/* Focus-Ring */
.tc-card .tc-actions button:focus-visible {
  outline: 2px solid #3068c8;
  outline-offset: 2px;
}

/* ── Card-Liste: max-width + Zentrierung (Mockup: .card-list { max-width: 780px }) ── */
#teacher-list {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Video-Preview Panel (erscheint rechts, gleitet von oben rein) ── */
.teacher-card-optimized.tc-card {
  position: relative;                  /* Anker für absolut positioniertes Preview */
}

.tc-card .tc-video-preview {
  position: absolute;
  left: calc(100% + 10px);            /* 10px Abstand rechts von der Karte */
  top: 50%;
  transform: translateY(calc(-50% - 24px));  /* Start: 24px über der Mitte */
  opacity: 0;
  pointer-events: none;
  width: 200px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: visible;                   /* MUSS visible sein, damit ::before-Brücke nicht geclippt wird */
  background: transparent;
  box-shadow: none;
  z-index: 200;
  transition: transform 220ms ease, opacity 220ms ease;
}

/* Innerer Container trägt Clip, Hintergrund und Shadow */
.tc-card .tc-video-preview__inner {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #111827;
  box-shadow: 0 8px 28px rgba(6,15,28,0.22);
  position: relative;
}

/* Unsichtbare Brücke: überbrückt den 10px-Spalt zwischen Karte und Preview,
   damit mouseleave nicht feuert wenn die Maus vom Panel zum Video gleitet */
.tc-card .tc-video-preview::before {
  content: '';
  position: absolute;
  top: -40px;
  bottom: -40px;
  right: 100%;
  width: 14px;                         /* > 10px Spalt */
}

@media (hover: hover) and (pointer: fine) {
  .tc-card:not(.teacher-card-blocked):hover .tc-video-preview {
    transform: translateY(-50%);       /* Ziel: vertikal zentriert */
    opacity: 1;
    pointer-events: auto;
  }
}

.tc-card .tc-video-preview__inner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tc-card .tc-video-preview__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
  pointer-events: none;
}

/* Auf Mobilgeräten kein Hover-Preview */
@media (max-width: 600px) {
  .tc-card .tc-video-preview {
    display: none;
  }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .teacher-card-optimized.tc-card {
    gap: 12px;
    padding: 4px 12px 4px 4px;
  }

  .tc-card .tc-avatar {
    width: 72px;
    height: 72px;
    margin: 0;
  }

  .tc-card .tc-avatar__initials {
    font-size: 18px;
  }

  .tc-card .tc-name,
  .tc-card .tc-price {
    font-size: 15px;
  }

  .tc-card .tc-bio {
    display: none;
  }

  .tc-card .tc-actions .accept-btn {
    padding: 8px 10px;
    font-size: 12px;
  }
  .tc-card .tc-actions .calendar-cta-btn {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* ── Calendar-CTA-Button: primäre CTA [5/7] ─────────────────── */
.tc-card .tc-actions .calendar-cta-btn {
  width: auto;
  min-width: auto;
  padding: 8px 16px;
  gap: 6px;
  background: #469ea0;
  color: #ffffff;
  border: none;
  border-radius: 6px;
}

@media (hover: hover) and (pointer: fine) {
  .tc-card .tc-actions .calendar-cta-btn:hover:not(:disabled) {
    background: #50adaf;
  }
}

.tc-card .tc-actions .calendar-cta-btn:focus-visible {
  outline: 2px solid rgba(70, 158, 160, 0.85);
  outline-offset: 2px;
}
