/**
 * Distinctions CSS - Affichage élégant des distinctions et labels CHR
 * 
 * Ce fichier contient les styles pour l'affichage des distinctions
 * dans l'interface utilisateur, compatible avec les thèmes sombres et clairs.
 */

/* Variables globales */
:root {
  --distinction-default-color: #6c757d;
  --distinction-default-bg: rgba(248, 249, 250, 0.9);
  --distinction-default-border: rgba(0, 0, 0, 0.125);
  --distinction-hover-transform: translateY(-2px);
  --distinction-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --distinction-hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  --distinction-transition: all 0.2s ease-in-out;
  --distinction-border-radius: 0.375rem;
  --distinction-spacing: 0.5rem;
}

/* Support du thème sombre */
@media (prefers-color-scheme: dark) {
  :root {
    --distinction-default-bg: rgba(33, 37, 41, 0.9);
    --distinction-default-border: rgba(255, 255, 255, 0.1);
  }
}

/* Conteneur principal des badges de distinction */
.distinction-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--distinction-spacing);
  margin: 0.75rem 0;
}

/* Badge individuel */
.distinction-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  border-radius: var(--distinction-border-radius);
  border: 1px solid var(--distinction-default-border);
  background-color: var(--distinction-default-bg);
  color: var(--distinction-color, var(--distinction-default-color));
  box-shadow: var(--distinction-shadow);
  transition: var(--distinction-transition);
  min-height: 2.5rem;
  position: relative;
}

/* Effet hover des badges */
.distinction-badge:hover {
  transform: var(--distinction-hover-transform);
  box-shadow: var(--distinction-hover-shadow);
  z-index: 1;
}

/* Contenu du badge */
.distinction-badge-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tailles des badges */
.distinction-badge-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  min-height: 1.75rem;
}

.distinction-badge-lg {
  padding: 0.5rem 1rem;
  font-size: 1.1rem;
  min-height: 3rem;
}

/* Styles des icônes et logos */
.distinction-badge img.distinction-logo {
  height: 1.5rem;
  width: auto;
  object-fit: contain;
}

.distinction-badge-sm img.distinction-logo {
  height: 1rem;
}

.distinction-badge-lg img.distinction-logo {
  height: 2rem;
}

.distinction-badge i {
  font-size: 1.1em;
}

/* Valeur de la distinction (ex: nombre d'étoiles) */
.distinction-value {
  font-weight: 700;
}

.distinction-unit {
  font-size: 0.85em;
  opacity: 0.8;
}

/* Label textuel de la distinction */
.distinction-label {
  font-weight: 500;
}

/* Année d'obtention/perte */
.distinction-year {
  font-size: 0.75em;
  opacity: 0.6;
  margin-left: 0.25rem;
}

/* Groupement par catégorie */
.distinction-category {
  margin-bottom: 1rem;
}

.distinction-category-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Section Highlights (distinctions majeures) */
.distinction-highlights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.distinction-highlight-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--distinction-border-radius);
  border: 1px solid var(--distinction-default-border);
  background-color: var(--distinction-default-bg);
  box-shadow: var(--distinction-shadow);
  transition: var(--distinction-transition);
}

.distinction-highlight-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--distinction-hover-shadow);
}

.distinction-highlight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  height: 3rem;
}

.distinction-highlight-icon img {
  max-width: 100%;
  max-height: 100%;
}

.distinction-highlight-content {
  flex: 1;
}

.distinction-highlight-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.distinction-highlight-subtitle {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.distinction-highlight-description {
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Timeline des distinctions */
.distinction-timeline {
  position: relative;
  padding: 1rem 0;
}

.distinction-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.75rem;
  width: 2px;
  background-color: var(--distinction-default-border);
}

.distinction-timeline-years {
  position: relative;
}

.distinction-timeline-year {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 2.5rem;
}

.distinction-timeline-year .year-label {
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--distinction-default-bg);
  border: 2px solid var(--distinction-default-border);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--distinction-default-color);
  z-index: 1;
}

.distinction-timeline-year.has-distinctions .year-label {
  background-color: var(--distinction-color, var(--distinction-default-color));
  color: white;
}

.distinction-timeline-year .year-distinctions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

/* Table récapitulative */
.distinction-summary-table table {
  width: 100%;
  border-collapse: collapse;
}

.distinction-summary-table th,
.distinction-summary-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--distinction-default-border);
}

/* Styles spécifiques pour distinctions prestigieuses */
.distinction-badge[data-prestige="5"] {
  border-color: #FFD700;
  box-shadow: 0 4px 8px rgba(255, 215, 0, 0.15);
}

.distinction-badge[data-prestige="4"] {
  border-color: #C0C0C0;
}

/* Adaptation pour les écrans mobiles */
@media (max-width: 576px) {
  .distinction-badges {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .distinction-badge {
    width: 100%;
  }
  
  .distinction-highlight-item {
    flex-direction: column;
  }
  
  .distinction-highlight-icon {
    margin-bottom: 0.5rem;
  }
}

/* Support pour l'intégration dans les différents templates */
.distinction-badge-inline {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 0.25rem;
}

/* Mécanisme de thème explicite (light/dark) */
.distinction-theme-dark {
  --distinction-default-bg: rgba(33, 37, 41, 0.9);
  --distinction-default-border: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.distinction-theme-light {
  --distinction-default-bg: rgba(248, 249, 250, 0.9);
  --distinction-default-border: rgba(0, 0, 0, 0.125);
  color: #212529;
}

/* Styles pour afficher le nombre d'étoiles Michelin de façon élégante */
.michelin-stars {
  display: inline-flex;
  align-items: center;
}

.michelin-star {
  color: #E4002B;
  margin-right: 0.15rem;
}

/* Icônes spéciales pour les distinctions communes */
i.icon-michelin-star {
  color: #E4002B;
}

/* Gault & Millau styles */
i.icon-gm-toque {
  color: #FFCC00;
  filter: drop-shadow(0px 1px 1px rgba(0, 0, 0, 0.25));
}

.distinction-badge .icon-gm-toque + .distinction-label {
  color: #003F7D;
  font-weight: 600;
}

/* Bib Gourmand styles */
i.icon-bib-gourmand {
  color: #E4002B;
  font-size: 1.2em;
}

/* Badge Michelin officiel avec fleur/étoile */
.michelin-badge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
}

.michelin-stars-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.michelin-flower-icon {
  width: 32px;
  height: 38px;
  transition: transform 0.3s ease;
}

.distinction-badge-sm .michelin-flower-icon {
  width: 26px;
  height: 32px;
}

.distinction-badge-lg .michelin-flower-icon {
  width: 40px;
  height: 48px;
}

/* Logos des distinctions */
.distinction-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.distinction-badge-sm .distinction-logo {
  width: 24px;
  height: 24px;
}

.distinction-badge-lg .distinction-logo {
  width: 40px;
  height: 40px;
}

/* Styles spécifiques par type de distinction */
.distinction-logo-bib {
  width: 28px;
  height: 34px;
}

.distinction-logo-gm {
  /* Taille par défaut (pages publiques restaurant) */
  width: 40px;
  height: 40px;
}

/* Version réduite dans le manager (panel distinctions manager) */
.spacex-distinctions-panel .distinction-logo-gm {
  width: 28px;
  height: 28px;
}

.distinction-logo-green {
  width: 28px;
  height: 28px;
}

.distinction-logo-50best {
  width: 32px;
  height: 32px;
}

.distinction-logo-eco {
  width: 28px;
  height: 32px;
}

.michelin-text {
  font-family: 'Arial', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #E4002B;
  text-transform: uppercase;
}

.michelin-year {
  font-family: 'Arial', sans-serif;
  font-weight: 400;
  font-size: 0.65rem;
  color: #E4002B;
}

/* Style spécifique pour le badge Bib Gourmand */
.bibgourmand-badge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
}

.bib-logo-wrapper {
  margin-bottom: 0.35rem;
}

.distinction-logo-bib {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.distinction-badge-sm .distinction-logo-bib {
  width: 32px;
  height: 32px;
}

.distinction-badge-lg .distinction-logo-bib {
  width: 50px;
  height: 50px;
}

.bib-text {
  font-family: 'Arial', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #E4002B;
  text-transform: uppercase;
}

.bib-year {
  font-family: 'Arial', sans-serif;
  font-weight: 400;
  font-size: 0.65rem;
  color: #E4002B;
}

.distinction-badge:has(.bibgourmand-badge-container) {
  background: white;
  border: 1px solid #E4002B;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(228, 0, 43, 0.15);
}

.distinction-badge:has(.bibgourmand-badge-container):hover {
  box-shadow: 0 4px 12px rgba(228, 0, 43, 0.25);
}

/* Style spécifique pour le badge Gault & Millau */
.gaultmillau-badge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
}

.gm-logo-wrapper {
  margin-bottom: 0.35rem;
}

.distinction-logo-gm {
  width: 46px;
  height: 32px;
  object-fit: contain;
}

.distinction-badge-sm .distinction-logo-gm {
  width: 38px;
  height: 26px;
}

.distinction-badge-lg .distinction-logo-gm {
  width: 58px;
  height: 40px;
}

.gm-note {
  font-family: 'Arial', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #003F7D;
  margin: 0.2rem 0;
}

.gm-unit {
  font-size: 0.7rem;
  font-weight: 400;
}

.gm-toques-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.gm-toque {
  color: #FFCC00;
  font-size: 0.85rem;
  filter: drop-shadow(0px 1px 1px rgba(0, 0, 0, 0.2));
}

.distinction-badge:has(.gaultmillau-badge-container) {
  background: white;
  border: 1px solid #003F7D;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 63, 125, 0.15);
}

.distinction-badge:has(.gaultmillau-badge-container):hover {
  box-shadow: 0 4px 12px rgba(0, 63, 125, 0.25);
}

/* Style spécifique pour le badge Étoile Verte Michelin */
.greenstar-badge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
}

.greenstar-logo-wrapper {
  margin-bottom: 0.35rem;
}

.distinction-logo-green {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.distinction-badge-sm .distinction-logo-green {
  width: 28px;
  height: 28px;
}

.distinction-badge-lg .distinction-logo-green {
  width: 44px;
  height: 44px;
}

.greenstar-text {
  font-family: 'Arial', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #1D8356;
  text-transform: uppercase;
}

.greenstar-year {
  font-family: 'Arial', sans-serif;
  font-weight: 400;
  font-size: 0.65rem;
  color: #1D8356;
}

.distinction-badge:has(.greenstar-badge-container) {
  background: white;
  border: 1px solid #1D8356;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(29, 131, 86, 0.15);
}

.distinction-badge:has(.greenstar-badge-container):hover {
  box-shadow: 0 4px 12px rgba(29, 131, 86, 0.25);
}

/* Style spécifique pour le badge World's 50 Best */
.worlds50best-badge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
}

.worlds50best-logo-wrapper {
  margin-bottom: 0.35rem;
}

.distinction-logo-50best {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.distinction-badge-sm .distinction-logo-50best {
  width: 30px;
  height: 30px;
}

.distinction-badge-lg .distinction-logo-50best {
  width: 46px;
  height: 46px;
}

.worlds50best-text {
  font-family: 'Arial', sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: #000000;
  text-transform: uppercase;
}

.worlds50best-rank {
  font-family: 'Arial', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: #CF152D;
  margin-top: 0.15rem;
}

.distinction-badge:has(.worlds50best-badge-container) {
  background: white;
  border: 1px solid #CF152D;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(207, 21, 45, 0.15);
}

.distinction-badge:has(.worlds50best-badge-container):hover {
  box-shadow: 0 4px 12px rgba(207, 21, 45, 0.25);
}

/* Style spécifique pour le badge Écotable */
.ecotable-badge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
}

.ecotable-logo-wrapper {
  margin-bottom: 0.35rem;
}

.distinction-logo-eco {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.distinction-badge-sm .distinction-logo-eco {
  width: 28px;
  height: 28px;
}

.distinction-badge-lg .distinction-logo-eco {
  width: 44px;
  height: 44px;
}

.ecotable-rating {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.2rem;
}

.ecotable-leaf {
  color: #4F8A10;
  font-size: 0.85rem;
}

.ecotable-text {
  font-family: 'Arial', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: #4F8A10;
  text-transform: uppercase;
}

.distinction-badge:has(.ecotable-badge-container) {
  background: white;
  border: 1px solid #4F8A10;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(79, 138, 16, 0.15);
}

.distinction-badge:has(.ecotable-badge-container):hover {
  box-shadow: 0 4px 12px rgba(79, 138, 16, 0.25);
}

.distinction-badge:hover .michelin-flower-icon {
  transform: scale(1.1);
}

/* Animation séquentielle pour les étoiles multiples */
.distinction-badge:hover .michelin-flower-icon:nth-child(2) {
  transition-delay: 0.05s;
}

.distinction-badge:hover .michelin-flower-icon:nth-child(3) {
  transition-delay: 0.1s;
}

/* Style spécifique pour le badge Michelin */
.distinction-badge:has(.michelin-badge-container) {
  background: white;
  border: 1px solid #E4002B;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(228, 0, 43, 0.15);
}

.distinction-badge:has(.michelin-badge-container):hover {
  box-shadow: 0 4px 12px rgba(228, 0, 43, 0.25);
}
