/* PROPRIÉTÉ DE CASCADE : structure historique de la barre et des panneaux.
   panels-compact.css porte uniquement la variante compacte ; responsive.css
   porte les adaptations d'écran et les offcanvas Info/Stats. */

/* =========================================================
   VARIABLES
   ========================================================= */
/* Variables de thème utilisées par la barre flottante et les panneaux. */

:root {
  --primary: #0d3380;
  --secondary: #439543;
}

/* =========================================================
   BARRE FLOTTANTE
   ========================================================= */
/* Barre principale affichée au-dessus de la carte. Les boutons sont injectés
   par bar_flottantes.js. */

.floating-toolbar {
  position: fixed;
  bottom: 20px;
  left: 60%;
  transform: translateX(-50%);
  z-index: 9999;
  display: none;
}

.floating-toolbar.is-visible {
  display: block;
  animation: slideUp 0.3s ease;
}

.toolbar-container {
  background: var(--primary);
  border-radius: 32px;
  height: 60px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* =========================================================
   NAVIGATION
   ========================================================= */
/* Flèches de défilement quand la liste d'outils dépasse la largeur disponible. */

.nav-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* =========================================================
   TOOLS
   ========================================================= */
/* Boutons ronds des fonctionnalités : couches, fonds, légende, info et ajout. */

.tools-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 10px;
  scrollbar-width: none;
}

.tools-list::-webkit-scrollbar {
  display: none;
}

.tool-item {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  text-align: center;
  cursor: pointer;
  height: 90px;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  outline: none;
}

.tool-item.is-active .tool-icon {
  background: var(--secondary);
}

.tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgb(255 255 255 / 40%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}

.tool-label {
  font-size: 10px;
  color: white;
  margin-top: 4px;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}

.tool-item:focus,
.tool-item:focus-visible {
  outline: none;
}

.tool-item:focus-visible .tool-icon,
.tool-item:active .tool-icon {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
}

.tool-item i {
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  pointer-events: none;
}

/* =========================================================
   ANIMATION
   ========================================================= */

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* =========================================================
   PANNEAUX - DÉPLAÇABLES ET REDIMENSIONNABLES
   ========================================================= */

/* Panneaux ouverts depuis la barre flottante. Ils sont positionnés au-dessus de
   la carte et peuvent être redimensionnés sur desktop. */
.tool-panel {
  position: fixed;
  background: white;
  width: 300px;
  min-width: 300px;
  min-height: 200px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 3100;
  overflow: hidden;
  resize: both;
}

.tool-panel.is-active {
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

/* En-tête du panneau : titre, icône et bouton de fermeture. */
.panel-header {
  background: var(--primary);
  color: white;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.panel-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.panel-close {
  background: none;
  border: none;
  /*color: white;*/
  /*font-size: 20px;*/
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  outline: none;
}

.panel-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Contenu scrollable */
.panel-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Redimensionneur */
.panel-resizer {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 12px;
  z-index: 10;
}

.panel-resizer:hover {
  color: var(--primary);
}

/* =========================================================
   BOUTONS DU PANNEAU
   ========================================================= */
/* Boutons génériques utilisés dans les panneaux : action, annulation,
   suppression et petits boutons de tableau. */

.panel-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.2s;
  font-size: 14px;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  outline: none;
}

.panel-btn:hover {
  background: #439543;
}

.panel-btn img {
  width: 24px;
  height: 24px;
}

.panel-btn i,
.panel-close i {
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  pointer-events: none;
}

.panel-btn.cancel-btn {
  background: #dc3545;
  color: white;
}

.panel-btn.cancel-btn:hover {
  background: #c82333;
}

.panel-btn.delete-btn {
  background: #dc3545;
  color: white;
}

.panel-btn.delete-btn:hover {
  background: #c82333;
}

.panel-btn.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  width: auto;
}

/* =========================================================
   COUCHES DANS LE PANNEAU
   ========================================================= */
/* Lignes de couches et cases à cocher générées par bar_flottantes.js. */

.layer-panel-item {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.layer-panel-item:last-child {
  border-bottom: none;
}

.layer-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
}

.layer-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* =========================================================
   SÉPARATEUR
   ========================================================= */

.separator {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 8px;
}

/* =========================================================
   STYLES POUR OL-DRAGBOX
   ========================================================= */
/* Rectangle de sélection OpenLayers utilisé par la sélection multiple. */

.ol-dragbox {
  border: 2px dashed rgba(0, 123, 255, 0.8);
  background-color: rgba(0, 123, 255, 0.1);
  transition: all 0.2s ease-out;
}

@keyframes pulse {
  0% {
    border-color: rgba(0, 123, 255, 0.6);
  }
  50% {
    border-color: rgba(0, 123, 255, 1);
  }
  100% {
    border-color: rgba(0, 123, 255, 0.6);
  }
}

.ol-dragbox {
  animation: pulse 1s infinite;
}

/* =========================================================
   STYLES POUR LES NOUVEAUX PANNEAUX
   ========================================================= */

/* Styles communs aux contenus textuels des panneaux : information, attributs,
   messages de chargement et erreurs. */
.info-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.info-section:last-child {
  border-bottom: none;
}

.info-section h4 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}

.info-section p {
  margin: 5px 0;
  font-size: 13px;
  line-height: 1.5;
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-form label {
  margin-top: 6px;
  margin-bottom: 0;
  color: #354052;
  font-size: 12px;
  font-weight: 700;
}

.filter-form select {
  min-height: 34px;
  font-size: 13px;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.filter-actions .panel-btn {
  justify-content: center;
  gap: 8px;
  margin-bottom: 0;
  padding: 9px 10px;
  text-align: center;
}

.filter-actions .panel-btn.secondary {
  background: #eef2f6;
  color: #344054;
}

.filter-actions .panel-btn.secondary:hover {
  background: #dfe6ef;
}

.filter-summary {
  margin: 8px 0 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.stats-section {
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid #e5e7eb;
}

.stats-section h4 {
  margin: 0 0 8px;
  color: #354052;
  font-size: 12px;
  font-weight: 800;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-chart-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  min-width: 0;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  background: #ffffff;
  --stats-center-x: 34%;
  --stats-center-y: 50%;
}

.stats-chart-wrap.is-compact {
  height: 255px;
}

.stats-chart {
  width: 100%;
  height: 100%;
  padding: 6px;
  min-width: 0;
}

.stats-chart-center {
  position: absolute;
  left: var(--stats-center-x);
  top: var(--stats-center-y);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #202b3a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.05;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.stats-chart-center span {
  font-size: 11px;
  font-weight: 700;
}

.stats-chart-center small {
  margin-top: 2px;
  color: #667085;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

#stats-panel {
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 120px);
}

.stats-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}

.stats-label {
  color: #202b3a;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

.stats-value {
  flex: 0 0 auto;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
}

.stats-bar-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f5;
}

.stats-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--secondary);
}

.stats-empty {
  margin: 0;
  color: #8a94a6;
  font-size: 12px;
}

.attr-header {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
}

.attr-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
}

.attr-table tr {
  border-bottom: 1px solid #e0e0e0;
}

.attr-table tr:last-child {
  border-bottom: none;
}

.attr-key {
  padding: 10px 8px;
  font-weight: 600;
  color: #555;
  font-size: 12px;
  width: 40%;
  vertical-align: top;
}

.attr-value {
  padding: 10px 8px;
  color: #333;
  font-size: 13px;
}

.attr-actions {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.loading,
.error-message,
.info-message {
  text-align: center;
  padding: 30px 20px;
  color: #666;
}

.error-message {
  color: #d32f2f;
}

.error-message i {
  font-size: 24px;
  margin-bottom: 10px;
  display: block;
}

.info-message i {
  font-size: 48px;
  color: #ccc;
  margin-bottom: 15px;
  display: block;
}

.tool-item[data-tool="attributes"] .tool-icon {
  opacity: 0.6;
  transition: opacity 0.3s;
}

.tool-item[data-tool="attributes"].has-selection .tool-icon {
  opacity: 1;
}

/* =========================================================
   POPUP DE SÉLECTION DE FEATURE
   ========================================================= */

/* Ancien style de popup OpenLayers. La popup latérale actuelle est surtout
   surchargée dans responsive.css, mais ces règles restent utiles en fallback. */
.feature-popup {
  position: absolute;
  background-color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 15px;
  border-radius: 8px;
  bottom: 12px;
  left: -50px;
  min-width: 250px;
  z-index: 1000;
}

.feature-popup:after,
.feature-popup:before {
  top: 100%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none;
}

.feature-popup:after {
  border-top-color: white;
  border-width: 10px;
  left: 48px;
  margin-left: -10px;
}

.feature-popup .ol-popup-closer {
  text-decoration: none;
  position: absolute;
  top: 8px;
  right: 8px;
  color: #999;
  font-size: 18px;
}

.feature-popup .ol-popup-closer:hover {
  color: #333;
}

.popup-header {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 14px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 5px;
}

.popup-body {
  font-size: 13px;
}

.popup-body p {
  margin: 5px 0;
}

.popup-btn {
  margin-top: 10px;
  padding: 8px 15px;
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  width: 100%;
}

.popup-btn:hover {
  background: #357a35;
}

/* =========================================================
   ÉDITION - STYLES AMÉLIORÉS
   ========================================================= */

/* Interface des outils d'annotation/dessin local sur la carte. */
.edit-toolbar {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.edit-section h4 {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.edit-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.edit-tool {
  width: 40px;
  height: 40px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  outline: none;
}

.edit-tool:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.edit-tool.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.edit-tool i {
  font-size: 16px;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  pointer-events: none;
}

/* Panneau de style d'édition */
.edit-style-panel {
  position: fixed;
  top: 100px;
  right: 20px;
  width: 250px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  z-index: 3200;
  padding: 15px;
  display: none;
}

.edit-style-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.edit-style-header h4 {
  margin: 0;
  font-size: 14px;
  color: var(--primary);
}

.edit-style-header button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
}

.style-group {
  margin-bottom: 12px;
}

.style-group label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.style-group input[type="text"],
.style-group input[type="range"],
.style-group input[type="color"] {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
}

.style-actions {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

/* =========================================================
   SÉLECTION MULTIPLE
   ========================================================= */

.selection-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.selection-table-container {
  max-height: 250px;
  overflow: auto;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.selection-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.selection-table th {
  background: var(--primary);
  color: white;
  padding: 8px 6px;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.selection-table td {
  padding: 6px;
  border-bottom: 1px solid #dee2e6;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-table tr:hover {
  background: #f8f9fa;
}

.selection-help {
  margin-top: 10px;
  padding: 8px;
  background: #e7f3ff;
  border-radius: 6px;
  font-size: 11px;
}

/* =========================================================
   SELECTION DE COUCHES ET FORMULAIRES
   ========================================================= */
.layer-selection-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.add-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.btn-back {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  background: #6c757d;
  color: white;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  outline: none;
}

.btn-back:hover {
  background: #5a6268;
}

.btn-back i {
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  pointer-events: none;
}

.panel-btn:focus,
.panel-btn:focus-visible,
.edit-tool:focus,
.edit-tool:focus-visible,
.btn-back:focus,
.btn-back:focus-visible,
.panel-close:focus,
.panel-close:focus-visible {
  outline: none;
}

.add-geometry-info {
  margin-bottom: 12px;
}

.badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.badge-info {
  background: #17a2b8;
  color: white;
}

.add-form-container {
  overflow-y: auto;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

/* =========================================================
   MISE EN PAGE
   ========================================================= */

.layout-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 15px;
}

.layout-option label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.layout-option input[type="text"],
.layout-option select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

.layout-option input[type="checkbox"] {
  margin-right: 8px;
}

.layout-actions {
  display: flex;
  gap: 8px;
}

/* Aperçu de mise en page */
.layout-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.preview-container {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.preview-container.portrait {
  width: 70vh;
  height: 90vh;
}

.preview-container.paysage {
  width: 90vw;
  height: 70vw;
  max-height: 80vh;
}

.preview-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.preview-header h2 {
  margin: 0;
  color: var(--primary);
}

.preview-meta {
  margin-top: 10px;
  font-size: 12px;
  color: #666;
}

.preview-map {
  width: 100%;
  height: 60%;
  background: #e8f4f8;
  border: 1px solid #ccc;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 18px;
}

.preview-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
}

.preview-legend,
.preview-scale {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 5px;
  font-size: 12px;
}

.preview-north {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 14px;
}

/* =========================================================
   AJOUTS POUR LES NOUVELLES FONCTIONNALITÉS
   ========================================================= */

/* Notification toast */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  background: var(--secondary, #439543);
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  transform: translateX(150%);
  transition: transform 0.3s ease;
  max-width: 350px;
  font-size: 14px;
}

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

.notification.success {
  background: #28a745;
}

.notification.error {
  background: #dc3545;
}

.notification.info {
  background: #17a2b8;
}

/* Style pour le DragBox de zoom */
.ol-dragbox {
  border: 2px dashed rgba(13, 51, 128, 0.8);
  background-color: rgba(13, 51, 128, 0.1);
  transition: all 0.2s ease-out;
}

/* Bouton primaire dans le panneau d'édition */
.panel-btn.btn-primary {
  background: var(--primary, #0d3380);
}

.panel-btn.btn-primary:hover {
  background: #0a2866;
}

/* Amélioration du panneau d'édition de style */
.edit-style-panel {
  position: fixed;
  top: 100px;
  right: 20px;
  width: 280px;
  max-height: 80vh;
  overflow-y: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  z-index: 3200;
  padding: 15px;
  display: none;
}

.edit-style-content {
  max-height: 60vh;
  overflow-y: auto;
}

.style-group {
  margin-bottom: 15px;
}

.style-group label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
  font-weight: 600;
}

.style-group input[type="text"],
.style-group input[type="range"],
.style-group input[type="color"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}

.style-group input[type="range"] {
  padding: 0;
  height: 6px;
}

.style-actions {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Curseur crosshair pour zoom rectangle */
#map.crosshair-cursor {
  cursor: crosshair !important;
}

/* Tool panel à droite par défaut */
.tool-panel {
  right: 10px;
  top: 95px; /* Sous le header */
  left: auto !important;
  transform: none !important;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* Style pour la popup */
.feature-popup .popup-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  font-weight: 500;
  transition: all 0.2s;
}

.feature-popup .popup-btn:hover {
  background: var(--secondary);
  transform: translateY(-1px);
}

/* Empêcher le clic de passer à travers les boutons de la popup */
.feature-popup {
  z-index: 3000;
}

.feature-popup .ol-popup-closer {
  z-index: 3001;
}

/* Amélioration du dragbox pour zoom */
.ol-dragbox {
  border: 3px dashed #439543;
  background-color: rgba(67, 149, 67, 0.15);
  box-shadow: 0 0 15px rgba(67, 149, 67, 0.3);
}

/* Curseur crosshair pour zoom */
#map.zoom-active {
  cursor: crosshair !important;
}

/* Panneau de style des mesures */
#measure-style-panel {
  display: none;
  position: fixed;
  right: 320px; /* À gauche du panneau de mesure */
  top: 80px;
  width: 280px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  z-index: 3200;
  padding: 15px;
}
