/**
 * Campus Map Manager - Frontend Styles
 * Version: 1.0.0 avec Pan+Zoom
 */

/* Container principal */
.campus-map-wrapper {
    margin: 20px auto;
    position: relative;
}

/* Contrôles de zoom */
.campus-map-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: flex-end;
}

.campus-control-btn {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.campus-control-btn:hover {
    background: #f5f5f5;
    border-color: #2271b1;
    color: #2271b1;
    transform: translateY(-2px);
}

.campus-control-btn:active {
    transform: translateY(0);
}

.campus-control-btn svg {
    pointer-events: none;
}

/* Viewport avec pan/zoom */
.campus-map-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f5f5f5;
    cursor: grab;
}

.campus-map-viewport:active {
    cursor: grabbing;
}

.campus-map-container {
    position: relative;
    width: fit-content;
    display: inline-block;
    line-height: 0;
    transform-origin: 0 0;
}

/* Image de fond */
.campus-map-background {
    display: block;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Instructions */
.campus-map-instructions {
    margin-top: 15px;
    padding: 12px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* Zones cliquables */
.campus-zone {
    position: absolute;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.1s ease, z-index 0s;
}

.campus-zone:hover {
    z-index: 100;
}

/* Image overlay PNG */
.zone-overlay-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2;
    transition: opacity 0.9s ease;
    pointer-events: none;
}

/* Image PNG ENTREE*/
.zone-entrance-indicator {
    position: absolute;
    display: none;
    animation: blink-entrance 1s ease-in-out infinite;
}

/* Animation de clignotement pour les flèches d'entrée */
@keyframes blink-entrance {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.campus-zone:hover .zone-overlay-image {
    opacity: 0.9;
}

.campus-zone:hover .zone-entrance-indicator {
    display: block;
}
/* Tooltip au survol */
.zone-tooltip {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background-color: #FFF;
    color: #000;
    border-radius: 5px;
    white-space: nowrap;
    font-weight: 500;
    opacity: 0.6;
    visibility: visible;
    transition: opacity 0.8s ease, background-color 0.3s ease;
    margin-bottom: 10px;
    z-index: 1000;
    pointer-events: none;
    border-color: rgba(0, 0, 0, 1) !important;
    border-style: solid;
    border-width: 4px;
    bottom: -20px;
    padding: 8px 8px;
    font-size: 14px;
}

.campus-zone:hover .zone-tooltip {
    color: #fff;
    opacity: 0.7;
    background-color: rgba(0, 0, 0, 0.9);
}

.campus-zone:hover .zone-tooltip::after {
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Panneau latéral (Side Panel) */
.campus-sidepanel {
    position: fixed;
    top: 0;
    right: -550px;
    width: 550px;
    max-height: 90vh; /* Hauteur maximale de 90% de la hauteur de l'écran */
    height: auto; /* Hauteur automatique selon le contenu */
    background-color: #fff;
    box-shadow: -5px 0 25px rgba(0,0,0,0.3);
    transition: right 0.4s ease;
    z-index: 9999;
    overflow-y: auto;
    border-radius: 8px 0 0 8px; /* Coins arrondis à gauche */
}

.campus-sidepanel.active {
    right: 0;
}

/* Overlay sombre derrière le panneau */
.campus-sidepanel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 9998;
}

.campus-sidepanel-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Bouton de fermeture */
.sidepanel-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 32px;
    font-weight: normal;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1;
}

.sidepanel-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Bouton de fermeture en bas (mobile) */
.sidepanel-close-bottom {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2271b1;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.4);
    transition: all 0.3s ease;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
}

.sidepanel-close-bottom.active {
    opacity: 1;
    visibility: visible;
}

.sidepanel-close-bottom:hover {
    background-color: #1a5a8a;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 113, 177, 0.5);
}

@media screen and (max-width: 768px) {
    .sidepanel-close-bottom {
        display: block;
    }
}

/* Contenu du panneau */
.sidepanel-content {
    padding: 70px 30px 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Image dans le panneau */
.sidepanel-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sidepanel-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Informations textuelles */
.sidepanel-info h2 {
    margin: 0 0 15px 0;
    font-size: 28px;
    color: #2271b1;
    line-height: 1.3;
}

.sidepanel-info .description {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

.sidepanel-info .description p {
    margin: 0 0 15px 0;
}

.sidepanel-info .description p:last-child {
    margin-bottom: 0;
}

/* Style pour le contenu de page inclus */
.sidepanel-info .included-page-content {
    margin-top: 10px;
}

.sidepanel-info .included-page-content h1,
.sidepanel-info .included-page-content h2,
.sidepanel-info .included-page-content h3 {
    color: #2271b1;
    margin-top: 20px;
    margin-bottom: 10px;
}

.sidepanel-info .included-page-content h1 {
    font-size: 24px;
}

.sidepanel-info .included-page-content h2 {
    font-size: 22px;
}

.sidepanel-info .included-page-content h3 {
    font-size: 18px;
}

.sidepanel-info .included-page-content ul,
.sidepanel-info .included-page-content ol {
    margin: 10px 0 15px 20px;
}

.sidepanel-info .included-page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 15px 0;
}

/* Message si pas d'image */
.sidepanel-no-image {
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    color: #666;
}
/* Responsive */
@media screen and (max-width: 768px) {
    .campus-map-controls {
        justify-content: center;
    }
    
    .campus-control-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    .campus-map-viewport {
        height: 400px !important;
    }
    
    .campus-map-instructions {
        font-size: 12px;
    }
    
    .lightbox-body {
        flex-direction: column;
    }
    
    .lightbox-image {
        border-radius: 8px 8px 0 0;
        max-height: 300px;
    }
    
    .lightbox-info {
        padding: 30px 20px 20px 20px;
        max-height: 400px;
    }
    
    .lightbox-info h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    .lightbox-info p {
        font-size: 14px;
    }
    
    .zone-tooltip {
        font-size: 12px;
        padding: 6px 10px;
    }
}

@media screen and (max-width: 480px) {
    .campus-map-controls {
        gap: 5px;
    }
    
    .campus-control-btn {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .zone-tooltip {
        font-size: 14px;
        padding: 7px 8px;
    }
}
   
/* Responsive pour le panneau latéral */
@media screen and (max-width: 768px) {
    .campus-sidepanel {
        width: 85%;
        right: -85%;
    }
    
    .campus-sidepanel.active {
        right: 0;
    }
    
    .sidepanel-content {
        padding: 60px 20px 80px 20px; /* Ajout de padding en bas pour le bouton */
    }
    
    .sidepanel-info h2 {
        font-size: 24px;
    }
    
    .sidepanel-info .description {
        font-size: 15px;
    }
}

@media screen and (max-width: 480px) {
    .campus-sidepanel {
        width: 90%;
        right: -90%;
    }
    
    .sidepanel-content {
        padding: 50px 15px 80px 15px;
    }
    
    .sidepanel-info h2 {
        font-size: 22px;
    }
}
