/* =====================================================================
 * DISTRO5 UI — Integrazioni di layout specifiche delle View DISTRO5
 * ---------------------------------------------------------------------
 * I colori da tema scuro sono stati corretti ALLA FONTE (custom.css,
 * datatables.css, views.css, vbo.css, pager.css, tables.css, elements.css,
 * color-green.css). Qui restano solo stili NUOVI legati al markup delle
 * View (schede di navigazione, fascia titolo, tabelle bootstrap-table).
 * ===================================================================== */


/* 4. HEADER DELLE VIEWS: barra di navigazione tra le viste ============ */
/* Nell'header delle View Release ci sono link "btn btn-info" (GRID,
 * SEARCH, LIST...) e un "btn btn-light text-info" con il conteggio.      */

body .view-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--d5-space-2);
  margin: 0 0 var(--d5-space-4);
  padding: var(--d5-space-3);
  background: var(--d5-surface);
  border: 1px solid var(--d5-border);
  border-radius: var(--d5-radius);
  box-shadow: var(--d5-shadow);
}

/* Schede di navigazione */
body .view-header a.btn.btn-info {
  display: inline-flex;
  align-items: center;
  gap: var(--d5-space-2);
  margin: 0;
  padding: 10px 18px;
  background: var(--d5-primary-soft);
  border: 1px solid transparent;
  border-radius: var(--d5-radius-sm);
  box-shadow: none;
  color: var(--d5-text);
  font-size: var(--d5-fs);
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  text-transform: uppercase;
}
body .view-header a.btn.btn-info:hover,
body .view-header a.btn.btn-info:focus {
  background: #cfeafb;
  color: var(--d5-primary-dark);
}
body .view-header a.btn.btn-info::before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 15px;
  color: var(--d5-primary);
}
body .view-header a.btn.btn-info[href$="/release-grid"]::before          { content: "\f009"; } /* griglia */
body .view-header a.btn.btn-info[href$="/release-search"]::before        { content: "\f002"; } /* lente */
body .view-header a.btn.btn-info[href$="/releases-list"]::before         { content: "\f03a"; } /* elenco */
body .view-header a.btn.btn-info[href$="/releases-list-yearly"]::before  { content: "\f133"; } /* calendario */
body .view-header a.btn.btn-info[href$="/releases-presence"]::before     { content: "\f007"; } /* utente */
body .view-header a.btn.btn-info[href$="/releases-imported-list"]::before{ content: "\f019"; } /* download */
body .view-header a.btn.btn-info[href$="/releases-tab"]::before          { content: "\f0c1"; } /* link */

/* Scheda della pagina corrente: blu pieno (classe path-* sul body) */
body.path-release-grid         .view-header a.btn.btn-info[href$="/release-grid"],
body.path-release-search       .view-header a.btn.btn-info[href$="/release-search"],
body.path-releases-list        .view-header a.btn.btn-info[href$="/releases-list"],
body.path-releases-list-yearly .view-header a.btn.btn-info[href$="/releases-list-yearly"],
body.path-releases-presence    .view-header a.btn.btn-info[href$="/releases-presence"],
body.path-releases-imported-list .view-header a.btn.btn-info[href$="/releases-imported-list"],
body.path-releases-tab         .view-header a.btn.btn-info[href$="/releases-tab"] {
  background: var(--d5-primary-gradient);
  border-color: var(--d5-primary-dark);
  color: var(--d5-on-primary);
}
body.path-release-grid         .view-header a.btn.btn-info[href$="/release-grid"]::before,
body.path-release-search       .view-header a.btn.btn-info[href$="/release-search"]::before,
body.path-releases-list        .view-header a.btn.btn-info[href$="/releases-list"]::before,
body.path-releases-list-yearly .view-header a.btn.btn-info[href$="/releases-list-yearly"]::before,
body.path-releases-presence    .view-header a.btn.btn-info[href$="/releases-presence"]::before,
body.path-releases-imported-list .view-header a.btn.btn-info[href$="/releases-imported-list"]::before,
body.path-releases-tab         .view-header a.btn.btn-info[href$="/releases-tab"]::before {
  color: var(--d5-on-primary);
}

/* "Displaying 1 - 50 of 106": testo informativo, allineato a destra */
body .view-header a.btn.btn-light.text-info {
  margin-left: auto;
  padding: 6px 12px;
  background: var(--d5-surface-3);
  border: 1px solid var(--d5-border);
  border-radius: 999px;
  box-shadow: none;
  color: var(--d5-text-muted) !important;
  font-size: var(--d5-fs-sm);
  font-weight: 600;
  cursor: default;
  pointer-events: none;
}


/* 6. PULSANTI BOOTSTRAP usati nelle View (btn-info, btn-light) ========= */
body .btn-info {
  background: var(--d5-primary-soft);
  border-color: transparent;
  color: var(--d5-primary-soft-text);
}
body .btn-info:hover,
body .btn-info:focus {
  background: #cfeafb;
  border-color: transparent;
  color: var(--d5-primary-dark);
}
body .btn-light {
  background: var(--d5-surface);
  border-color: var(--d5-border-strong);
  color: var(--d5-text);
}
body .text-info {
  color: var(--d5-primary-dark) !important;
}


/* 7. FASCIA TITOLO PAGINA (blocco Views current_user_info / block_2) == */
/* Nell'header c'è un blocco con utente + <span class="page_title">.
 * Diventa una barra: titolo grande a sinistra, utente e ruolo a destra. */

body .header-second {
  padding: 0;
  background: rgba(0, 0, 0, .18);
  border-top: 1px solid rgba(255, 255, 255, .08);
}
body .view-current-user-info.view-display-id-block_2 .view-content > .d-flex {
  align-items: center;
  gap: var(--d5-space-4);
  min-height: 52px;
  padding: var(--d5-space-2) var(--d5-space-5);
}

/* Titolo della pagina */
body .view-current-user-info.view-display-id-block_2 .page_title {
  margin: 0;
  text-align: left;
  order: 1;
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  text-transform: none;
}
body .view-current-user-info.view-display-id-block_2 .page_title::first-letter {
  text-transform: uppercase;
}

/* Utente a destra: avatar, nome, ruolo */
body .view-current-user-info.view-display-id-block_2 .user_title {
  order: 2;
  display: inline-flex;
  align-items: center;
  gap: var(--d5-space-2);
  margin-left: auto;
  padding: 4px 12px 4px 4px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  color: #ffffff;
  font-size: var(--d5-fs);
  font-weight: 600;
  white-space: nowrap;
}
body .view-current-user-info.view-display-id-block_2 .user_title img {
  display: block;
  width: auto;
  height: 28px;
  padding: 2px 6px;
  background: #ffffff;
  border-radius: 999px;
}
body .view-current-user-info.view-display-id-block_2 .views-field-nothing,
body .view-current-user-info.view-display-id-block_2 .views-field-uid {
  display: none;
}
body .view-current-user-info.view-display-id-block_2 .views-field-roles-target-id .text-info {
  color: #9fd6f2 !important;
  font-weight: 400;
}


/* 8. TABELLE VIEWS (views-table + bootstrap-table) ==================== */

/* Contenitore bootstrap-table: card bianca */
body .bootstrap-table .fixed-table-container {
  background: var(--d5-surface);
  border: 1px solid var(--d5-border);
  border-radius: var(--d5-radius);
  box-shadow: var(--d5-shadow);
  overflow: hidden;
}
body .bootstrap-table .fixed-table-container table {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Testo e link nelle righe */
body table.views-table.views-view-table tbody td {
  color: var(--d5-text-body);
  vertical-align: middle;
}
body table.views-view-table tbody a,
body table.views-view-table tbody a:visited {
  color: var(--d5-link);
}
body table.views-view-table tbody a:hover {
  color: var(--d5-link-hover);
}

/* UPC/ISRC: niente verde Bootstrap, carattere a spaziatura fissa */
body table.views-view-table td.views-field-field-upc,
body table.views-view-table td.views-field-field-isrc {
  font-family: var(--d5-font-mono);
  font-size: var(--d5-fs-sm);
}
body table.views-view-table td.text-success,
body table.views-view-table td.text-success a {
  color: var(--d5-text-body) !important;
}

/* Pulsanti nelle righe (btn-light): azzurro tenue, come "Generate" del mockup */
body table.views-view-table tbody a.btn.btn-light {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--d5-primary-soft);
  border: 1px solid transparent;
  border-radius: var(--d5-radius-sm);
  box-shadow: none;
  color: var(--d5-primary-soft-text);
  font-size: var(--d5-fs-sm);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
body table.views-view-table tbody a.btn.btn-light small {
  font-size: inherit;
  font-weight: inherit;
}
body table.views-view-table tbody a.btn.btn-light:hover {
  background: #cfeafb;
  color: var(--d5-primary-dark);
}
/* Smart link: ingranaggio su "Generate", lente su "Search & Generate" */
body table.views-view-table tbody a.btn.btn-light[href*="smart-link"]::before {
  content: "\f013";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
}
body table.views-view-table tbody a.btn.btn-light[href*="smart-link"][href*="search=1"] {
  background: var(--d5-surface);
  border-color: var(--d5-border-strong);
  color: var(--d5-text);
}
body table.views-view-table tbody a.btn.btn-light[href*="smart-link"][href*="search=1"]:hover {
  border-color: var(--d5-primary);
  color: var(--d5-primary-dark);
}
body table.views-view-table tbody a.btn.btn-light[href*="smart-link"][href*="search=1"]::before {
  content: "\f002";
}

/* Link "edit": nessuna icona aggiunta qui (alcune View hanno già la loro matita) */

/* Barra strumenti bootstrap-table (campo Cerca) */
body .bootstrap-table .fixed-table-toolbar {
  margin-bottom: var(--d5-space-3);
}
body .bootstrap-table .fixed-table-toolbar .search input {
  min-width: 260px;
  min-height: 38px;
  padding-left: 34px;
  background-color: var(--d5-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2349608a' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  border: 1px solid var(--d5-field-border);
  border-radius: var(--d5-radius-sm);
  color: var(--d5-field-text) !important;
}
body .bootstrap-table .fixed-table-toolbar .search input:focus {
  border-color: var(--d5-primary);
  box-shadow: var(--d5-focus-ring);
  outline: none;
}

/* bootstrap-table: il padding lo dà .th-inner */
body .bootstrap-table table.views-table.views-view-table thead th {
  padding: 0;
}
body .bootstrap-table table.views-table.views-view-table thead th .th-inner {
  padding: 5px 6px;
  line-height: 1.3;
  color: var(--d5-th-text);
  font-weight: var(--d5-th-weight);
}

/* Pulsanti dentro le celle più compatti */
body table.views-view-table tbody a.btn,
body table.views-view-table tbody .btn {
  padding: 2px 8px;
}

/* Intestazioni ordinabili: i link erano bianchi (illeggibili sull'azzurro) */
body table.views-view-table thead th a,
body table.views-view-table thead th a:visited,
body table.views-view-table thead th .th-inner a {
  color: var(--d5-th-text);
  font-weight: var(--d5-th-weight);
  text-decoration: none;
}
body table.views-view-table thead th a:hover {
  color: var(--d5-primary-dark);
}
body table.views-view-table thead th.is-active a,
body table.views-view-table thead th a.is-active {
  color: var(--d5-primary-dark);
}


/* 9. Riquadri .bg-info / .bg-warning (ora chiari, vedi custom.css): il testo
   impostato come "text-light"/"text-white" nei form diventerebbe invisibile */
body .bg-info .text-light, body .bg-info .text-white,
body .bg-warning .text-light, body .bg-warning .text-white,
body .bg-info.text-light, body .bg-info.text-white,
body .bg-warning.text-light, body .bg-warning.text-white {
  color: var(--d5-text, #19274c) !important;
}
/* etichette dei form segnate "text-light"/"text-white" su sfondo ormai chiaro */
body form label.text-light, body form label.text-white,
body form .form-item > .text-light, body form .form-item > .text-white {
  color: var(--d5-text, #19274c) !important;
}
