/* ==========================================================
   MODERNIZE.CSS - Migliorie estetiche GeoPortale PNRR
   Colori invariati: #0059b3, #0073e6, #19191a
   Per rollback: rimuovere il <link> a questo file
   ========================================================== */

/* ---------------------------------------------------
   1. OMBRE PIU' LEGGERE E MODERNE (card, sidebar, tabelle)
   --------------------------------------------------- */
.card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.06) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease !important;
}

.card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

#sidebar .list-group {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.06) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.under-table {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.06) !important;
    border-radius: 8px !important;
}

/* ---------------------------------------------------
   2. BOTTONI MODERNI
   --------------------------------------------------- */
.btn-blu,
.btn-accedi,
.btn-report {
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 24px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(0, 89, 179, 0.25) !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px;
}

.btn-blu:hover,
.btn-accedi:hover,
.btn-report:hover {
    background-color: #004a99 !important;
    box-shadow: 0 4px 14px rgba(0, 89, 179, 0.35) !important;
    transform: translateY(-1px);
}

.btn-blu:active,
.btn-accedi:active,
.btn-report:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 89, 179, 0.25) !important;
}

/* Bottone disattiva filtro */
.btn-danger {
    border-radius: 8px !important;
    border: none !important;
    transition: all 0.2s ease !important;
}

/* ---------------------------------------------------
   3. CHECKBOX PERSONALIZZATI
   --------------------------------------------------- */
.form-check input.filtri[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #0059b3;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    transition: all 0.15s ease;
    margin-right: 6px;
}

.form-check input.filtri[type="checkbox"]:hover {
    border-color: #0073e6;
    background: #f0f6ff;
}

.form-check input.filtri[type="checkbox"]:checked {
    background-color: #0059b3;
    border-color: #0059b3;
}

.form-check input.filtri[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-check label {
    cursor: pointer;
    vertical-align: middle;
    padding-left: 2px;
}

/* ---------------------------------------------------
   4. TABELLA RISULTATI - RIGHE ZEBRATE BLU PALLIDO
   --------------------------------------------------- */
#table-risultati tbody tr:nth-child(even) {
    background-color: #f5f9ff;
}

#table-risultati tbody tr:hover {
    background-color: #e3eefa !important;
    transition: background-color 0.15s ease;
}

#table-risultati tbody tr {
    transition: background-color 0.15s ease;
}

/* Header tabella piu' moderno */
table.dataTable thead tr {
    background-color: #0059b3 !important;
    color: #fff !important;
}

table.dataTable thead th {
    color: #fff !important;
    font-weight: 600 !important;
    /* Mantieni padding originale per non disallineare le frecce di ordinamento */
}

/* Paginazione */
.dataTables_paginate .paginate_button.current {
    background: #0059b3 !important;
    color: #fff !important;
    border-color: #0059b3 !important;
    border-radius: 6px !important;
}

.dataTables_paginate .paginate_button:hover {
    background: #e3eefa !important;
    color: #0059b3 !important;
    border-color: #e3eefa !important;
    border-radius: 6px !important;
}

/* ---------------------------------------------------
   5. LIST-GROUP / SIDEBAR FILTRI - STILE PIU' PULITO
   --------------------------------------------------- */
.list-group-item {
    border: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    padding: 12px 16px !important;
    transition: all 0.15s ease !important;
}

.list-group-item:last-child {
    border-bottom: none !important;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background-color: #f0f6ff !important;
    color: #0059b3 !important;
}

.list-group-item.active {
    background-color: #e3eefa !important;
    color: #0059b3 !important;
    border-color: transparent !important;
    border-left: 3px solid #0059b3 !important;
    font-weight: 600;
}

.list-group-item.active .btn-delete-section {
    color: #0059b3 !important;
}

/* Titoli sezione filtri */
.list-group-item.bg-light {
    background-color: #f8fbff !important;
    border-bottom: 2px solid #e3eefa !important;
    padding: 14px 16px !important;
}

/* ---------------------------------------------------
   6. FONT SIZE BASE - MINIMO PIU' LEGGIBILE
   --------------------------------------------------- */
@media (min-width: 360px) {
    html, body {
        font-size: 12px !important;
    }
}

@media (min-width: 768px) {
    html, body {
        font-size: 13px !important;
    }
}

@media (min-width: 1200px) {
    html, body {
        font-size: 15px !important;
    }
}

/* ---------------------------------------------------
   7. HEADER STICKY - OMBRA PIU' SOTTILE
   --------------------------------------------------- */
header.ridotto .sticky-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* ---------------------------------------------------
   8. INDEX BOX (HOMEPAGE) - PIU' MORBIDE
   --------------------------------------------------- */
.index-box,
.index-box-md {
    border-radius: 12px !important;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

.index-box:hover,
.index-box-md:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

/* ---------------------------------------------------
   9. SCROLLBAR CUSTOM (SIDEBAR)
   --------------------------------------------------- */
.list-group::-webkit-scrollbar,
.list-group-flush::-webkit-scrollbar {
    width: 6px;
}

.list-group::-webkit-scrollbar-track,
.list-group-flush::-webkit-scrollbar-track {
    background: transparent;
}

.list-group::-webkit-scrollbar-thumb,
.list-group-flush::-webkit-scrollbar-thumb {
    background: rgba(0, 89, 179, 0.2);
    border-radius: 3px;
}

.list-group::-webkit-scrollbar-thumb:hover,
.list-group-flush::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 89, 179, 0.4);
}

/* ---------------------------------------------------
   10. FORM ELEMENTS - INPUT PIU' PULITI
   --------------------------------------------------- */
.form-control {
    border: 1.5px solid #c4d5e8 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.form-control:focus {
    border-color: #0073e6 !important;
    box-shadow: 0 0 0 3px rgba(0, 115, 230, 0.12) !important;
}

/* ---------------------------------------------------
   11. BADGE / ALERT LEGGERI
   --------------------------------------------------- */
.alert {
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

/* ---------------------------------------------------
   12. TOOLTIP MODALI
   --------------------------------------------------- */
.modal-content {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 12px 12px 0 0 !important;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}
