/* Interface Publique Mobile-First - Mur de la Peste */
/* Version PHP dynamique adaptée à votre structure */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #1a1a1a;
    color: white;
    overflow-x: hidden;
    line-height: 1.4;
}

/* Accessibilité */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.header {
    background-color: #2a2a2a;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1000;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.welcome-btn {
    background-color: #5cb85c;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.welcome-btn:active {
    transform: scale(0.95);
    background-color: #4a9b4a;
}

.welcome-btn svg {
    stroke: white;
}

/* Navigation Tabs - Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background-color: #2a2a2a;
    border-top: 1px solid #3a3a3a;
    z-index: 1000;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.nav-tab {
    flex: 1;
    background: none;
    border: none;
    color: #888;
    padding: 12px 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.nav-tab.active {
    color: #5cb85c;
}

.nav-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #5cb85c;
    border-radius: 0 0 2px 2px;
}

.nav-tab i {
    font-size: 20px;
    transition: transform 0.3s;
}

.nav-tab:hover i {
    transform: scale(1.1);
}

.nav-tab span {
    font-size: 11px;
    font-weight: 500;
}

/* Content Area - Adjusted for bottom navigation */
.content {
    height: calc(100vh - 135px); /* Adjusted for header + bottom nav (sans progress bar) */
    position: relative;
    padding-bottom: 70px; /* Space for bottom navigation */
    overflow: hidden;
}

.tab-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tab-content.active {
    opacity: 1;
    visibility: visible;
}

/* Map */
#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Map Controls */
.map-controls {
    position: absolute;
    bottom: 90px; /* Au-dessus de la navigation du bas */
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Un peu plus d'espace entre les 2 boutons */
    z-index: 1000;
}

.map-control-btn {
    background-color: #2a2a2a;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s;
    color: white;
}

.map-control-btn:hover {
    background-color: #3a3a3a;
    transform: scale(1.05);
}

.map-control-btn:active {
    transform: scale(0.95);
    background-color: #4a4a4a;
}

.map-control-btn i {
    font-size: 18px;
}

/* Points List */
.points-list {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

/* Card de marqueur - Style moderne avec image de fond */
.point-card {
    position: relative;
    height: 280px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    background-color: #2a2a2a;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    cursor: default; /* Pas de cursor pointer sur la card */
}

.point-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}

.point-card.visited {
    opacity: 0.8;
}

.point-card.visited::after {
    content: '✓';
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #5cb85c;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Image de fond qui remplit toute la card */
.point-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.point-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
    color: #888;
    font-size: 60px;
}

/* Gradient overlay léger pour la transition */
.point-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0) 100%);
    z-index: 2;
    pointer-events: none;
}

/* Contenu superposé */
.point-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 20px 15px 20px; /* Padding bottom réduit pour descendre un peu plus */
    z-index: 10;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 130px; /* Hauteur augmentée pour accommoder le bouton plus grand */
}

.point-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-height: 70px; /* Hauteur minimale augmentée pour centrer le bouton plus grand */
    /* Fond noir semi-transparent plus léger et étalé en largeur */
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 16px;
    margin: 0 -8px; /* Étalement en largeur */
}

.point-text-content {
    flex: 1;
    min-width: 0; /* Permet la troncature du texte si nécessaire */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.point-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 5px;
}

.point-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}

.point-distance {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
    flex-shrink: 0;
}

.point-description {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

/* Bouton Découvrir - Style moderne vert avec hauteur augmentée */
.discover-btn {
    background: linear-gradient(135deg, #5cb85c 0%, #4a9b4a 100%);
    color: #000; /* Texte en noir pour meilleur contraste */
    border: none;
    padding: 16px 24px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(92, 184, 92, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    height: 56px; /* Hauteur augmentée pour meilleur impact visuel */
    white-space: nowrap;
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discover-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(92, 184, 92, 0.4);
    background: linear-gradient(135deg, #4a9b4a 0%, #5cb85c 100%);
}

.discover-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(92, 184, 92, 0.3);
}

/* Numéro du point - Style moderne */
.point-number {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    z-index: 15;
    border: 2px solid rgba(255,255,255,0.2);
}

/* Type de point - Supprimé, plus besoin d'afficher le type */
/* .point-type styles removed */

/* History Tab */
.history-content {
    height: 100%;
    overflow-y: auto;
}

.history-section {
    background-color: #2a2a2a;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.history-section h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #5cb85c;
}

.history-section h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #fff;
}

.history-section p, .history-section li {
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 15px;
}

.history-section ul {
    padding-left: 20px;
    margin-left: 0;
    list-style-position: outside;
    list-style-type: disc;
}

.history-section ol {
    padding-left: 20px;
    margin-left: 0;
    list-style-position: outside;
    list-style-type: decimal;
}

.history-section li {
    margin-bottom: 8px;
    padding-left: 5px;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #5cb85c;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    background-color: #5cb85c;
    border-radius: 50%;
    border: 3px solid #1a1a1a;
}

.timeline-date {
    font-weight: bold;
    color: #5cb85c;
    margin-bottom: 5px;
}

/* User Location Marker */
.user-location {
    width: 20px;
    height: 20px;
    background-color: #4285f4;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    position: relative;
}

.user-location::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 2px solid #4285f4;
    border-radius: 50%;
    opacity: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Custom Marker - Version simplifiée et robuste */
.custom-marker-wrapper {
    background: transparent !important;
    border: none !important;
}

.custom-marker {
    background: linear-gradient(135deg, #5cb85c, #4a9b4a) !important;
    border: 3px solid white !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 3px 12px rgba(0,0,0,0.4) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    cursor: pointer !important;
    position: relative !important;
    transform-origin: center center !important;
}

.custom-marker:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 4px 16px rgba(92, 184, 92, 0.5) !important;
}

.custom-marker .marker-content {
    font-weight: bold !important;
    color: white !important;
    font-size: 14px !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
    line-height: 1 !important;
    width: 100% !important;
    text-align: center !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.custom-marker.visited {
    background: linear-gradient(135deg, #888, #666) !important;
}

.custom-marker.visited:hover {
    box-shadow: 0 4px 16px rgba(136, 136, 136, 0.5) !important;
}

/* Styles spécifiques pour Leaflet */
.leaflet-marker-icon.custom-marker-wrapper {
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
}

.leaflet-div-icon.custom-marker-wrapper {
    background: transparent !important;
    border: none !important;
}

/* Réduire les animations si l'utilisateur les préfère réduites */
@media (prefers-reduced-motion: reduce) {
    .custom-marker {
        transition: none !important;
    }
    
    .custom-marker:hover {
        transform: none !important;
    }
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #3a3a3a;
    border-top-color: #5cb85c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: #ccc;
    font-size: 16px;
}

/* Notification */
.notification {
    position: fixed;
    top: 90px;
    left: 20px;
    right: 20px;
    background-color: #5cb85c;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    transform: translateY(-200px);
    transition: transform 0.3s ease;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateY(0);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
}

/* Modal de bienvenue avec priorité absolue */
#welcomeModal {
    z-index: 4000;
    background-color: rgba(0,0,0,0.95);
}

#welcomeModal.show {
    display: flex !important;
}

.modal-content {
    background-color: #2a2a2a;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #5cb85c;
}

.modal-content p {
    color: #ccc;
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-btn {
    background-color: #5cb85c;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
}

.modal-btn:active {
    transform: scale(0.95);
    background-color: #4a9b4a;
}

.modal-btn.secondary {
    background-color: #555;
    margin-top: 10px;
}

.modal-btn.secondary:active {
    background-color: #666;
}

/* Point Modal */
.point-modal-content {
    max-width: 500px;
    text-align: left;
}

.point-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

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

.point-modal-info p {
    margin-bottom: 20px;
}

.point-history {
    background-color: #3a3a3a;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.point-history h3 {
    color: #5cb85c;
    margin-bottom: 10px;
}

.point-history ul {
    padding-left: 20px;
    margin-left: 0;
    list-style-position: outside;
    list-style-type: disc;
}

.point-history ol {
    padding-left: 20px;
    margin-left: 0;
    list-style-position: outside;
    list-style-type: decimal;
}

.point-history li {
    margin-bottom: 8px;
    padding-left: 5px;
    color: #ccc !important;
}

.point-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.point-modal-actions .modal-btn {
    flex: 1;
}

/* Accessibility Modal */
.accessibility-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
}

.accessibility-modal.show {
    display: flex;
}

.accessibility-content {
    background-color: #2a2a2a;
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.accessibility-content h2 {
    margin-bottom: 25px;
    color: #5cb85c;
    text-align: center;
}

.accessibility-option {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #3a3a3a;
    border-radius: 10px;
}

.accessibility-option h3 {
    margin-bottom: 10px;
    color: #fff;
    font-size: 16px;
}

.accessibility-option p {
    margin-bottom: 15px;
    color: #ccc;
    font-size: 14px;
    line-height: 1.4;
}

.accessibility-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #555;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch.active {
    background-color: #5cb85c;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch.active::after {
    transform: translateX(26px);
}

.accessibility-buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.accessibility-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.accessibility-btn.primary {
    background-color: #5cb85c;
    color: white;
}

.accessibility-btn.secondary {
    background-color: #555;
    color: white;
}

.accessibility-btn:active {
    transform: scale(0.95);
}

/* High contrast mode */
body.high-contrast {
    filter: contrast(200%) brightness(1.2);
}

/* Large text mode */
body.large-text {
    font-size: 18px;
}

body.large-text .header h1 {
    font-size: 22px;
}

body.large-text .nav-tab span {
    font-size: 14px;
}

body.large-text .point-description {
    font-size: 16px;
}

/* Reduced motion */
body.reduced-motion * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Responsive Design */
@media (min-width: 768px) {
    .header {
        padding: 20px 40px;
    }
    
    .points-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 30px;
    }
    
    .point-card {
        height: 300px;
    }
    
    .point-title {
        font-size: 22px;
    }
    
    .point-description {
        font-size: 15px;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    
    .history-content {
        padding: 30px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 600px;
        margin: 15px auto 0;
    }
    
    .modal {
        padding: 40px;
    }
    
    .modal-content {
        max-width: 500px;
    }
}

@media (min-width: 1024px) {
    .points-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
        padding: 40px;
    }
    
    .point-card {
        height: 320px;
    }
}

@media (min-width: 1200px) {
    .points-list {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* ===========================================
   MEDIA QUERIES - RESPONSIVITÉ
   =========================================== */

/* Très petits écrans (moins de 375px) */
@media (max-width: 374px) {
    .header h1 {
        font-size: 18px;
    }
    
    .nav-tab span {
        font-size: 10px;
    }
    
    .nav-tab i {
        font-size: 18px;
    }
    
    .map-control-btn {
        width: 40px;
        height: 40px;
    }
    
    .map-control-btn i {
        font-size: 16px;
    }
}

/* Petits écrans (375px - 480px) */
@media (min-width: 375px) and (max-width: 480px) {
    .content {
        height: calc(100vh - 130px);
        padding-bottom: 65px;
    }
    
    .bottom-nav {
        padding: 6px 0;
    }
    
    .nav-tab {
        padding: 10px 8px 6px;
    }
}

/* Écrans moyens (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .content {
        height: calc(100vh - 135px);
        padding-bottom: 70px;
    }
    
    .nav-tab {
        padding: 14px 12px 10px;
    }
    
    .nav-tab i {
        font-size: 22px;
    }
    
    .nav-tab span {
        font-size: 12px;
    }
}

/* Grands écrans (769px et plus) */
@media (min-width: 769px) {
    .content {
        height: calc(100vh - 135px);
        padding-bottom: 75px;
    }
    
    .bottom-nav {
        padding: 10px 0;
    }
    
    .nav-tab {
        padding: 16px 15px 12px;
        gap: 6px;
    }
    
    .nav-tab i {
        font-size: 24px;
    }
    
    .nav-tab span {
        font-size: 13px;
    }
    
    .map-controls {
        bottom: 90px; /* Ajuster pour la navigation plus haute */
    }
}

/* Mode paysage sur mobile */
@media (orientation: landscape) and (max-height: 480px) {
    .header {
        padding: 8px 15px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .content {
        height: calc(100vh - 100px);
        padding-bottom: 55px;
    }
    
    .bottom-nav {
        padding: 4px 0;
    }
    
    .nav-tab {
        padding: 8px 6px 4px;
    }
    
    .nav-tab i {
        font-size: 16px;
    }
    
    .nav-tab span {
        font-size: 9px;
    }
    
    .map-controls {
        bottom: 70px; /* Ajuster pour navigation plus petite en mode paysage */
        right: 15px;
    }
    
    .map-control-btn {
        width: 40px;
        height: 40px;
    }
    
    .map-control-btn i {
        font-size: 16px;
    }
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: light) {
    /* Si l'utilisateur préfère un thème clair, on peut ajouter des ajustements */
    .custom-marker {
        border-color: #f0f0f0;
    }
}

/* Amélioration des rôles ARIA pour les toggles */
.toggle-switch[role="switch"] {
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch[role="switch"]:focus {
    outline: 2px solid #5cb85c;
    outline-offset: 2px;
}

.toggle-switch[role="switch"]:hover {
    transform: scale(1.05);
}

/* États de l'interface */
.interface-blocked {
    overflow: hidden;
}

.interface-blocked .header,
.interface-blocked .content,
.interface-blocked .bottom-nav {
    pointer-events: none;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.interface-blocked .loading {
    display: none;
}

/* Styles pour l'histoire des marqueurs */
.marker-history-section {
    background-color: #2a2a2a;
    border-radius: 15px;
    padding: 0; /* Suppression du padding pour utiliser toute la largeur */
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
}

.marker-history-header {
    margin-bottom: 0;
    padding: 20px 20px 0 20px; /* Padding uniquement pour le header */
}

.back-to-general-history {
    background-color: #3a3a3a;
    color: #5cb85c;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.back-to-general-history:hover {
    background-color: #4a4a4a;
    transform: translateX(-3px);
}

.back-to-general-history:active {
    transform: scale(0.95);
}

.marker-details {
    border: 1px solid #3a3a3a;
    border-radius: 0 0 15px 15px; /* Bordure arrondie seulement en bas */
    overflow: hidden;
    width: 100%;
    margin: 20px 0 0 0; /* Marge uniquement en haut */
}

.marker-main-info {
    display: flex;
    flex-direction: column;
    background-color: #1a1a1a;
    padding: 20px;
}

.marker-history-image {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.marker-history-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    color: #888;
    font-size: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-bottom: 15px;
}

.marker-text-info {
    flex: 1;
}

.marker-text-info h1 {
    color: #5cb85c;
    font-size: 22px;
    margin-bottom: 15px;
    line-height: 1.3;
}

.marker-text-info p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 10px;
}

.marker-text-info .marker-type {
    background-color: #3a3a3a;
    color: #5cb85c;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 10px;
}

.marker-text-info .marker-coordinates {
    font-size: 13px;
    color: #888;
    font-family: monospace;
}

.marker-detailed-history,
.marker-no-detailed-history {
    background-color: #2a2a2a;
    padding: 20px;
    border-top: 1px solid #3a3a3a;
    width: 100%;
    box-sizing: border-box;
}

.marker-detailed-history h2,
.marker-no-detailed-history h2 {
    color: #5cb85c;
    font-size: 18px;
    margin-bottom: 15px;
}

.marker-detailed-history .history-content {
    color: #ddd;
    line-height: 1.6;
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.marker-detailed-history .history-meta {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #3a3a3a;
    text-align: right;
}

.marker-detailed-history .history-meta small {
    color: #888 !important;
    font-size: 12px;
}

.general-history-header {
    background-color: #2a2a2a;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.general-history-header h1 {
    color: #5cb85c !important;
    margin-bottom: 10px;
    font-size: 24px;
}

.general-history-header p {
    color: #ccc !important;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

.marker-no-detailed-history p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 10px;
}

.marker-actions {
    background-color: #1a1a1a;
    padding: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    border-top: 1px solid #3a3a3a;
}

.marker-action-btn {
    background-color: #5cb85c;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    flex: 1;
    justify-content: center;
    min-width: 140px;
}

.marker-action-btn:hover {
    background-color: #4a9b4a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 184, 92, 0.3);
}

.marker-action-btn:active {
    transform: scale(0.95);
}

.marker-action-btn.secondary {
    background-color: #6c757d;
}

.marker-action-btn.secondary:hover {
    background-color: #5a6268;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.marker-action-btn i {
    font-size: 16px;
}

/* Responsive pour les actions des marqueurs */
@media (max-width: 480px) {
    .marker-actions {
        flex-direction: column;
    }
    
    .marker-action-btn {
        min-width: unset;
        width: 100%;
    }
}

/* Amélioration du style des cartes de points */
.point-card {
    cursor: default; /* Plus de cursor pointer sur la card entière */
}

.point-card .discover-btn {
    cursor: pointer;
    transition: all 0.3s ease;
}

.point-card .discover-btn:hover {
    background-color: #4a9b4a;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(92, 184, 92, 0.3);
}

/* Animation lors du changement d'onglet histoire */
#historyContent {
    opacity: 1;
    transition: opacity 0.3s ease;
}

#historyContent.transitioning {
    opacity: 0.7;
}

/* Style pour l'indicateur de retour à l'histoire générale */
.back-to-general-history i {
    transition: transform 0.3s ease;
}

.back-to-general-history:hover i {
    transform: translateX(-3px);
}

/* Amélioration de l'affichage des coordonnées */
.marker-coordinates {
    background-color: rgba(92, 184, 92, 0.1);
    border: 1px solid rgba(92, 184, 92, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 10px;
}

/* Responsive mobile pour la nouvelle structure des cards */
@media (max-width: 767px) {
    .point-content-wrapper {
        gap: 12px;
        align-items: center;
        min-height: 55px;
        padding: 14px; /* Padding ajusté pour mobile */
        border-radius: 10px; /* Border-radius plus petit sur mobile */
        margin: 0 -6px; /* Étalement adapté pour mobile */
    }
    
    .discover-btn {
        padding: 10px 16px;
        font-size: 11px;
        height: 42px;
    }
    
    .point-text-content {
        flex: 1;
        min-width: 0;
    }
    
    .point-title {
        font-size: 18px;
    }
    
    .point-description {
        font-size: 13px;
    }
    
    .point-info {
        min-height: 120px; /* Ajusté pour le bouton plus grand */
    }
    
    .point-header {
        margin-bottom: 6px;
    }
}

/* Amélioration pour très petits écrans */
@media (max-width: 480px) {
    .point-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .point-distance {
        margin-left: 0;
    }
    
    .discover-btn {
        padding: 12px 16px;
        font-size: 11px;
        height: 44px; /* Hauteur adaptée pour très petits écrans */
    }
    
    .point-title {
        font-size: 16px;
    }
    
    .point-info {
        min-height: 125px; /* Ajusté pour très petits écrans avec bouton plus grand */
    }
    
    .point-content-wrapper {
        min-height: 55px; /* Ajusté pour le nouveau bouton */
        padding: 12px; /* Padding plus petit pour très petits écrans */
        border-radius: 8px; /* Border-radius encore plus petit */
        margin: 0 -4px; /* Étalement plus réduit pour très petits écrans */
    }
}

/* Forcer la couleur du texte dans le contenu généré par TinyMCE */
.history-section * {
    color: inherit !important;
}

.history-section p,
.history-section div,
.history-section span,
.history-section strong,
.history-section em,
.history-section b,
.history-section i,
.history-section u,
.history-section li,
.history-section h1,
.history-section h2,
.history-section h3,
.history-section h4,
.history-section h5,
.history-section h6 {
    color: #ccc !important;
}

.history-section h1,
.history-section h2 {
    color: #5cb85c !important;
}

.history-section h3,
.history-section h4,
.history-section h5,
.history-section h6 {
    color: #fff !important;
}

/* Pour l'histoire des marqueurs dans les modales */
.point-history *,
.marker-detailed-history *,
.marker-detailed-history .history-content * {
    color: inherit !important;
}

.point-history p,
.point-history div,
.point-history span,
.point-history strong,
.point-history em,
.point-history b,
.point-history i,
.point-history u,
.point-history li,
.marker-detailed-history p,
.marker-detailed-history div,
.marker-detailed-history span,
.marker-detailed-history strong,
.marker-detailed-history em,
.marker-detailed-history b,
.marker-detailed-history i,
.marker-detailed-history u,
.marker-detailed-history li {
    color: #ddd !important;
}

.point-history h1,
.point-history h2,
.point-history h3,
.point-history h4,
.point-history h5,
.point-history h6,
.marker-detailed-history h1,
.marker-detailed-history h2,
.marker-detailed-history h3,
.marker-detailed-history h4,
.marker-detailed-history h5,
.marker-detailed-history h6 {
    color: #5cb85c !important;
}

/* Pour le contenu dans historyContent chargé dynamiquement */
#historyContent *,
#historyContent p,
#historyContent div,
#historyContent span,
#historyContent strong,
#historyContent em,
#historyContent b,
#historyContent i,
#historyContent u {
    color: #ccc !important;
}

#historyContent h1,
#historyContent h2,
#historyContent h3,
#historyContent h4,
#historyContent h5,
#historyContent h6 {
    color: #5cb85c !important;
}

/* Styles pour les images et médias dans le contenu enrichi TinyMCE */
.history-content img,
.marker-detailed-history img,
.point-history img,
#historyContent img,
.modal-history-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-content img:hover,
.marker-detailed-history img:hover,
.point-history img:hover,
#historyContent img:hover,
.modal-history-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

/* Classes spécifiques TinyMCE pour le positionnement des images */
.history-content .img-responsive,
.marker-detailed-history .img-responsive,
.point-history .img-responsive,
#historyContent .img-responsive,
.modal-history-content .img-responsive {
    max-width: 100%;
    width: 100%;
    height: auto;
}

.history-content .img-center,
.marker-detailed-history .img-center,
.point-history .img-center,
#historyContent .img-center,
.modal-history-content .img-center {
    margin: 20px auto;
    display: block;
}

.history-content .img-left,
.marker-detailed-history .img-left,
.point-history .img-left,
#historyContent .img-left,
.modal-history-content .img-left {
    float: left;
    margin: 10px 15px 15px 0;
    max-width: 40%;
}

.history-content .img-right,
.marker-detailed-history .img-right,
.point-history .img-right,
#historyContent .img-right,
.modal-history-content .img-right {
    float: right;
    margin: 10px 0 15px 15px;
    max-width: 40%;
}

/* Style pour les légendes d'images */
.history-content figcaption,
.marker-detailed-history figcaption,
.point-history figcaption,
#historyContent figcaption,
.modal-history-content figcaption {
    font-size: 13px;
    color: #999 !important;
    font-style: italic;
    text-align: center;
    margin-top: 8px;
    padding: 0 10px;
}

/* Style pour les figures avec légendes */
.history-content figure,
.marker-detailed-history figure,
.point-history figure,
#historyContent figure,
.modal-history-content figure {
    margin: 20px 0;
    text-align: center;
}

.history-content figure img,
.marker-detailed-history figure img,
.point-history figure img,
#historyContent figure img,
.modal-history-content figure img {
    margin-bottom: 8px;
}

/* Style pour les liens dans le contenu enrichi */
.history-content a,
.marker-detailed-history a,
.point-history a,
#historyContent a,
.modal-history-content a {
    color: #5cb85c !important;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.history-content a:hover,
.marker-detailed-history a:hover,
.point-history a:hover,
#historyContent a:hover,
.modal-history-content a:hover {
    color: #4a9b4a !important;
    text-decoration: none;
}

/* Style pour les tableaux dans le contenu enrichi */
.history-content table,
.marker-detailed-history table,
.point-history table,
#historyContent table,
.modal-history-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #3a3a3a;
    border-radius: 8px;
    overflow: hidden;
}

.history-content th,
.history-content td,
.marker-detailed-history th,
.marker-detailed-history td,
.point-history th,
.point-history td,
#historyContent th,
#historyContent td,
.modal-history-content th,
.modal-history-content td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #4a4a4a;
    color: #ddd !important;
}

.history-content th,
.marker-detailed-history th,
.point-history th,
#historyContent th,
.modal-history-content th {
    background-color: #2a2a2a;
    color: #5cb85c !important;
    font-weight: 600;
}

/* Style pour les listes dans le contenu enrichi */
.history-content ul,
.history-content ol,
.marker-detailed-history ul,
.marker-detailed-history ol,
.point-history ul,
.point-history ol,
#historyContent ul,
#historyContent ol,
.modal-history-content ul,
.modal-history-content ol {
    padding-left: 20px;
    margin: 15px 0;
}

.history-content li,
.marker-detailed-history li,
.point-history li,
#historyContent li,
.modal-history-content li {
    margin-bottom: 8px;
    color: #ddd !important;
    line-height: 1.6;
}

/* Style pour les blockquotes dans le contenu enrichi */
.history-content blockquote,
.marker-detailed-history blockquote,
.point-history blockquote,
#historyContent blockquote,
.modal-history-content blockquote {
    border-left: 4px solid #5cb85c;
    padding-left: 20px;
    margin: 20px 0;
    background-color: rgba(92, 184, 92, 0.1);
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.history-content blockquote p,
.marker-detailed-history blockquote p,
.point-history blockquote p,
#historyContent blockquote p,
.modal-history-content blockquote p {
    color: #ccc !important;
}

/* Améliorer la lisibilité du texte enrichi */
.history-content p,
.marker-detailed-history p,
.point-history p,
#historyContent p,
.modal-history-content p {
    margin-bottom: 15px;
    line-height: 1.7;
}

/* Responsive pour les images flottantes */
@media (max-width: 768px) {
    .history-content .img-left,
    .history-content .img-right,
    .marker-detailed-history .img-left,
    .marker-detailed-history .img-right,
    .point-history .img-left,
    .point-history .img-right,
    #historyContent .img-left,
    #historyContent .img-right,
    .modal-history-content .img-left,
    .modal-history-content .img-right {
        float: none;
        margin: 15px auto;
        max-width: 100%;
        display: block;
    }
    
    /* Réduire l'espacement des tableaux sur mobile */
    .history-content th,
    .history-content td,
    .marker-detailed-history th,
    .marker-detailed-history td,
    .point-history th,
    .point-history td,
    #historyContent th,
    #historyContent td,
    .modal-history-content th,
    .modal-history-content td {
        padding: 8px 10px;
        font-size: 14px;
    }
}
