/* Stile per la tabella */
:root {
  --section-max-width: 500px;
  --description-max-width: 600px;
  --avacy-status-interaction-standard: #2c6ecb;
  --avacy-neutral-grey-secondary: #707070;
  --min-cell-width: 100px;
  --sl-color-primary-500: var(--avacy-status-interaction-standard);
  --sl-color-primary-600: var(--avacy-status-interaction-standard);
}

body.toplevel_page_avacy-plugin-settings {
  background: #ffffff;
}

body.toplevel_page_avacy-plugin-settings .wrap.hide {
  visibility: hidden;
}

body.toplevel_page_avacy-plugin-settings .wrap {
  margin: 1rem 0;
  min-height: calc(100vh - 65px - 32px);
}

.AvacyLoader {
  font-size: 3rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.AvacyDescription {
  max-width: var(--description-max-width);
  text-wrap: balance;
}
.AvacyDescription.AvacyDescription--First > p:first-child {
  margin-top: 0;
}

/* #719: l'esito dell'ultimo aggiornamento, sotto il pulsante */
.AvacyRefresh {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.AvacyRefreshFailed {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--sl-color-warning-700);
}

/* #667: banner spento e blocco acceso, sotto la spunta del blocco */
.AvacyBannerOff {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  max-width: var(--description-max-width);
  color: var(--sl-color-warning-700);
}
.AvacyBannerOff sl-icon {
  flex-shrink: 0;
  margin-top: 0.2em;
}

.AvacyLoader.hidden {
  display: none;
}

/* table {
  border-collapse: collapse;
  width: 100%;
} */

/* Stile per le celle della tabella */
/* th,
td {
  padding: 10px;
  text-align: left;
  border: 1px solid #ccc;
} */

/* Nascondi il contenuto del dettaglio per default */
/* details[open] > div {
  display: block;
} */

/* Nascondi le frecce del dettaglio */
/* summary::-webkit-details-marker {
  display: none;
} */

/* Section Styles */
.AvacySection {
  margin-bottom: 2rem;
}
.AvacySection.AvacySection--Table {
  margin-bottom: 0;
}

.AvacySection__InlineForm {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}
.AvacySection__InlineForm sl-input {
  flex: 1;
  margin: 0;
}
.AvacySection__InlineForm sl-button.Submit {
  margin-top: 0;
}

/* Account Details */
.AccountDetail {
  display: flex;
  gap: 0.5rem;
}

.AccountDetail__Key {
  font-weight: bold;
}

/* Input Styles */

sl-input {
  /* display: block; */
  margin-bottom: 1rem;
}

sl-input label {
  /* display: flex;
  align-items: center;
  gap: 0.5rem; */
  margin: 0 0 0.25rem;
  font-weight: bold;
}

sl-input label span {
  /* display: flex;
  align-items: center; */
}

sl-input sl-tooltip {
  display: flex;
}

/* Details */
sl-details::part(base) {
  border: none;
}
sl-details::part(header) {
  padding: 0;
  gap: 0.5rem;
}
sl-details::part(summary) {
  flex: revert;
}
sl-details::part(content) {
  display: inline-flex;
  flex-direction: column;
  padding: 0;
}

/* Select */
sl-select::part(listbox) {
  margin-block: 0.5rem;
  padding: 0;
}

/* Switch / Toggle */

sl-switch[size="medium"] {
  --thumb-size: calc(var(--sl-toggle-size-medium) - 2px);
}

sl-switch[size="large"] {
  --thumb-size: calc(var(--sl-toggle-size-large) - 4px);
}

/* Tabs */
/* Tab Panel */
sl-tab-panel {
  --sl-spacing-medium: 2rem;
}

/* Button Styles */
sl-button.Edit {
  margin-top: 1rem;
}
sl-button.Edit::part(base) {
  line-height: 1;
  padding-inline-start: 0;
  min-height: auto;
}

/* Alert */
sl-alert {
  margin-top: 1rem;
}

/* Media Queries */

@media screen and (min-width: 768px) {
  body.toplevel_page_avacy-plugin-settings #wpbody {
    width: 90%;
    margin: 0 auto;
  }

  .AvacySection.AvacySection--Account {
    max-width: var(--section-max-width);
  }
}

@media screen and (min-width: 1200px) {
  .AvacySection.AvacySection--Table {
    max-width: none;
    margin-top: 3rem;
  }
}

/* Tables */
table.AvacyForms {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}
table.AvacyForms td,
table.AvacyForms th {
  padding: 10px 6px;
}
table.AvacyForms tbody td {
  font-size: 13px;
}
table.AvacyForms tbody.AvacyForms__Group {
  border-bottom: 1px solid #dcdcde;
}
table.AvacyForms tbody tr sl-details::part(base) {
  padding: 0.3rem 0.5rem;
  background: transparent;
}
/* Save acceso senza dati scelti */
table.AvacyForms tbody.warning sl-checkbox {
  --sl-input-border-color: red;
}
table.AvacyForms tbody.warning .AvacyData__Checkboxes {
  outline: 1px solid red;
  background-color: #ffeeef;
  padding-left: 10px;
  padding-right: 10px;
}
table.AvacyForms thead {
  background: #cfcfcf;
  background: -moz-linear-gradient(top, #dbdbdb 0%, #d3d3d3 66%, #cfcfcf 100%);
  background: -webkit-linear-gradient(
    top,
    #dbdbdb 0%,
    #d3d3d3 66%,
    #cfcfcf 100%
  );
  background: linear-gradient(to bottom, #dbdbdb 0%, #d3d3d3 66%, #cfcfcf 100%);
}
table.AvacyForms thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--avacy-neutral-grey-secondary);
  text-align: left;
  vertical-align: bottom;
}
table.AvacyForms tfoot td {
  font-size: 14px;
}

/* Le caratteristiche del consenso, nella riga sotto il form */
.AvacyForms__Scroll {
  overflow-x: auto;
}
table.AvacyForms tbody tr.AvacyForms__Row {
  border-bottom: none;
}
/* Respiro sopra il form e sotto le sue caratteristiche: le due righe restano un blocco unico */
table.AvacyForms tbody tr.AvacyForms__Row td {
  padding-top: 20px;
}
/* Respiro ai lati: prima e ultima cella, intestazione compresa */
table.AvacyForms th:first-child,
table.AvacyForms td:first-child {
  padding-left: 20px;
}
table.AvacyForms th:last-child,
table.AvacyForms td:last-child {
  padding-right: 20px;
}
table.AvacyForms td,
table.AvacyForms th {
  padding-left: 12px;
  padding-right: 12px;
}
table.AvacyForms tbody tr.AvacyForms__Features td {
  padding-top: 4px;
  padding-bottom: 24px;
}
.AvacyFeatures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 16px;
}
.AvacyFeature sl-select::part(form-control-label) {
  font-size: 12px;
  color: var(--avacy-neutral-grey-secondary);
}

/* Gerarchia: titolo del form, poi tipo e id, poi le caratteristiche */
/* Sotto questa larghezza la tabella scorre invece di stringere titolo e celle (mobile) */
table.AvacyForms {
  min-width: 720px;
}
table.AvacyForms td.AvacyForms__Form {
  min-width: 200px;
}
.AvacyForms__Title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
  line-height: 1.3;
}
.AvacyForms__Meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #646970;
}
.AvacyForms__Label {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #646970;
}

/* Righe alternate per form: la riga del form e quella delle sue caratteristiche hanno lo stesso sfondo */
table.AvacyForms tbody.AvacyForms__Group:nth-of-type(even) {
  background: #f9fbff;
}

/* Lo switch accanto al titolo, a destra */
table.AvacyForms td.AvacyForms__Save {
  text-align: right;
}

/* Identificativo e dati da salvare, ognuno con la sua etichetta */
table.AvacyForms tbody tr.AvacyForms__Data td {
  padding-top: 12px;
  padding-bottom: 12px;
}
.AvacyData {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 16px 32px;
  align-items: start;
}
.AvacyData__Identifier sl-select {
  width: 100%;
}
.AvacyData__Checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 6px 0;
  border-radius: 4px;
}

/* Avviso informativo sotto il menu di una caratteristica di consenso */
.AvacyFeatureWarning {
  margin-top: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 12px;
  line-height: 1.3;
  color: #7a5b00;
  background: #fff8e1;
  border-left: 3px solid #dba617;
}
.AvacyFeatureWarning[hidden] {
  display: none;
}

/* Invio acceso senza identificativo */
table.AvacyForms tbody.warning-identifier sl-select[name$="_form_user_identifier"]::part(combobox) {
  border-color: red;
  background-color: #ffeeef;
}

/* Perche' «Save changes» e' spento, visibile da ogni scheda */
.AvacySubmitHint {
  margin-top: 8px;
  max-width: var(--description-max-width);
  font-size: 13px;
  color: #b32d2e;
}
.AvacySubmitHint[hidden] {
  display: none;
}
