/* Police Megalopolis */
@font-face {
    font-family: "MegalopolisExtra";
    src: url("fonts/MegalopolisExtra-Regular.woff2") format("woff2"),
         url("fonts/MegalopolisExtra-Regular.woff") format("woff"),
         url("fonts/MegalopolisExtra-Regular.eot") format("embedded-opentype");
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #fff;
    color: #1a1a1a;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
}

/* Lien retour */
.back-link {
    display: inline-block;
    font-family: "MegalopolisExtra", sans-serif;
    color: #49728B;
    text-decoration: none;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: #58BAB0;
}

/* Navigation étages - boutons égaux */
.floor-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.floor-btn {
    width: 80px;
    padding: 0.75rem 0;
    border: 2px solid #49728B;
    background: #fff;
    font-family: "MegalopolisExtra", sans-serif;
    font-size: 1rem;
    color: #49728B;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    text-align: center;
}

.floor-btn:hover {
    background: #58BAB0;
    border-color: #58BAB0;
    color: #fff;
}

.floor-btn.active {
    background: #EFAD00;
    border-color: #EFAD00;
    color: #fff;
}

/* Plan container */
.plan-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

#plan-wrapper {
    width: 100%;
}

#plan-wrapper svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Styles pour les éléments SVG - forme change de couleur au hover */
#plan-wrapper [id^="forme-"] {
    transition: fill 0.3s, opacity 0.3s;
    pointer-events: none; /* La forme ne capte pas les events */
}

#plan-wrapper [id^="forme-"].hover {
    opacity: 0.5 !important;
}

/* Point devient jaune au hover */
#plan-wrapper [id^="point-"] {
    transition: fill 0.3s, opacity 0.3s;
    fill: transparent;
}

#plan-wrapper [id^="point-"].hover {
    fill: #EFAD00 !important;
    opacity: 0.6;
}

/* Seuls point et bulle sont cliquables */
#plan-wrapper [id^="point-"],
#plan-wrapper [id^="bulle-"] {
    cursor: pointer;
    pointer-events: all;
}

/* Textes des bulles */
#bubble-texts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bubble-text {
    position: absolute;
    text-align: center;
    pointer-events: auto;
    cursor: pointer;
    padding: 0.3rem;
    transform: translate(-50%, -50%);
    text-shadow: 
        -1px -1px 0 #fff,
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff;
}

.bubble-text .nom {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    color: #CD3D1D;
}

.bubble-text .soustitre {
    font-weight: 600;
    font-size: 0.85rem;
    color: #CD3D1D;
    margin-top: 0.2rem;
}

.bubble-text .type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    margin-top: 0.3rem;
    color: #CD3D1D;
    font-weight: 500;
}

.bubble-text .type-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.bubble-text .type-dot.commun { background: #f1c40f; }
.bubble-text .type-dot.club { background: #e67e22; }
.bubble-text .type-dot.atelier { background: #3498db; }

.bubble-text .infos {
    font-size: 0.7rem;
    color: #999;
    margin-top: 0.2rem;
}


/* Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.popup-overlay.hidden {
    display: none;
}

.popup {
    background: #fff;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.popup-close:hover {
    background: #ddd;
}

.popup-content {
    padding: 2rem;
}

.popup-header {
    margin-bottom: 1.5rem;
}

#popup-nom {
    font-family: "MegalopolisExtra", sans-serif;
    font-size: 1.8rem;
    color: #49728B;
    margin-bottom: 0.5rem;
}

.popup-soustitre {
    font-size: 1.1rem;
    color: #666;
}

.popup-infos {
    font-size: 0.9rem;
    color: #999;
    margin-top: 0.5rem;
}

/* Slider */
.popup-slider {
    margin-bottom: 1.5rem;
}

.popup-slider.hidden {
    display: none;
}

.slider-container {
    position: relative;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

#slider-img {
    width: 100%;
    height: 300px;
    object-fit: contain;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
}

.slider-prev { left: 0.5rem; }
.slider-next { right: 0.5rem; }

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
}

.slider-dot.active {
    background: #FF6B35;
}

/* Sections popup */
.popup-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.popup-section.hidden {
    display: none;
}

.popup-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #666;
}

.popup-section ul {
    list-style: none;
}

.popup-section li {
    margin-bottom: 0.5rem;
}

.popup-section a {
    color: #FF6B35;
    text-decoration: none;
}

.popup-section a:hover {
    text-decoration: underline;
}

.popup-description {
    line-height: 1.6;
    white-space: pre-line;
}

/* Responsive */
@media (max-width: 768px) {
    .floor-btn { width: 70px; padding: 0.5rem 0; font-size: 0.9rem; }
    .popup-content { padding: 1.5rem; }
    #popup-nom { font-size: 1.4rem; }
    
    .bubble-text .nom { font-size: 0.65rem; }
    .bubble-text .soustitre { font-size: 0.55rem; }
    .bubble-text .type-badge { font-size: 0.5rem; }
    .bubble-text .type-dot { width: 5px; height: 5px; }
}

@media (max-width: 480px) {
    .bubble-text .nom { font-size: 0.5rem; line-height: 1; }
    .bubble-text .soustitre { display: none; }
    .bubble-text .type-badge { display: none; }
    
    .popup {
        transform: scale(0.5);
        transform-origin: center center;
    }
}

/* Footer popup - ligne d'info */
.popup-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #666;
}

.popup-footer:empty {
    display: none;
}

.popup-footer .type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.popup-footer .type-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.popup-footer .type-dot.commun { background: #f1c40f; }
.popup-footer .type-dot.club { background: #e67e22; }
.popup-footer .type-dot.atelier { background: #3498db; }

.popup-footer .surface {
    color: #999;
}

.popup-footer .docs-links {
    display: flex;
    gap: 0.75rem;
}

.popup-footer .docs-links a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.8rem;
}

.popup-footer .docs-links a:hover {
    text-decoration: underline;
}

/* Loader images */
.slider-container {
    position: relative;
    min-height: 200px;
    background: #f0f0f0;
}

.slider-container.loading::after {
    content: "Chargement...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 0.9rem;
}

.slider-container img {
    transition: opacity 0.2s ease;
}

/* Lien fiche navette */
.fiche-navette-link {
    color: #2980b9;
    text-decoration: none;
    font-size: 0.9rem;
}
.fiche-navette-link:hover {
    text-decoration: underline;
}
