@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Montserrat:wght@500;600;700;800&family=Roboto:wght@400;500;700&display=swap');

html {
  font-size: 16px;
  width: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', Roboto, Arial, sans-serif;
  background-color: #0A1E34;
  color: #f0f4f8;
  width: 100%;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Montserrat', sans-serif;
}

.row {
  margin-right: 0 !important;
  margin-left: 0 !important;
}

/* Touch action globale sur éléments interactifs */
.btn_galaxie,
.btn-detail,
.btn_form_mail,
.btn-reset-galaxies,
.client-filter-pill {
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ========================================================
   BLOC CONTRÔLE & HÉRO GALAXIES
   ======================================================== */
#bloc_ctrl_galaxies {
  width: 100%;
  padding: 24px 30px;
  position: relative;
  z-index: 10;
}

.galaxies-hero-panel {
  background: linear-gradient(145deg, rgba(16, 36, 62, 0.9) 0%, rgba(10, 26, 46, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: 24px;
  position: relative;
  z-index: 10;
}

/* --- Barre supérieure de l'entête --- */
.hero-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.hero-title-group {
  flex: 1 1 400px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 50px;
  background: rgba(229, 37, 32, 0.15);
  border: 1px solid rgba(229, 37, 32, 0.35);
  color: #ff6b67;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.hero-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.counter-pill {
  display: inline-block;
  background: linear-gradient(135deg, #e52520 0%, #ff524d 100%);
  color: #ffffff;
  padding: 2px 14px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(229, 37, 32, 0.45);
  margin: 0 4px;
  vertical-align: middle;
}

/* --- Barre de recherche & Filtres --- */
.hero-search-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1 1 360px;
  max-width: 580px;
  justify-content: flex-end;
}

.search-input-wrapper {
  position: relative;
  flex: 1 1 260px;
  width: 100%;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.95rem;
  pointer-events: none;
  transition: color 0.25s ease;
}

.modern-search {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 50px !important;
  color: #ffffff !important;
  padding: 10px 18px 10px 42px !important;
  font-size: 0.9rem !important;
  height: 44px !important;
  transition: all 0.25s ease !important;
  width: 100% !important;
}

.modern-search::placeholder {
  color: rgba(255, 255, 255, 0.45) !important;
}

.modern-search:focus {
  background: rgba(255, 255, 255, 0.11) !important;
  border-color: #e52520 !important;
  box-shadow: 0 0 0 4px rgba(229, 37, 32, 0.22) !important;
  outline: none !important;
}

.search-input-wrapper:focus-within .search-icon {
  color: #ff6b67;
}

/* Filtres Pro/Particuliers (CRM) */
.client-type-filters {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.client-filter-pill {
  cursor: pointer;
  margin: 0;
  user-select: none;
}

.client-filter-pill .pill-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
}

.client-filter-pill:hover .pill-content {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.client-filter-pill .form-check-input:checked + .pill-content {
  background: rgba(229, 37, 32, 0.22);
  border-color: rgba(229, 37, 32, 0.6);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(229, 37, 32, 0.25);
}

/* --- En-tête de section Galaxies --- */
.galaxies-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  font-size: 1.15rem;
  color: #ff6b67;
  background: rgba(229, 37, 32, 0.15);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(229, 37, 32, 0.25);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.02em;
}

.section-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  margin: 2px 0 0;
}

.btn-reset-galaxies {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  outline: none;
}

.btn-reset-galaxies:hover {
  background: rgba(229, 37, 32, 0.25);
  border-color: #e52520;
  color: #ff8e8a;
  transform: translateY(-1px);
}

/* --- Grille des galaxies --- */
.galaxies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  width: 100%;
}

.galaxie-card {
  --color: var(--gal-color, #e52520);
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 8px 12px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 125px;
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), 
              box-shadow 0.25s ease, 
              border-color 0.25s ease, 
              background 0.25s ease, 
              opacity 0.25s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.galaxie-card * {
  pointer-events: none;
}

.galaxie-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color);
  opacity: 0.6;
  transition: opacity 0.25s ease, height 0.25s ease;
  pointer-events: none;
}

.galaxie-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--color) 25%, transparent);
  margin-bottom: 8px;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), 
              background 0.25s ease, 
              box-shadow 0.25s ease;
}

.galaxie-icon-box i {
  font-size: 1.25rem;
  color: var(--color);
  transition: transform 0.25s ease;
}

.galaxie-name {
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin: 0 0 8px !important;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-align: center;
  max-width: 100%;
  word-break: break-word;
}

.galaxie-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.galaxie-count-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--color) 35%, transparent);
  color: #ffffff;
  line-height: 1.3;
  min-width: 22px;
  text-align: center;
}

.galaxie-count-label {
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

/* Hover & Active sur la carte galaxie */
.galaxie-card:hover {
  transform: translateY(-4px);
  border-color: var(--color);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), 0 0 16px color-mix(in srgb, var(--color) 25%, transparent);
}

.galaxie-card:hover::before {
  opacity: 1;
  height: 4px;
}

.galaxie-card:hover .galaxie-icon-box {
  transform: scale(1.1);
  background: color-mix(in srgb, var(--color) 25%, transparent);
}

.galaxie-card.opac_show {
  border-color: var(--color) !important;
  background: color-mix(in srgb, var(--color) 16%, rgba(255, 255, 255, 0.05)) !important;
  box-shadow: 0 0 0 2px var(--color), 0 10px 28px color-mix(in srgb, var(--color) 35%, transparent) !important;
  transform: translateY(-3px);
  opacity: 1 !important;
}

.galaxie-card.opac_show::before {
  opacity: 1;
  height: 4px;
}

.galaxie-card.opac_show .galaxie-icon-box {
  transform: scale(1.12);
  box-shadow: 0 0 12px color-mix(in srgb, var(--color) 40%, transparent);
}

/* Media Queries Responsives */
@media screen and (max-width: 992px) {
  #bloc_ctrl_galaxies {
    padding: 16px 16px 0;
  }
  .galaxies-hero-panel {
    padding: 18px 18px;
    margin-bottom: 16px;
  }
  .hero-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 16px;
  }
  .hero-title-group {
    text-align: center;
  }
  .hero-search-group {
    max-width: 100%;
    justify-content: center;
  }
}

/* Version Mobile (tablettes étroites et smartphones) */
@media screen and (max-width: 768px) {
  #bloc_ctrl_galaxies {
    padding: 10px 10px 0 10px !important;
  }
  .galaxies-hero-panel {
    padding: 12px 14px !important;
    margin-bottom: 12px !important;
    border-radius: 14px !important;
  }
  .hero-top-bar {
    gap: 0 !important;
    margin-bottom: 10px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
  /* Masquer le gros bloc titre/badge redondant sur smartphone pour libérer tout l'espace */
  .hero-title-group {
    display: none !important;
  }
  .hero-search-group {
    max-width: 100% !important;
    width: 100% !important;
    flex: 1 1 100% !important;
    margin: 0 !important;
    gap: 8px !important;
  }
  .search-input-wrapper {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
  .search-input-wrapper .search-icon {
    left: 14px !important;
    font-size: 0.85rem !important;
  }
  .modern-search {
    height: 40px !important;
    font-size: 0.88rem !important;
    padding: 8px 14px 8px 38px !important;
    border-radius: 25px !important;
  }
  /* En-tête Explorer par galaxie compact */
  .galaxies-header-row {
    margin-bottom: 10px !important;
    gap: 8px !important;
  }
  .section-heading {
    gap: 8px !important;
  }
  .section-icon {
    font-size: 0.95rem !important;
    padding: 6px 8px !important;
    border-radius: 8px !important;
  }
  .section-title {
    font-size: 0.95rem !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  /* Masquer le sous-titre verbeux sur mobile */
  .section-subtitle {
    display: none !important;
  }
  .mobile-count-pill {
    display: inline-block !important;
    background: rgba(229, 37, 32, 0.18);
    border: 1px solid rgba(229, 37, 32, 0.35);
    color: #ff6b67;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 50px;
    line-height: 1.4;
  }
  .btn-reset-galaxies {
    padding: 5px 10px !important;
    font-size: 0.72rem !important;
  }
  .galaxies-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)) !important;
    gap: 6px !important;
  }
  .galaxie-card {
    padding: 8px 4px 6px !important;
    min-height: 98px !important;
    border-radius: 12px !important;
  }
  .galaxie-icon-box {
    width: 34px !important;
    height: 34px !important;
    margin-bottom: 4px !important;
  }
  .galaxie-icon-box i {
    font-size: 1rem !important;
  }
  .galaxie-name {
    font-size: 0.65rem !important;
    margin-bottom: 4px !important;
  }
  .galaxie-count-badge {
    font-size: 0.62rem !important;
    padding: 1px 5px !important;
  }
  .galaxie-count-label {
    display: none !important;
  }
  #lst_prestations {
    padding: 0 10px !important;
  }
}

.mobile-count-pill {
  display: none;
}

/* ========================================================
   LISTE DES PRESTATIONS & CARTES
   ======================================================== */
#lst_prestations {
  padding: 0 30px;
}

@media screen and (max-width: 576px) {
  #lst_prestations {
    padding: 0 12px;
  }
}

#lst_prestations .view { 
  height: 200px; 
}

#lst_prestations img { 
  object-fit: cover; 
  height: inherit; 
}

#lst_prestations .card {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #ffffff !important;
  color: #1e293b !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#lst_prestations .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
}

#lst_prestations .card-body {
  color: #1e293b !important;
}

#lst_prestations .card-title,
#lst_prestations .card-title b {
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a !important;
  line-height: 1.35;
  margin-bottom: 8px;
}

#lst_prestations .card-text {
  color: #475569 !important;
  font-size: 0.88rem;
  line-height: 1.5;
}

#lst_prestations hr {
  border-top: 1px solid #e2e8f0;
  margin: 12px 0;
}

#lst_prestations .btn-detail {
  color: #0f172a !important;
  text-decoration: none !important;
}

#lst_prestations .btn-detail h5 {
  color: #0f172a !important;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

#lst_prestations .btn-detail:hover h5 {
  color: #e52520 !important;
}

#lst_prestations .tab-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-top: none;
  color: #334155 !important;
}

#lst_prestations .tab-content .tab-pane {
  color: #334155 !important;
  line-height: 1.5;
  font-size: 0.85rem;
}

#lst_prestations .card-footer {
  border: 0;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

#lst_prestations .card-footer a { 
  color: white !important; 
}

.nav-tabs .nav-link {
  color: white !important;
  font-weight: 600;
}

/* Modal de contact */
.modal-content {
  color: #1e293b !important;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 0;
}

.modal-content .modal-title {
  color: #0f172a !important;
  font-weight: 700;
}

.modal-content p,
.modal-content label,
.modal-content b {
  color: #334155 !important;
}

.modal-content .form-control {
  border: 1px solid #cbd5e1;
  color: #0f172a !important;
}