/* Styles généraux */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Style pour le conteneur de la carte principale */
#map-container {
    width: 100%;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* Style pour la carte secondaire dans l'offcanvas */
#secondary-map-container {
    width: 100%;
    height: 70vh; /* Augmentation de la hauteur pour une carte plus grande */
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Style pour le bouton flottant */
.btn-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.btn-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Style pour les modales */
.modal-content {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.offcanvas {
    border-radius: 10px 0 0 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 80% !important; /* Augmentation de la largeur de l'offcanvas */
    max-width: 800px !important; /* Largeur maximale pour les grands écrans */
}

.modal-header, .offcanvas-header {
    background-color: #0d6efd;
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

/* Style pour les marqueurs personnalisés */
.custom-marker {
    background-color: #0d6efd;
    border-radius: 50%;
    border: 2px solid white;
    width: 15px;
    height: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.custom-marker:hover {
    background-color: #0a58ca;
    transform: scale(1.2);
}

/* Style pour le cluster de marqueurs */
.marker-cluster {
    background-color: rgba(13, 110, 253, 0.6);
    border-radius: 50%;
    color: white;
    text-align: center;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Style pour la popup des marqueurs */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 10px;
}

.popup-content {
    max-width: 250px;
}

.popup-content img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
}

.popup-content h5 {
    margin-top: 0;
    color: #0d6efd;
}

/* Animation pour les transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Style pour le préchargeur */
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Style pour la modale d'information des points */
.point-info-modal .modal-content {
    border: none;
    overflow: hidden;
}

.point-info-modal .modal-header {
    padding: 15px 20px;
}

.point-info-modal .modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.point-info-modal .point-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.point-info-modal .point-url {
    word-break: break-all;
    color: #0d6efd;
    text-decoration: none;
}

.point-info-modal .point-url:hover {
    text-decoration: underline;
}

/* Style pour les alertes */
.alert {
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Style pour la barre de recherche */
.search-container {
    position: absolute;
    top: 60px;
    left: 20px;
    z-index: 1000;
    width: 350px;
    max-width: 90%;
}

.search-box {
    width: 100%;
    padding: 10px 15px;
    border-radius: 25px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-box:focus {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
    z-index: 1001;
    display: none;
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

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

/* Style pour les cartes des liens */
.link-card {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.link-card .card-body {
    padding: 15px;
}

.link-card .card-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #0d6efd;
}

.link-card .card-text {
    color: #6c757d;
    margin-bottom: 10px;
}

.link-timestamp {
    font-size: 12px;
    color: #adb5bd;
    text-align: right;
}

/* Bouton d'ajout de lien à un point existant */
.add-link-btn {
    margin-top: 15px;
    width: 100%;
    border-radius: 25px;
    padding: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Responsive design */
@media (max-width: 992px) {
    .offcanvas {
        width: 90% !important;
    }
    
    #secondary-map-container {
        height: 60vh;
    }
}

@media (max-width: 768px) {
    .btn-floating {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    #secondary-map-container {
        height: 50vh;
    }
    
    .offcanvas {
        width: 100% !important;
    }
    
    .search-container {
        width: calc(100% - 40px);
        top: 10px;
        left: 10px;
    }
}
