/**
 * Anbieter-Detail Page CSS
 * Styles fuer /versicherungsanbieter/:slug (NEU - datengetrieben)
 * Mobile-First Design
 */

/* ===== CSS VARIABLES ===== */
:root {
  --anbieter-primary: #23cfb2;
  --anbieter-primary-dark: #1db89d;
  --anbieter-text: #2d3748;
  --anbieter-text-light: #718096;
  --anbieter-bg: #ffffff;
  --anbieter-bg-light: #f7fafc;
  --anbieter-border: #e2e8f0;
  --anbieter-radius: 12px;
  --anbieter-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --anbieter-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --anbieter-positive: #276749;
}

/* ===== FONT ALIGNMENT (match comparison-base.css) ===== */
/* Anbieter-Detail does not load comparison-base.css, so we align
   font-family + smoothing here to match Zielgruppen/Ratgeber pages */
.anbieter-detail {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== BREADCRUMBS (dunkle Variante fuer hellen Hero) ===== */
.anbieter-detail .breadcrumbs-item a {
  color: var(--anbieter-text-light);
}

.anbieter-detail .breadcrumbs-item a:hover {
  color: var(--anbieter-text);
}

.anbieter-detail .breadcrumbs-item--current span {
  color: var(--anbieter-text);
  font-weight: 500;
}

.anbieter-detail .breadcrumbs-separator {
  color: #a0aec0;
}

/* ===== HERO SECTION ===== */
.anbieter-hero-wrapper {
  background: linear-gradient(135deg, #e8faf7 0%, #f0f9ff 50%, #faf5ff 100%);
  padding: 0 16px 32px;
  margin-top: 0;
}

.anbieter-hero-container {
  max-width: 1200px;
  margin: 0 auto;
}

.anbieter-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  margin-top: 20px;
}

.anbieter-hero__logo-wrapper {
  width: 120px;
  height: 120px;
  background: var(--anbieter-bg);
  border-radius: 16px;
  box-shadow: var(--anbieter-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.anbieter-hero__logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.anbieter-hero__logo-fallback {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--anbieter-primary) 0%, var(--anbieter-primary-dark) 100%);
  color: #ffffff;
  font-size: 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.anbieter-hero__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.anbieter-hero__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--anbieter-text);
  margin: 0;
  line-height: 1.3;
}

.anbieter-hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--anbieter-text-light);
  margin: 0;
}

.anbieter-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.anbieter-hero__meta-item svg {
  color: var(--anbieter-primary);
}

.anbieter-hero__meta-item--highlight {
  color: var(--anbieter-primary-dark);
  font-weight: 600;
}

.anbieter-hero__meta-separator {
  color: var(--anbieter-border);
}

.anbieter-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--anbieter-primary);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.anbieter-hero__cta:hover {
  background: var(--anbieter-primary-dark);
  transform: translateY(-2px);
}

/* ===== HERO BADGES (base styles in anbieter-badges.css) ===== */
.anbieter-hero__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

/* Tooltip + Overlay styles now in shared anbieter-badges.css */

/* ===== PROVIDER HIGHLIGHT SECTION ===== */
.anbieter-highlight {
  background: #f8fafc;
  border-bottom: 1px solid var(--anbieter-border);
}

.anbieter-highlight__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px;
}

.anbieter-highlight__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--anbieter-text);
  margin: 0 0 14px;
}

.anbieter-highlight__body {
  overflow: hidden;
}

.anbieter-highlight__text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--anbieter-text);
  margin: 0 0 16px;
}

.anbieter-highlight__suitable {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--anbieter-border);
  border-radius: 10px;
  padding: 16px;
}

.anbieter-highlight__suitable-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  color: var(--anbieter-primary);
}

.anbieter-highlight__suitable-content {
  flex: 1;
  min-width: 0;
}

.anbieter-highlight__suitable-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--anbieter-text);
  margin-bottom: 2px;
}

.anbieter-highlight__suitable-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--anbieter-text-light);
  margin: 0;
}


/* ===== MAIN CONTAINER ===== */
.anbieter-detail-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px;
}

/* ===== SECTIONS ===== */
.anbieter-section {
  margin-bottom: 48px;
}

.anbieter-section__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--anbieter-text);
  margin: 0 0 8px;
}

.anbieter-section__subtitle {
  font-size: 15px;
  color: var(--anbieter-text-light);
  margin: 0 0 24px;
}

.anbieter-section__updated {
  font-size: 12px;
  color: #718096;
  text-align: right;
  margin: 8px 0 0;
}

/* ===== TARIFF TABLE ===== */
.tariff-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* On hover devices: allow tooltips to escape table bounds */
@media (hover: hover) and (pointer: fine) {
  .tariff-table-wrapper {
    overflow: visible;
  }
}

.tariff-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--anbieter-bg);
  border-radius: var(--anbieter-radius);
  box-shadow: var(--anbieter-shadow);
}

.tariff-table th,
.tariff-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--anbieter-border);
}

.tariff-table thead {
  background: var(--anbieter-bg-light);
}

.tariff-table__header-label {
  font-weight: 600;
  color: var(--anbieter-text-light);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tariff-table__header-tariff {
  font-weight: 700;
  color: var(--anbieter-text);
  font-size: 15px;
}

.tariff-table__label {
  font-size: 14px;
  color: var(--anbieter-text);
  white-space: nowrap;
}

/* ===== INFO-TOOLTIP (Tabellen-Labels) ===== */
.tariff-table__info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0;
  background: none;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  vertical-align: middle;
  transition: color 0.15s ease;
  font-family: inherit;
  -webkit-appearance: none;
}

.tariff-table__info:hover {
  color: var(--anbieter-primary);
}

.tariff-table__info-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 280px;
  background: #ffffff;
  color: var(--anbieter-text);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  z-index: 100;
  pointer-events: auto;
}

/* Bridge: covers gap between info icon and tooltip */
.tariff-table__info-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
}

.tariff-table__info-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #ffffff;
}

@media (hover: hover) and (pointer: fine) {
  .tariff-table__info:hover .tariff-table__info-tooltip {
    display: block;
  }
}

/* Link styling in table tooltips */
.tariff-table__info-tooltip a {
  color: #1a5276;
  text-decoration: underline;
  font-weight: 500;
}

.tariff-table__info-tooltip a:hover {
  color: #0d3b5e;
}

.tariff-table__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--anbieter-text);
  text-align: center;
}

.tariff-table__value--positive {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--anbieter-text);
}

.tariff-table__value--negative {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--anbieter-text);
}

.tariff-table__value--negative svg {
  color: #c53030;
}

.tariff-table__row--highlight {
  background: var(--anbieter-bg-light);
}

.tariff-table__label--price {
  font-weight: 600;
}

.tariff-table__value--price {
  color: var(--anbieter-primary-dark);
  font-size: 16px;
}

.tariff-table__row--actions td {
  border-bottom: none;
  padding-top: 8px;
}

.tariff-table__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--anbieter-primary);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.tariff-table__link:hover {
  color: var(--anbieter-primary-dark);
  text-decoration: underline;
}

.tariff-table__row--section td {
  background: var(--anbieter-bg-light);
  border-bottom: 1px solid var(--anbieter-border);
  padding: 10px 16px;
}

.tariff-table__label--section {
  font-size: 12px;
  font-weight: 700;
  color: var(--anbieter-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tariff-table td.tariff-table__label--sub {
  padding-left: 28px;
}

/* Zebra stripes */
.tariff-table tbody tr:nth-child(even):not(.tariff-table__row--section):not(.tariff-table__row--highlight):not(.tariff-table__row--actions) {
  background: #fafbfc;
}

/* ===== USPs ===== */
.anbieter-usps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.anbieter-usp {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--anbieter-bg);
  border: 1px solid var(--anbieter-border);
  border-radius: 8px;
}

.anbieter-usp__icon {
  flex-shrink: 0;
  color: var(--anbieter-primary);
}

.anbieter-usp__text {
  font-size: 15px;
  color: var(--anbieter-text);
  line-height: 1.5;
}

/* ===== PROVIDER INFO ===== */
.provider-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.provider-info__card {
  background: var(--anbieter-bg);
  border: 1px solid var(--anbieter-border);
  border-radius: var(--anbieter-radius);
  padding: 24px;
}

.provider-info__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--anbieter-text);
  margin: 0 0 20px;
}

.provider-info__row {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
}

.provider-info__row:last-child {
  margin-bottom: 0;
}

.provider-info__icon {
  flex-shrink: 0;
  color: var(--anbieter-text-light);
}

.provider-info__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.provider-info__label {
  font-size: 12px;
  color: var(--anbieter-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.provider-info__value {
  font-size: 14px;
  color: var(--anbieter-text);
  line-height: 1.5;
}

.provider-info__link {
  font-size: 14px;
  color: var(--anbieter-primary);
  text-decoration: none;
}

.provider-info__link:hover {
  color: var(--anbieter-primary-dark);
  text-decoration: underline;
}

.provider-info__app {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.provider-info__app-icon {
  flex-shrink: 0;
  color: var(--anbieter-text-light);
}

.provider-info__app-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.provider-info__app-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--anbieter-text);
}

.provider-info__app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.provider-info__app-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--anbieter-text);
  text-decoration: none;
  padding: 6px 12px;
  background: var(--anbieter-bg-light);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.provider-info__app-link:hover {
  background: var(--anbieter-border);
}

.provider-info__more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--anbieter-primary);
  text-decoration: none;
}

.provider-info__more-link:hover {
  color: var(--anbieter-primary-dark);
  text-decoration: underline;
}

/* ===== TABLET (768px+) ===== */
@media (min-width: 768px) {
  .anbieter-hero-wrapper {
    padding: 0 24px 48px;
  }

  .anbieter-hero {
    flex-direction: row;
    text-align: left;
    gap: 32px;
  }

  .anbieter-hero__logo-wrapper {
    width: 140px;
    height: 140px;
  }

  .anbieter-hero__content {
    align-items: flex-start;
  }

  .anbieter-hero__title {
    font-size: 32px;
  }

  .anbieter-hero__meta {
    justify-content: flex-start;
  }

  .anbieter-hero__badges {
    justify-content: flex-start;
  }

  .anbieter-highlight__container {
    padding: 36px 24px;
  }

  .anbieter-highlight__title {
    font-size: 30px;
  }

  .anbieter-highlight__suitable {
    padding: 20px 24px;
  }

  .anbieter-detail-container {
    padding: 48px 24px;
  }

  .anbieter-section__title {
    font-size: 30px;
  }

  .anbieter-usps {
    grid-template-columns: repeat(2, 1fr);
  }

  .provider-info {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
  .anbieter-hero__logo-wrapper {
    width: 160px;
    height: 160px;
  }

  .anbieter-hero__title {
    font-size: 36px;
  }

  .anbieter-section {
    margin-bottom: 64px;
  }
}
