/* Styles pour la carte SVG interactive des syndicats autonomes */

.map-container {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #144190;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.carte {
    width: 65%;
    height: auto;
    max-height: calc(100vh - 100px);
    margin: auto;
    overflow: visible;
    transition: all 0.3s ease;
    margin-bottom: 40px;
  }
  
  .carte svg {
    width: 100%;
    height: auto;
    max-height: 100%;
  }
  
  path {
    stroke: #000000;
    stroke-width: 1px;
    stroke-linecap: round;
    stroke-linejoin: round;
    /*stroke-opacity: 0.25;*/
    transition: fill 0.3s ease, opacity 0.5s ease, stroke-width 0.3s ease, stroke-opacity 0.3s ease;
    cursor: pointer;
    touch-action: manipulation;
  }
  
  path:hover {
    stroke-opacity: 0.5;
    stroke-width: 1.5px;
  }
  
  /* Styles pour améliorer l'interaction tactile */
  @media (hover: none) {
    path:active {
      stroke-opacity: 0.7;
      stroke-width: 2.5px;
    }
    
    .map-container {
      -webkit-tap-highlight-color: transparent;
    }
    
    path {
      -webkit-tap-highlight-color: transparent;
    }
  }
  
  #info-panel {
    flex: 1;
    padding: 20px;
    background-color: white;
    border-left: 1px solid #e0e0e0;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
    overflow-y: auto;
  }
  
  #info-panel h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
  }
  
  #dept-info {
    margin-top: 15px;
    line-height: 1.6;
  }
  
  #dept-info p {
    margin: 8px 0;
  }
  
  #dept-info a {
    color: #2980b9;
    text-decoration: none;
  }
  
  #dept-info a:hover {
    text-decoration: underline;
  }
  
  /* Styles pour la légende */
.legend {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    width: 100%;
  }
  
  .legend h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
  }
  
  .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
  }
  
  .legend-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.1);
  }
  
  /* Responsive design - Tablette */
  @media (max-width: 992px) and (min-width: 769px) {
    .map-container {
      flex-direction: column;
      padding: 1rem;
      margin: 1rem auto;
      max-width: 90%;
    }
    
    .carte {
      width: 100%;
      max-height: 60vh;
      margin-bottom: 1rem;
    }
    
    #info-panel {
      width: 100%;
      margin-top: 1rem;
      border-left: none;
      border-top: 2px solid #e0e0e0;
    }
    
    .map-title {
      font-size: 1.3rem;
      margin-bottom: 1.5rem;
      text-align: center;
    }
    
    .legend {
      margin-top: 1rem;
    }
  }
  
  /* Mobile styles */
  @media (max-width: 768px) {
    body {
      overflow-x: hidden;
    }
    
    .map-container {
      padding: 0.5rem;
      margin: 0.5rem auto;
      gap: 0;
      max-width: 100%;
      width: calc(100% - 1rem);
      border-radius: 8px;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    
    .carte {
      width: 100%;
      max-height: 50vh;
      margin: 0 auto;
      padding: 0;
      box-sizing: border-box;
      text-align: center;
    }
    
    .carte svg {
      max-width: 100%;
      height: auto;
      margin: 0 auto;
      display: block;
      touch-action: manipulation;
    }
    
    #info-panel {
      width: 100%;
      padding: 1rem;
      min-height: auto;
      box-sizing: border-box;
      margin: 0.5rem 0 0 0;
      border-left: none;
      border-top: 2px solid #e0e0e0;
      border-radius: 4px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
      background-color: white;
    }
    
    #dept-info {
      display: flex;
      flex-direction: column;
      width: 100%;
      margin-top: 10px;
    }
    
    .map-info-title {
      font-size: 1.2rem;
      text-align: center;
      margin-bottom: 0.8rem;
      padding-bottom: 0.5rem;
      font-weight: 600;
    }
    
    .map-info-details {
      padding: 0;
      width: 100%;
    }
    
    .map-info-details p {
      font-size: 1rem;
      margin: 0.7rem 0;
      line-height: 1.5;
      width: 100%;
      word-wrap: break-word;
    }
    
    .map-info-details a {
      display: inline-block;
      word-break: break-all;
      color: #ed1b24;
      text-decoration: none;
    }
    
    .map-legend {
      flex-direction: row;
      justify-content: space-around;
      flex-wrap: wrap;
      gap: 0;
      padding: 0.6rem;
      margin-top: 0.8rem;
      background-color: rgba(255, 255, 255, 0.1);
      border-radius: 4px;
    }
    
    .map-legend-item {
      margin: 0.2rem 0;
      width: auto;
      padding: 0 0.5rem;
    }
    
    .map-legend-color {
      width: 12px;
      height: 12px;
    }
    
    .map-legend-text {
      font-size: 0.75rem;
    }
  }
  
  /* Petits mobiles */
  @media (max-width: 480px) {
    .map-container {
      padding: 0.3rem;
    }
    
    .carte {
      max-height: 45vh;
    }
    
    .map-info-panel {
      padding: 0.6rem;
    }
    
    .map-info-title {
      font-size: 1rem;
    }
    
    .map-info-details p {
      font-size: 0.8rem;
      margin: 0.3rem 0;
    }
    
    .map-legend {
      flex-direction: column;
      align-items: center;
    }
    
    .map-legend-item {
      margin: 0.15rem 0;
      justify-content: center;
    }
  }


.map-title {
    margin-bottom: 2.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    width: 100%;
}

.map-title u {
    background-size: 100% .1em;
    background-repeat: no-repeat;
    background-position: bottom;
    text-decoration: none;
}

.map-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: #f3f4f6;
    text-align: center;
}

.map-tooltip {
    position: fixed;
    background-color: #111827;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    transform: translate3d(0, 0, 0);
}

.map-info-panel {
    background-color: #f3f4f6;
    padding: 1.5rem;
    border-radius: 8px;
    min-height: 200px;
    border-left: 4px solid #ed1b24;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    width: 80vw;
    margin: 0;
    margin-top: 40px;
}

.map-info-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.legend {
  margin-top: 15px;
  padding: 12px;
}

/* Styles spécifiques pour les petits mobiles */
@media (max-width: 480px) {
  .carte {
    max-height: 45vh;
  }
  
  #info-panel h2 {
    font-size: 1.2rem;
  }
  
  #dept-info p {
    font-size: 0.9rem;
    margin: 6px 0;
  }
  
  .legend h3 {
    font-size: 1rem;
  }
  
  .legend-item {
    font-size: 0.85rem;
  }
}

.map-info-details {
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
}

.info-item {
    display: flex;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-icon {
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-right: 1rem;
}

.info-content {
    flex: 1;
}

.info-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1rem;
    color: #111827;
    font-weight: 500;
    margin: 0;
}

.info-value a {
    color: #e74c3c;
    text-decoration: none;
    transition: color 0.3s ease;
}

.info-value a:hover {
    color: #ed1b24;
    text-decoration: underline;
}

.map-legend {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.map-legend-item {
    display: flex;
    align-items: center;
}

.map-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.map-legend-color-present {
    background-color: #3262ac;
}

.map-legend-color-absent {
    background-color: #ecf0f1;
}

.map-legend-text {
    font-size: 0.875rem;
    color: #fff;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    padding: 2rem;
    font-weight: 500;
}
