#header_panel {
  width: 100%;
  height: 5%;
  background-color: #19282c;
}

#header_title {
  color: #ffffff;
  font-size: 80%;
  font-weight: bold;
  position: relative;
  left: 100px;
  top: 20px;
  font-family: Georgia, "Times New Roman", Times, serif;
}

#camera_icon {
  /*display: none;*/
  width: 100%;
  height: 100%;
  position: fixed;
  top: 15px;
  right: 235px;
  cursor: pointer;
  max-height: 70px !important;
  max-width: 70px !important;
  z-index: 2;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 35px;
  filter: invert(1);
}

#addAnnotationBtn {
  width: 10vw;
  height: 10vh;
  position: fixed;
  bottom: 2vh;
  right: 2vw; 
  z-index: 1000;
  cursor: pointer;
  max-height: 50px !important;
  max-width: 50px !important;
  background-color: black;
  border-radius: 50em;
}

/* Style for the Edit button */
.annotation-edit-button {
  background-color: black;
  color: white;
  border: 1px solid white; /* Border color when not hovered */
  padding: 5px 10px; /* Adjust padding as needed */
  cursor: pointer;
  transition: border 0.3s ease-in-out; /* Transition effect on hover */
}

/* Hover effect for the Edit button */
.annotation-edit-button:hover {
  border: 1px solid yellow; /* Border color on hover */
}

/* Style for the Edit button */
.annotation-delete-button {
  background-color: red;
  color: white;
  border: 1px solid white; /* Border color when not hovered */
  padding: 5px 10px; /* Adjust padding as needed */
  cursor: pointer;
  transition: border 0.3s ease-in-out; /* Transition effect on hover */
}

/* Hover effect for the Edit button */
.annotation-delete-button:hover {
  border: 1px solid yellow; /* Border color on hover */
}

/* Styling custom form for new annotation */
.custom-form {
  position: absolute;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  margin: 0;
  width: 300px;
  height: 400px;
  cursor: pointer;
  background-color: black;
  opacity: 0.8;
  padding: 5px;
  border-radius: 10px;
  border-color: #ffffff;
  color: #ffffff;
  font-size: 1em;
  border: solid;
  right: 0%;
  bottom: 1.2em;
}

/* Style for the Submit button */
#submitAnnotation {
  background-color: green;
  color: white;
  border: 1px solid white; /* Border color when not hovered */
  padding: 5px 10px; /* Adjust padding as needed */
  cursor: pointer;
  transition: border 0.3s ease-in-out; /* Transition effect on hover */
  display: none;
}

/* Hover effect for the Submit button */
#submitAnnotation:hover {
  border: 2px solid yellow; /* Border color on hover */
}

/* Style for the Submit button */
#editAnnotation {
  background-color: blue;
  color: white;
  border: 1px solid white; /* Border color when not hovered */
  padding: 5px 10px; /* Adjust padding as needed */
  cursor: pointer;
  transition: border 0.3s ease-in-out; /* Transition effect on hover */
  display: none;
}

/* Hover effect for the Submit button */
#editAnnotation:hover {
  border: 2px solid yellow; /* Border color on hover */
}

.hidden {
  display: none;
}

.visible {
  display: block;
}

/* Full screen mode button style */
#fullscreen_icon {
  width: 10vw;
  height: 10vh;
  position: fixed;
  top: 2vh; /* Adjust these values to set the desired proportion */
  right: 2vw; /* Adjust these values to set the desired proportion */
  cursor: pointer;
  max-height: 50px !important;
  max-width: 50px !important;
  z-index: 2;
  background-color: black;
  border-radius: 50em;
}

#fullscreen_icon img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensures the aspect ratio of the image is maintained */
  border-radius: 35px;
}

/* Navigation help button style */
#question_icon {
  width: 10vw;
  height: 10vh;
  position: fixed;
  top: 2vh; /* Same top margin as fullscreen icon */
  right: 100px;
  cursor: pointer;
  max-height: 50px !important;
  max-width: 50px !important;
  z-index: 2;
  background-color: black;
  border-radius: 50em;
}

#question_icon img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensures the aspect ratio of the image is maintained */
  border-radius: 35px;
}

/* Panel style */
#question_panel {
  width: 50vw; /* 80% of the viewport width */
  height: 30vh; /* 60% of the viewport height */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: none;
  z-index: 1000;
  display: none; /* Initially hidden */
  text-align: center;
}

/* Navigation help button style */
#layers_icon {
  width: 10vw;
  height: 10vh;
  position: fixed;
  top: 2vh; /* Same top margin as fullscreen icon */
  right: 160px;
  cursor: pointer;
  max-height: 50px !important;
  max-width: 50px !important;
  z-index: 2;
  background-color: black;
  border-radius: 50em;
}

#layers_icon img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensures the aspect ratio of the image is maintained */
  border-radius: 35px;
}

/*Style for layers panel*/
#layers_panel {
  position: absolute;
  top: 10vh;
  right: 2vw;
  z-index: 1000;
  display: none; /* Initially hidden */
  text-align: left;
  background-color: black;
  opacity: 0.8;
  padding: 5px;
  border-radius: 10px;
  border-color: #ffffff;
  color: #ffffff;
  font-size: 1em;
  border: solid;
}


/* Tutorial: immagine dei comandi, centrata; clic per chiudere */
#question_panel {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 85vh;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
#question_panel img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}

/* Layers: filtri delle annotazioni per tipo */
#layers_panel {
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
}
#layers_panel .layer-row { display: flex; align-items: center; gap: 6px; cursor: pointer; margin: 0; }
#layers_panel .layer-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
#layers_panel .layer-count { margin-left: auto; opacity: .7; font-size: 12px; }

/* ===== Modalità del viewer: barra Visualizzazione / Modifica ===== */
#pd_modebar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(20, 24, 26, .92);
  color: #fff;
  font: 13px/1.3 system-ui, sans-serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
  max-width: calc(100vw - 160px);
  flex-wrap: wrap;
  justify-content: center;
  white-space: nowrap;
}
#pd_modebar button {
  border: 1px solid rgba(255, 255, 255, .35);
  background: transparent;
  color: #fff;
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  font: inherit;
}
#pd_modebar button:hover { border-color: #fff; }
#pd_modebar button.pd-primary { background: #e08a00; border-color: #e08a00; font-weight: 600; }
#pd_modebar button:disabled { opacity: .5; cursor: wait; }
#pd_modebar .pd-modebar-label { font-weight: 600; }
#pd_modebar .pd-modebar-label.pd-edit { color: #ffb84d; }
#pd_modebar .pd-modebar-hint { opacity: .75; font-size: 12px; }
#pd_modebar .pd-modebar-hint.pd-dirty { color: #ffb84d; opacity: 1; }
#pd_modebar > span { display: none; align-items: center; gap: 8px; flex-wrap: nowrap; }
body.pd-mode-view #pd_modebar .pd-mode-view-only,
body.pd-mode-edit #pd_modebar .pd-mode-edit-only { display: flex; }
/* persona di un'azienda cliente: barra "Vista dell'azienda" */
body.pd-mode-client #pd_modebar .pd-mode-company-only { display: flex; }
body.pd-mode-edit #pd_modebar { outline: 2px solid #e08a00; }

/* In Visualizzazione (e per i visitatori) niente strumenti di modifica di annotazioni e oggetti */
body.pd-mode-view #addAnnotationBtn,
body.pd-mode-view #annotationTypeSelection,
body.pd-mode-view #customAnnotationForm,
body.pd-mode-view .annotation-edit-button,
body.pd-mode-view .annotation-delete-button,
body.pd-mode-view #editControlsBlock,
body.pd-mode-view #editControlsFloating { display: none !important; }

/* Clienti e visitatori: mai strumenti degli oggetti; annotazioni solo con il permesso */
body.pd-mode-client #editControlsBlock,
body.pd-mode-client #editControlsFloating,
body.pd-mode-public #editControlsBlock,
body.pd-mode-public #editControlsFloating,
body.pd-mode-public #addAnnotationBtn,
body.pd-mode-public #annotationTypeSelection,
body.pd-mode-public #customAnnotationForm,
body.pd-mode-client:not(.pd-can-annotate) #addAnnotationBtn,
body.pd-mode-client:not(.pd-can-annotate) #annotationTypeSelection,
body.pd-mode-client:not(.pd-can-annotate) #customAnnotationForm { display: none !important; }

/* ===== Accesso clienti (sidebar, admin/staff in Modifica) ===== */
#pd_client_access { display: none; margin: 0 8px 8px 8px; padding: 8px 10px; border: 1px solid #e08a00; border-radius: 6px; background: rgba(224, 138, 0, .12); color: #f3e2c6; font: 12px/1.4 system-ui, sans-serif; }
body.pd-mode-edit #pd_client_access { display: block; }
#pd_client_access .pd-ca-title { font-weight: 700; font-size: 13px; color: #ffb84d; margin-bottom: 4px; }
#pd_client_access .pd-ca-meta { opacity: .9; margin-bottom: 6px; }
#pd_client_access .pd-ca-meta a { color: #ffd08a; }
#pd_client_access .pd-ca-badge { display: inline-block; border-radius: 8px; padding: 0 6px; margin-right: 4px; background: rgba(255, 255, 255, .15); font-weight: 600; }
#pd_client_access .pd-ca-badge.pd-ca-public { background: rgba(63, 166, 107, .35); }
#pd_client_access .pd-ca-row { display: flex; align-items: center; gap: 6px; margin: 3px 0; font-weight: 400; cursor: pointer; }
#pd_client_access .pd-ca-row input { margin: 0; }
#pd_client_access .pd-ca-hint { opacity: .7; margin-top: 6px; font-size: 11px; }

/* Riga informativa per clienti e link condivisi */
#pd_access_info { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 0 8px 8px 8px; padding: 6px 10px; border-radius: 6px; background: rgba(255, 255, 255, .08); color: #dfe6ea; font: 12px/1.4 system-ui, sans-serif; }
#pd_access_info a { color: #ffd08a; font-weight: 600; }

/* ===== Scheda "Conformità misure" ===== */
#pd_compliance_btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 16px);
  margin: 6px 8px 8px 8px;
  padding: 7px 10px;
  border: 1px solid #3fa66b;
  border-radius: 6px;
  background: rgba(63, 166, 107, .15);
  color: #d8f5e3;
  font: 600 13px/1.2 system-ui, sans-serif;
  cursor: pointer;
  text-align: left;
}
#pd_compliance_btn:hover { background: rgba(63, 166, 107, .3); }

/* Report finale in finestra (report-panel.js, ADR-008) */
#pd_report_modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: stretch;
  justify-content: center;
  padding: 3vh 16px;
  background: rgba(0, 0, 0, .55);
}
#pd_report_modal .pdr-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1000px;
  background: #fff;
  color: #1d2327;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
  font: 14px/1.5 system-ui, sans-serif;
  overflow: hidden;
}
#pd_report_modal .pdr-head { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px 10px; border-bottom: 1px solid #e3e6e8; }
#pd_report_modal .pdr-kicker { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: #3c8f5f; font-weight: 700; }
#pd_report_modal h2 { margin: 2px 0 4px 0; font-size: 19px; line-height: 1.3; }
#pd_report_modal .pdr-meta .pd-report-badge { display: inline-block; }
#pd_report_modal .pdr-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
#pd_report_modal .pdr-actions a, #pd_report_modal .pdr-actions button { border: 1px solid #c9d0d4; background: #f6f8f9; border-radius: 6px; padding: 4px 10px; cursor: pointer; font: inherit; color: inherit; text-decoration: none; white-space: nowrap; }
#pd_report_modal .pdr-body { flex: 1; min-height: 0; background: #525659; }
#pd_report_modal .pdr-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
#pd_report_modal .pdr-text { margin: 0; height: 100%; overflow: auto; padding: 16px 20px; background: #fff; white-space: pre-wrap; font: 13px/1.5 ui-monospace, monospace; }
@media (max-width: 640px) {
  #pd_report_modal { padding: 0; }
  #pd_report_modal .pdr-panel { border-radius: 0; }
  #pd_report_modal .pdr-head { flex-direction: column; gap: 8px; }
  #pd_report_modal .pdr-actions { justify-content: flex-start; }
}

#pd_compliance_modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 16px;
  background: rgba(0, 0, 0, .55);
  overflow: auto;
}
#pd_compliance_modal .pdc-panel {
  width: 100%;
  max-width: 880px;
  background: #fff;
  color: #1d2327;
  border-radius: 10px;
  padding: 22px 26px;
  font: 14px/1.5 system-ui, sans-serif;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}
#pd_compliance_modal .pdc-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e3e6e8; padding-bottom: 12px; margin-bottom: 8px; }
#pd_compliance_modal .pdc-kicker { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: #3c8f5f; font-weight: 700; }
#pd_compliance_modal h2 { margin: 2px 0 4px 0; font-size: 22px; }
#pd_compliance_modal h3 { margin: 18px 0 6px 0; font-size: 16px; }
#pd_compliance_modal h4 { margin: 12px 0 4px 0; font-size: 14px; }
#pd_compliance_modal .pdc-meta, #pd_compliance_modal .pdc-muted { color: #5f6b72; font-size: 13px; }
#pd_compliance_modal .pdc-actions { display: flex; gap: 6px; align-items: flex-start; }
#pd_compliance_modal .pdc-actions button { border: 1px solid #c9d0d4; background: #f6f8f9; border-radius: 6px; padding: 4px 10px; cursor: pointer; font: inherit; color: inherit; }
#pd_compliance_modal .pdc-statement { background: #eef8f1; border-left: 4px solid #3c8f5f; padding: 8px 12px; border-radius: 4px; }
#pd_compliance_modal .pdc-alert { background: #fff4e5; border-left: 4px solid #e08a00; padding: 8px 12px; border-radius: 4px; }
#pd_compliance_modal .pdc-list { margin: 6px 0; padding-left: 20px; }
#pd_compliance_modal .pdc-list li { margin: 3px 0; }
#pd_compliance_modal .pdc-small { font-size: 12px; color: #4a555b; }
#pd_compliance_modal .pdc-table { border-collapse: collapse; width: 100%; margin: 6px 0; font-size: 13px; }
#pd_compliance_modal .pdc-table th, #pd_compliance_modal .pdc-table td { border-bottom: 1px solid #e3e6e8; padding: 5px 8px; text-align: left; vertical-align: top; }
#pd_compliance_modal .pdc-table th { color: #4a555b; font-weight: 600; width: 38%; }
#pd_compliance_modal .pdc-std th { width: auto; background: #f6f8f9; }
#pd_compliance_modal .pdc-dataset { border: 1px solid #e3e6e8; border-radius: 8px; padding: 4px 12px 8px 12px; margin: 8px 0; }
#pd_compliance_modal .pdc-badge { display: inline-block; border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
#pd_compliance_modal .pdc-ok { background: #e3f4ea; color: #23744a; }
#pd_compliance_modal .pdc-ko { background: #fff0db; color: #9a5b00; }
#pd_compliance_modal .pdc-na { background: #eef0f2; color: #5f6b72; }
#pd_compliance_modal .pdc-foot { margin-top: 16px; padding-top: 8px; border-top: 1px solid #e3e6e8; font-size: 11px; color: #7a858b; }
#pd_compliance_modal a { color: #23744a; }

@media (max-width: 600px) {
  #pd_compliance_modal .pdc-panel { padding: 16px; }
  #pd_compliance_modal .pdc-head { flex-direction: column; }
}

/* Stampa / PDF: solo la scheda */
@media print {
  body.pdc-printing > *:not(#pd_compliance_modal) { display: none !important; }
  body.pdc-printing #pd_compliance_modal { position: static; display: block !important; background: none; padding: 0; overflow: visible; }
  body.pdc-printing #pd_compliance_modal .pdc-panel { box-shadow: none; max-width: none; padding: 0; }
  body.pdc-printing #pd_compliance_modal .pdc-actions { display: none; }
  body.pdc-printing { overflow: visible !important; height: auto !important; }
}
