/* Styles communs aux pages de conversion CDC / DXF
   (convertion_cdc.php, cdc_to_shapefile.php, dxf_to_geojson.php, dxf_to_shapefile.php) */

body {
  background-color: #163A43;
}

h1, h2 {
  text-align: center;
  color: #3C4A7D;
}

.main-title {
  text-align: center;
  color: #fff;
  font-size: 36px;
  margin: 0;
  padding: 20px 0;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  text-align: center;
}

label {
  font-weight: bold;
  margin-right: 8px;
}

.button-style {
  background-color: #3C4A7D;
  color: #fff;
  border: none;
  padding: 10px 18px;
  margin: 8px 5px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.button-style:hover {
  background-color: #2D7BC0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.button-style:disabled {
  background-color: #9aa1b8;
  cursor: not-allowed;
  box-shadow: none;
}

.button-small {
  padding: 5px 10px;
  font-size: 13px;
  margin: 4px 3px;
}

select {
  padding: 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin: 8px 5px;
}

.section {
  margin: 30px 0;
  padding: 20px;
  background-color: #F0EAD6;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 25px;
  margin: 10px 0;
}

/* --- Zone de glisser-déposer --- */
#dropZone {
  border: 3px dashed #3C4A7D;
  border-radius: 10px;
  background-color: #fff;
  padding: 35px 20px;
  margin: 20px 0;
  color: #3C4A7D;
  font-size: 17px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

#dropZone.dragover {
  background-color: #e3ecff;
  border-color: #2D7BC0;
}

#dropZone.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#dropZone .drop-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 8px;
}

#fileList {
  margin-top: 10px;
  font-size: 14px;
  color: #333;
}

.status-message {
  background-color: #eef6ff;
  color: #333;
  padding: 8px 12px;
  border: 1px solid #b3d4fc;
  border-radius: 6px;
  margin-top: 8px;
}

.status-error {
  background-color: #ffecec;
  border-color: #f5b5b5;
  color: #a12a2a;
}

/* --- Liste des calques --- */
#layersSection {
  display: none;
}

.layers-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#layersTable {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  font-size: 14px;
}

#layersTable th {
  background-color: #3C4A7D;
  color: #fff;
  padding: 8px;
  text-align: left;
}

#layersTable td {
  padding: 6px 8px;
  border-bottom: 1px solid #e5e5e5;
  text-align: left;
}

#layersTable tr.layer-off td {
  opacity: 0.45;
}

#layersTable td.num {
  text-align: right;
  font-family: monospace;
}

#layersTable input[type="color"] {
  width: 38px;
  height: 26px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  background: none;
}

.layers-scroll {
  max-height: 520px;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.type-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 12px;
  margin-right: 3px;
  white-space: nowrap;
  background: #e7e9f2;
  color: #3C4A7D;
}

.layer-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

/* --- Carte --- */
#map {
  height: 600px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.cdc-label {
  white-space: nowrap;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 2px #fff;
  pointer-events: none;
}

.cdc-label span {
  display: inline-block;
  transform-origin: 0 100%;
}

/* Masque les textes à petite échelle */
.hide-labels .cdc-label {
  display: none;
}

/* --- Disposition --- */
.main-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  margin-top: 20px;
}

#leftPane {
  flex: 3;
  min-width: 0;
}

#rightPane {
  margin-top: 30px;
  flex: 1;
  background-color: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 20px;
  color: #333;
  font-size: 15px;
  line-height: 1.6;
  min-width: 250px;
  max-width: 380px;
  align-self: flex-start;
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 1.4fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1100px) {
  .main-layout { flex-direction: column; align-items: stretch; }
  #rightPane { max-width: none; }
  .results-layout { grid-template-columns: 1fr; }
}

.help-section h3 {
  margin-top: 0;
  color: #3C4A7D;
  border-bottom: 2px solid #3C4A7D;
  padding-bottom: 6px;
}

.help-section p {
  margin: 10px 0;
  text-align: left;
}

.help-section code {
  background: #eee;
  padding: 2px 5px;
  border-radius: 4px;
}

.toggle-help {
  display: inline-block;
  background-color: #3C4A7D;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 10px;
  transition: background-color 0.3s ease;
}

.toggle-help:hover {
  background-color: #2D7BC0;
}

.collapsible {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}

.collapsible.open {
  max-height: 900px;
  opacity: 1;
}

/* Lien vers la documentation (à côté du bouton Aide) */
a.doc-link {
  text-decoration: none;
  margin-left: 6px;
}

a.doc-link:hover {
  color: #fff;
}
