/*
 * Annuaire moderne événementiel
 * Design cohérent avec clients/new et devis/new
 */

/* === VARIABLES ÉVÉNEMENTIELLES (Harmonisées avec Homepage) === */
:root {
  /* Couleurs principales harmonisées */
  --event-primary: #667eea; /* Le violet principal */
  --event-secondary: #5a6fc4; /* Un violet légèrement plus foncé pour le hover */
  --event-accent: #10b981; /* Le vert pour les succès/checkmarks */
  --event-success: #10b981; /* Utilisation du vert pour le succès */
  
  /* Gradients simplifiés ou retirés */
  --event-primary-gradient: var(--event-primary); /* Utiliser la couleur unie */
  --event-secondary-gradient: var(--event-secondary); /* Utiliser la couleur unie */
  --event-success-gradient: var(--event-success); /* Utiliser la couleur unie */
  
  /* Shadows modernes (ajustés si nécessaire) */
  --event-shadow-light: 0 4px 20px rgba(0, 0, 0, 0.05);
  --event-shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.1);
  --event-shadow-heavy: 0 12px 40px rgba(0, 0, 0, 0.15);
  
  /* Texte harmonisé */
  --event-text-primary: #1a1a1a; /* Noir pour les titres */
  --event-text-secondary: #555555; /* Gris foncé pour les textes secondaires */
  --event-text-light: #f7f7f7; /* Fond clair */
}

/* === WRAPPER MODERNE === */
.modern-annuaire-page {
  min-height: 100vh;
  background: #f7f7f7;
}

/* === HEADER ÉVÉNEMENTIEL === */
.annuaire-modern-header {
  background: #f7f7f7; /* Light background */
  padding: 3rem 0 2rem 0;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
  border-bottom: 1px solid #e5e5e5; /* Subtle border */
}

.annuaire-modern-header::before {
  display: none; /* Remove dot pattern */
}

.header-content-modern {
  position: relative;
  z-index: 2;
}

.page-title-modern {
  color: var(--event-text-primary); /* Dark color */
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: none; /* Remove text shadow */
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-start; /* Explicitly left-align flex items */
}

.page-subtitle-modern {
  color: var(--event-text-secondary); /* Darker gray */
  font-size: 1.2rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  text-align: left; /* Explicitly left-align text */
}

.header-actions-modern {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-start; /* Explicitly left-align flex items */
}

.btn-header-modern {
  background: rgba(0, 0, 0, 0.05); /* Light background */
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--event-text-secondary); /* Dark text */
  padding: 0.875rem 1.5rem;
  border-radius: 2rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-header-modern:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--event-text-primary);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.btn-header-primary {
  background: var(--event-primary); /* Solid purple */
  color: white;
  font-weight: 700;
}

.btn-header-primary:hover {
  background: var(--event-secondary); /* Darker purple on hover */
  color: white;
}

.preview-annuaire-banner {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(14, 165, 233, 0.12) 100%);
  border: 1px solid rgba(102, 126, 234, 0.25);
  border-radius: 20px;
  padding: 1.5rem 2rem;
}

.preview-annuaire-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .preview-annuaire-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* === LAYOUT MODERNE SIDEBAR + MAIN === */
.annuaire-layout-modern {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 0;
  min-height: calc(100vh - 200px);
}

.annuaire-sidebar {
  background: white;
  border-right: 1px solid #e2e8f0;
  padding: 2rem;
  position: sticky;
  top: 0;
  height: fit-content;
  max-height: 100vh;
  overflow-y: auto;
}

.annuaire-main-content {
  padding: 2rem;
  background: transparent;
}

/* === SIDEBAR MODERNE === */
.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-title {
  color: var(--event-text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-title i {
  color: var(--event-primary);
}

/* === FILTRES MODERNES === */
.modern-filter-group {
  margin-bottom: 1.5rem;
}

.modern-filter-label {
  display: block;
  font-weight: 600;
  color: var(--event-text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.modern-filter-select {
  width: 100%;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  background: white;
  color: var(--event-text-primary);
  transition: all 0.3s ease;
}

.modern-filter-select:focus {
  outline: none;
  border-color: var(--event-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2); /* Slightly stronger shadow */
}

.filter-help-text {
  font-size: 0.8rem;
  color: var(--event-text-secondary);
  margin-top: 0.5rem;
}

/* === RECHERCHE MODERNE === */
.modern-search-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.modern-search-input {
  width: 100%;
  border: 2px solid #e2e8f0;
  border-radius: 2rem;
  padding: 0.875rem 1rem 0.875rem 2.5rem;
  font-size: 0.9rem;
  background: white;
  transition: all 0.3s ease;
}

.modern-search-input:focus {
  outline: none;
  border-color: var(--event-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2); /* Slightly stronger shadow */
}

.search-icon-modern {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--event-text-secondary);
}

/* === STATS SIDEBAR === */
.sidebar-stats {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.stat-item:last-child {
  margin-bottom: 0;
}

.stat-label {
  color: var(--event-text-secondary);
  font-size: 0.9rem;
}

.stat-value {
  color: var(--event-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

/* === CTA ÉVÉNEMENTIEL === */
.event-cta-card {
  background: var(--event-primary); /* Solid purple */
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.event-cta-card::before {
  display: none; /* Remove dot pattern */
}

.event-cta-content {
  position: relative;
  z-index: 2;
}

.event-cta-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.event-cta-text {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.btn-event-cta {
  background: white;
  color: var(--event-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-event-cta:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  color: var(--event-primary);
}

/* === MAIN CONTENT === */
.providers-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.providers-title-modern {
  color: var(--event-text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.providers-count-modern {
  background: var(--event-primary); /* Solid purple */
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* === CARTES PREMIUM HARMONISÉES === */
/* Override des gradients dans les cartes premium pour harmoniser avec le thème événementiel */
.provider-card-premium-style .card-header {
  background: var(--event-primary) !important;
}

.provider-card-premium-style .badge-premium {
  background: var(--event-accent) !important;
}

.provider-card-premium-style .btn-primary {
  background: var(--event-primary) !important;
  border-color: var(--event-primary) !important;
}

.provider-card-premium-style .btn-primary:hover {
  background: var(--event-secondary) !important;
  border-color: var(--event-secondary) !important;
}

/* === LOADING ET ÉTATS === */
.map-loading-state {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 0.5rem;
}

/* === SCROLLBAR MODERNE === */
.annuaire-sidebar::-webkit-scrollbar {
  width: 4px;
}

.annuaire-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.annuaire-sidebar::-webkit-scrollbar-thumb {
  background: var(--event-primary);
  border-radius: 2px;
}

.annuaire-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--event-secondary);
}

/* === PROTECTION DES EMAILS === */
.email-contact-replacement {
  color: #718096;
  font-style: italic;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.email-contact-replacement i {
  color: var(--event-primary);
}

/* Styles pour les popups Leaflet */
.leaflet-popup-content .email-contact-replacement {
  margin: 0.25rem 0;
}

/* === FIX TREMBLEMENT IMAGES === */
/* Suppression de tous les effets hover sur les images pour éviter les tremblements */
.annuaire-main-content img,
.provider-card img,
.provider-card-premium-style img,
.card-image-hover {
  transform: none !important;
  animation: none !important;
}

.annuaire-main-content *:hover img,
.provider-card:hover img,
.provider-card-premium-style:hover img,
.provider-card-premium-style:hover .card-image-hover {
  transform: none !important;
  animation: none !important;
}

/* === BOUTON LOAD MORE MODERNE === */
.btn-load-more-modern {
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 2rem auto;
  display: block;
  width: fit-content;
  min-width: 350px;
  height: 80px;
  overflow: hidden;
  border-radius: 2rem;
  box-shadow: var(--event-shadow-light);
}

.btn-load-more-modern:hover {
  box-shadow: var(--event-shadow-heavy);
}

.btn-load-more-modern:active {
  transform: translateY(-2px);
}

.btn-load-more-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--event-primary); /* Solid purple */
  transition: all 0.3s ease;
  z-index: 1;
}

.btn-load-more-modern:hover .btn-load-more-bg {
  background: var(--event-secondary); /* Darker purple on hover */
}

.btn-load-more-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  height: 100%;
  color: white;
}

.btn-load-more-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.btn-load-more-modern:hover .btn-load-more-icon {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1) rotate(180deg);
}

.btn-load-more-icon i {
  font-size: 1.25rem;
  color: white;
}

.btn-load-more-text {
  flex: 1;
  text-align: left;
  margin-left: 1.5rem;
  line-height: 1.3;
}

.btn-load-more-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.25rem;
}

.btn-load-more-subtitle {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.btn-load-more-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-load-more-modern:hover .btn-load-more-counter {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.counter-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--event-primary);
  transition: all 0.3s ease;
}

.btn-load-more-modern:hover .counter-number {
  color: var(--event-secondary);
  transform: scale(1.1);
}

/* Loading state */
.btn-load-more-modern.loading {
  pointer-events: none;
}

.btn-load-more-modern.loading .btn-load-more-icon i {
  animation: loadMoreSpin 1s linear infinite;
}

.btn-load-more-modern.loading .btn-load-more-title::after {
  content: '...';
  animation: loadMoreDots 1.5s ease-in-out infinite;
}

@keyframes loadMoreSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes loadMoreDots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Responsive */
@media (max-width: 768px) {
  .btn-load-more-modern {
    min-width: 300px;
    height: 70px;
  }

  .btn-load-more-content {
    padding: 0.75rem 1.5rem;
  }

  .btn-load-more-icon {
    width: 40px;
    height: 40px;
  }

  .btn-load-more-icon i {
    font-size: 1rem;
  }

  .btn-load-more-text {
    margin-left: 1rem;
  }

  .btn-load-more-title {
    font-size: 1rem;
  }

  .btn-load-more-subtitle {
    font-size: 0.8rem;
  }

  .btn-load-more-counter {
    width: 50px;
    height: 50px;
  }

  .counter-number {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .btn-load-more-modern {
    min-width: 280px;
    height: 65px;
  }

  .btn-load-more-content {
    padding: 0.75rem 1.25rem;
  }

  .btn-load-more-text {
    margin-left: 0.75rem;
  }

  .btn-load-more-title {
    font-size: 0.95rem;
  }

  .btn-load-more-subtitle {
    font-size: 0.75rem;
  }

.btn-load-more-counter {
  width: 45px;
  height: 45px;
}

.counter-number {
  font-size: 0.9rem;
}
}

.preview-card {
  position: relative;
}

.preview-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 30;
  pointer-events: none;
}

.preview-card-blur {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(6px);
  background: rgba(15, 23, 42, 0.45);
  opacity: 0.92;
  pointer-events: none;
}

.placeholder-overlay .preview-card-blur {
  background: rgba(15, 23, 42, 0.6);
}

.preview-card-message {
  position: relative;
  z-index: 1;
  color: #fff;
  text-align: center;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: auto;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-chip i {
  font-size: 0.85rem;
}

.preview-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

.preview-btn {
  box-shadow: none;
}

.preview-bottom-cta .card {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.placeholder-card .preview-card-message {
  max-width: 320px;
}

.placeholder-card .preview-chip {
  background: rgba(255, 255, 255, 0.25);
}

.placeholder-card .preview-card-message .btn {
  font-weight: 700;
}

.placeholder-card > .position-relative,
.placeholder-card .card-body,
.placeholder-card .card-footer {
  filter: blur(6px);
  opacity: 0.25;
}


@media (min-width: 992px) { /* Bootstrap's 'lg' breakpoint */
  .annuaire-modern-header .page-title-modern {
    justify-content: flex-start;
  }
  .annuaire-modern-header .page-subtitle-modern {
    text-align: left;
  }
  .annuaire-modern-header .header-actions-modern {
    justify-content: flex-start;
  }
}
