/* ==========================================================================
   OUTILS CARTES - Coordonnées, Règle, Mesures (2D & 3D)
   ========================================================================== */

/* --- 1. ÉLÉMENTS COMMUNS & DRAG CONFIG --- */
.coordinates-display, 
.distance-info-panel {
    position: fixed;
    z-index: 900;
    backdrop-filter: blur(8px);
    pointer-events: auto !important;
    touch-action: none; 
    user-select: none;
}

/* --- 2. BANDEAU COORDONNÉES (Desktop) --- */
.coordinates-display {
    bottom: 60px;
    right: 10px;
    background: rgba(20, 20, 20, 0.9);
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'SF Mono', Cascadia Code, monospace;
    font-size: 13px;
    color: #FFFFFF;
    cursor: move;
}

/* --- 3. PANNEAU D'INFORMATION DISTANCE (Desktop) --- */
.distance-info-panel {
    bottom: 90px;
    right: 10px;
    z-index: 1000;
    background: rgba(30, 30, 30, 0.95);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 280px;
    max-width: 320px;
    color: white;
    display: none; 
    overflow: hidden;
}

.panel-header {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 13px;
    cursor: move;
}

/* --- 4. LIGNES DE POINTS ET MESURES --- */
.marker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.marker-badge {
    background: #FF4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.marker-coords {
    font-family: monospace;
    font-size: 12px;
    color: #CCC;
}

/* --- 5. SECTION MESURES (Avec liseré) --- */
.measurements {
    padding: 15px 15px 15px 35px;
    background: rgba(255, 68, 68, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid #FF4444;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.measure-row {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.measure-row span:first-child {
    min-width: 65px; 
    display: inline-block;
}

.measure-row strong {
    color: #FF4444;
    font-size: 16px;
    font-family: 'SF Mono', monospace;
    margin-left: 5px;
}

/* --- 6. UI ÉLÉMENTS --- */
.edit-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}

/* --- 7. CONFIGURATION WEB MOBILE --- */
@media (max-width: 768px) {
    
    .coordinates-display {
        position: fixed !important; 
        left: auto; 
        right: 15px; 
        bottom: 80px;
        transform: none; 
        width: fit-content;
        max-width: 85vw;
        padding: 8px 12px;
        font-size: 11px;
        /* Optimisation lisibilité mobile */
        background: rgba(15, 15, 15, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .distance-info-panel {
        position: fixed !important;
        left: auto;
        right: 10px;
        bottom: 130px;
        width: 85%;
        max-width: 280px;
        border-radius: 12px;
        transform: none;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    }

    .marker-row { padding: 8px 12px; }
    .marker-coords { font-size: 10px; }
    .measurements { padding: 10px 10px 10px 25px; } 
    
    .edit-btn {
        min-width: 38px; /* Zone tactile accrue */
        min-height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* --- 7. CURSEUR CENTRAL (Viseur mobile) --- */
.mobile-crosshair {
  display: none; /* Caché sur PC */
}

@media (max-width: 768px) {
  .mobile-crosshair {
      display: block; /* Visible uniquement sur mobile */
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 800;
      pointer-events: none; /* Ne bloque pas les clics sur la carte */
  }

  .crosshair-h, .crosshair-v {
      position: absolute;
      background: #FF4444;
      box-shadow: 0 0 2px rgba(0,0,0,0.8);
  }
  
  .crosshair-h { top: 0; left: -15px; width: 30px; height: 1.5px; }
  .crosshair-v { top: -15px; left: 0; width: 1.5px; height: 30px; }

  .crosshair-center {
      position: absolute;
      top: -4px;
      left: -4px;
      width: 8px;
      height: 8px;
      border: 1.5px solid #FF4444;
      border-radius: 50%;
  }
}