/**
 * Styles pour la Carte Interactive PPA
 */

/* Container principal */
.cippa-container {
    display: flex;
    flex-wrap: nowrap;  /* Pas de retour à la ligne */
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Conteneur de la carte */
.cippa-map-wrapper {
    flex: 0 0 calc(70% - 1rem);
    min-width: 300px;
    max-width: none;
    padding: 0;
    position: relative;
    background: #ffffff;
    align-self: flex-start;
}

.cippa-map-wrapper svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Styles des zones SVG */
.cippa-map-wrapper svg g[class^="zone"] {
    transition: all 0.3s ease;
    cursor: pointer;
}

.cippa-map-wrapper svg g[class^="zone"] polygon,
.cippa-map-wrapper svg g[class^="zone"] path {
    transition: all 0.3s ease;
}

/* Zone active */
.cippa-map-wrapper svg g[class^="zone"].active {
    filter: brightness(1.2);
}

/* Conteneur de contenu */
.cippa-content {
    flex: 0 0 calc(30% - 1rem);
    min-width: 300px;
    max-width: none;
    padding: 1rem;
}

.cippa-content h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #333;
}

.cippa-zone-details {
    background: #fff;
    padding: 1.5rem;
}

.cippa-zone-text {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cippa-zone-text.active {
    opacity: 1;
}

.cippa-zone-text h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .cippa-container {
        flex-direction: column;
        flex-wrap: wrap;  /* Retour à la ligne sur mobile */
    }
    
    .cippa-map-wrapper,
    .cippa-content {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Styles spécifiques pour chaque mode */
.cippa-container[data-type="particulier"] .cippa-zone-details {
    border-top: 4px solid #4a90e2;
}

.cippa-container[data-type="entreprise"] .cippa-zone-details {
    border-top: 4px solid #50b83c;
}

/* Styles pour le contenu WordPress */
.cippa-zone-text {
    line-height: 1.6;
}

.cippa-zone-text p {
    margin-bottom: 1rem;
}

.cippa-zone-text ul, 
.cippa-zone-text ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.cippa-zone-text img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

.cippa-zone-text a {
    color: #4a90e2;
    text-decoration: none;
}

.cippa-zone-text a:hover {
    text-decoration: underline;
}

/* Styles d'accessibilité */
.cippa-map-wrapper svg g[class^="zone"]:focus {
    outline: none;
    filter: brightness(1.2);
}

.cippa-map-wrapper svg g[class^="zone"]:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Styles de chargement */
.cippa-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.cippa-loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 10px auto;
    border-radius: 50%;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a90e2;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Effets de transition */
.cippa-fade-enter {
    opacity: 0;
    transform: translateY(10px);
}

.cippa-fade-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 300ms, transform 300ms;
}

.cippa-fade-exit {
    opacity: 1;
    transform: translateY(0);
}

.cippa-fade-exit-active {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 300ms, transform 300ms;
}