/* ==========================================
   SITE WEB INSTITUTIONNEL RNI - RÉALISATIONS
   Rassemblement National des Indépendants
   ========================================== */

/* Import de la police Poppins depuis Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ========== VARIABLES CSS - PALETTE SOBRE PROFESSIONNELLE ========== */
:root {
  /* Couleurs principales RNI - Tons sobres */
  --bleu-royal: #1e3a8a;
  --bleu-primaire: #2563eb;
  --bleu-fonce: #1e40af;
  --bleu-clair: #60a5fa;
  --jaune-dore: #f59e0b;
  --blanc: #ffffff;
  --gris-clair: #f8f9fa;
  --gris-moyen: #6c757d;
  --gris-fonce: #343a40;

  /* Gris neutres professionnels */
  --gris-50: #f9fafb;
  --gris-100: #f3f4f6;
  --gris-700: #374151;
  --gris-900: #111827;

  /* Couleurs des catégories - Palette sobre */
  --education: #2563eb;
  --sante: #059669;
  --environnement: #0891b2;
  --infrastructures: #ea580c;
  --energie: #f59e0b;
  --emploi: #dc2626;

  /* Typographie */
  --font-principale: 'Poppins', sans-serif;

  /* Espacements */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;

  /* Ombres */
  --ombre-petite: 0 2px 8px rgba(0, 0, 0, 0.1);
  --ombre-moyenne: 0 4px 16px rgba(0, 0, 0, 0.15);
  --ombre-grande: 0 8px 32px rgba(0, 0, 0, 0.2);

  /* Transitions */
  --transition-rapide: 0.2s ease;
  --transition-normale: 0.3s ease;
}

/* ========== RESET ET BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-principale);
  line-height: 1.6;
  color: var(--gris-fonce);
  background-color: var(--gris-clair);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-normale);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition-normale);
}

/* ========== HEADER / NAVIGATION ========== */
.header {
  background: var(--blanc);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #dadce0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  height: 50px;
  width: auto;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: #18ABF8;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
}

.nav-menu a {
  color: #1d1e20;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition-rapide);
}

.nav-menu a:hover,
.nav-menu a.active {
  color: #18ABF8;
  border-bottom-color: #18ABF8;
  background: transparent;
  transform: none;
}

.btn-retour {
  background: #18ABF8;
  color: var(--blanc);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: var(--transition-normale);
}

.btn-retour:hover {
  background: #0e6fa8;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ========== HERO SECTION ========== */
.hero {
  background: linear-gradient(135deg, var(--bleu-royal) 0%, #005aa7 100%);
  color: var(--blanc);
  padding: var(--spacing-xl) 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,101.3C1248,85,1344,75,1392,69.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
  background-size: cover;
  background-position: bottom;
  opacity: 0.3;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

.btn-primary {
  background: var(--jaune-dore);
  color: var(--bleu-royal);
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: var(--ombre-moyenne);
  display: inline-block;
  transition: var(--transition-normale);
}

.btn-primary:hover {
  background: #ffd93d;
  transform: translateY(-3px);
  box-shadow: var(--ombre-grande);
}

/* ========== CHIFFRES CLÉS ========== */
.chiffres-cles {
  background: var(--blanc);
  padding: var(--spacing-lg) 2rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  color: var(--bleu-royal);
  margin-bottom: var(--spacing-md);
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: var(--spacing-md);
}

.stat-card {
  background: linear-gradient(135deg, var(--bleu-royal) 0%, var(--bleu-clair) 100%);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  color: var(--blanc);
  box-shadow: var(--ombre-moyenne);
  transition: var(--transition-normale);
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--ombre-grande);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: block;
}

.stat-label {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* ========== FILTRES (CARTE) ========== */
.filtres-section {
  background: var(--blanc);
  padding: var(--spacing-md);
  border-radius: 12px;
  box-shadow: var(--ombre-petite);
  margin-bottom: var(--spacing-md);
}

.filtres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.filtre-group label {
  display: block;
  font-weight: 600;
  color: var(--bleu-royal);
  margin-bottom: 0.5rem;
}

.filtre-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--gris-clair);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-rapide);
}

.filtre-group select:focus {
  border-color: var(--bleu-clair);
  outline: none;
}

.btn-reset {
  background: var(--gris-moyen);
  color: var(--blanc);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  align-self: end;
}

.btn-reset:hover {
  background: var(--gris-fonce);
}

/* ========== CARTE ========== */
.carte-container {
  background: var(--blanc);
  border-radius: 12px;
  box-shadow: var(--ombre-moyenne);
  overflow: hidden;
  margin-bottom: var(--spacing-md);
}

#carte {
  height: 600px;
  width: 100%;
}

/* Styles pour les popups Leaflet */
.leaflet-popup {
  z-index: 1000 !important;
  margin-bottom: 20px;
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  padding: 0;
  min-width: 300px;
  max-width: 350px;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 1.25rem !important;
  width: auto !important;
  max-height: 450px;
  overflow-y: auto;
}

/* Scrollbar personnalisée */
.leaflet-popup-content::-webkit-scrollbar {
  width: 6px;
}

.leaflet-popup-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb {
  background: #18ABF8;
  border-radius: 10px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb:hover {
  background: #0e6fa8;
}

.leaflet-popup-tip {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Bouton fermeture */
.leaflet-popup-close-button {
  color: #18ABF8 !important;
  font-size: 24px !important;
  font-weight: bold !important;
  padding: 4px 8px !important;
}

.leaflet-popup-close-button:hover {
  color: #0e6fa8 !important;
  background: rgba(24, 171, 248, 0.1) !important;
  border-radius: 50%;
}

.popup-content {
  padding: 0;
}

.popup-content h3 {
  color: #18ABF8;
  margin: 0 0 0.75rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.popup-content p {
  margin: 0.4rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.popup-content > div {
  margin-top: 0.75rem;
}

.popup-description {
  color: #6c757d;
  margin: 0.75rem 0 !important;
  line-height: 1.6;
}

.popup-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #f8f9fa;
}

.popup-details p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.popup-details strong {
  color: #18ABF8;
  font-weight: 600;
}

.popup-footer {
  margin-top: 1rem;
}

.popup-action {
  margin-top: 1rem;
  text-align: center;
}

.popup-btn {
  display: inline-block;
  background: #18ABF8;
  color: white;
  padding: 0.7rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.popup-btn:hover {
  background: #0e6fa8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 171, 248, 0.3);
}

.popup-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.popup-badge.realise {
  background: #d4edda;
  color: #155724;
}

.popup-badge.en_cours {
  background: #fff3cd;
  color: #856404;
}

/* ========== PROJETS GRID ========== */
.projets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  padding: var(--spacing-md) 0;
}

.projet-card {
  background: var(--blanc);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--ombre-petite);
  transition: var(--transition-normale);
  cursor: pointer;
}

.projet-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--ombre-grande);
}

.projet-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--gris-clair);
}

.projet-content {
  padding: 1.5rem;
}

.projet-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.projet-categorie {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blanc);
}

.projet-title {
  font-size: 1.4rem;
  color: var(--bleu-royal);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.projet-description {
  color: var(--gris-moyen);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.projet-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 2px solid var(--gris-clair);
  font-size: 0.9rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gris-moyen);
}

.meta-item strong {
  color: var(--bleu-royal);
}

/* ========== GRAPHIQUES (STATISTIQUES) ========== */
.graphiques-section {
  background: var(--gris-clair);
  padding: var(--spacing-lg) 2rem;
}

.graphiques-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
  margin-top: var(--spacing-md);
}

.graphique-card {
  background: var(--blanc);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--ombre-petite);
}

.graphique-card h3 {
  color: var(--bleu-royal);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.graphique-container {
  position: relative;
  height: 350px;
}

/* ========== DÉTAIL PROJET ========== */
.detail-hero {
  background: linear-gradient(135deg, var(--bleu-royal) 0%, var(--bleu-clair) 100%);
  color: var(--blanc);
  padding: var(--spacing-lg) 2rem;
}

.detail-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md) 2rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: var(--spacing-md);
}

.detail-main {
  background: var(--blanc);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--ombre-petite);
}

.detail-sidebar {
  background: var(--blanc);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--ombre-petite);
  align-self: start;
  position: sticky;
  top: 100px;
}

.detail-image {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.detail-main h2 {
  color: var(--bleu-royal);
  margin: 2rem 0 1rem;
  font-size: 1.8rem;
}

.detail-main p {
  line-height: 1.8;
  margin-bottom: 1rem;
  color: var(--gris-fonce);
}

.info-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--gris-clair);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.9rem;
  color: var(--gris-moyen);
  margin-bottom: 0.25rem;
}

.info-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--bleu-royal);
}

.carte-mini {
  height: 250px;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1.5rem;
}

/* ========== ADMIN / BACK-OFFICE ========== */
.admin-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-md) 2rem;
}

.admin-header {
  background: var(--blanc);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--ombre-petite);
  margin-bottom: var(--spacing-md);
}

.admin-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.btn-admin {
  background: var(--bleu-royal);
  color: var(--blanc);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
}

.btn-admin:hover {
  background: var(--bleu-clair);
}

.admin-table {
  background: var(--blanc);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--ombre-petite);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bleu-royal);
  color: var(--blanc);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--gris-clair);
}

tbody tr:hover {
  background: var(--gris-clair);
}

.btn-action {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

.btn-edit {
  background: var(--jaune-dore);
  color: var(--bleu-royal);
}

.btn-delete {
  background: var(--emploi);
  color: var(--blanc);
}

/* ========== FORMULAIRE ========== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--bleu-royal);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--gris-clair);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-rapide);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--bleu-clair);
  outline: none;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* ========== LÉGENDE CATÉGORIES ========== */
.legende {
  background: var(--blanc);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--ombre-petite);
  margin-bottom: var(--spacing-md);
}

.legende h3 {
  color: #18ABF8;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.legende-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.legende-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.legende-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ========== FOOTER ========== */
.footer {
  background: var(--bleu-royal);
  color: var(--blanc);
  padding: var(--spacing-md) 2rem;
  margin-top: var(--spacing-xl);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: var(--jaune-dore);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .graphiques-grid {
    grid-template-columns: 1fr;
  }

  .projets-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== UTILITAIRES ========== */
.text-center {
  text-align: center;
}

.mb-2 {
  margin-bottom: var(--spacing-md);
}

.mt-2 {
  margin-top: var(--spacing-md);
}

.hidden {
  display: none;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* ========== MARQUEURS CARTE CIRCULAIRES - DESIGN MODERNE ========== */
.custom-marker-circle:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4) !important;
}

.custom-marker {
  background: transparent !important;
  border: none !important;
}

/* ========== GRAPHIQUES CHART.JS - THÈME SOMBRE ========== */
.graphique-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.graphique-card h3 {
  color: #e5e7eb !important;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.graphique-container {
  position: relative;
  height: 300px;
}

/* Styles des popups de carte avec icônes FA */
.popup-content h3 i {
  margin-right: 0.5rem;
}

.popup-details p i {
  margin-right: 0.5rem;
  width: 18px;
  text-align: center;
}

.popup-badge i {
  margin-right: 0.3rem;
}

.popup-btn i {
  margin-left: 0.3rem;
}
