/*
 * Tema chiaro.
 * Sovrascrive i colori "dark" hardcoded (definiti in bootstrap_override.css e style.css)
 * quando l'attributo html[data-bs-theme="light"] è attivo.
 * Caricato DOPO style.css per avere priorità.
 */

/* Allinea i controlli nativi (date picker, scrollbar...) al tema scelto */
html[data-bs-theme="light"] {
    color-scheme: light;
}
html[data-bs-theme="dark"] {
    color-scheme: dark;
}

/* --- Base (da bootstrap_override.css) --- */
html[data-bs-theme="light"] body {
    background-color: #f5f5f5;
    color: #212529;
    /* La filigrana viene gestita dallo pseudo-elemento qui sotto per poterla attenuare */
    background-image: none;
}

/* Filigrana molto più tenue in tema chiaro */
html[data-bs-theme="light"] body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url(../img/logo/logo_filigrana3.png);
    background-repeat: no-repeat;
    background-size: 100%;
    background-position: center;
    opacity: 0.08;
}

html[data-bs-theme="light"] .form-control {
    background-color: #ffffff;
    color: #212529;
}
html[data-bs-theme="light"] .form-control:focus {
    background-color: #ffffff;
    color: #212529;
}
html[data-bs-theme="light"] .table-dark {
    color: #212529;
    --bs-table-color: #212529;
    --bs-table-bg: #f8f9fa;
    --bs-table-border-color: #dee2e6;
    /* Righe alternate solo leggermente più scure (basso contrasto) invece del quasi-nero */
    --bs-table-striped-bg: #eceef1;
    --bs-table-striped-color: #212529;
    --bs-table-active-bg: #e2e6ea;
    --bs-table-active-color: #212529;
    --bs-table-hover-bg: #e9ecef;
    --bs-table-hover-color: #212529;
}
html[data-bs-theme="light"] .footer {
    background-color: #e9ecef;
    color: #212529;
}
html[data-bs-theme="light"] .modal-content {
    background-color: #ffffff;
    border-color: #adb5bd;
    color: #212529;
}

/* Logo iniziale (intro/pre-login): le immagini sono bianche e invisibili su
   sfondo chiaro -> uso le varianti blu già esistenti (stesse dimensioni). */
html[data-bs-theme="light"] #logo_icona {
    content: url(../img/logo/logo_miafattura_2048_soloicona.png);
}
html[data-bs-theme="light"] #logo_miafattura {
    content: url(../img/logo/logo_miafattura_2048_solomiafattura.png);
}
html[data-bs-theme="light"] #logo_claim {
    content: url(../img/logo/logo_miafattura_2048_soloclaim.png);
}

/* --- Componenti (da style.css) --- */
html[data-bs-theme="light"] .form-control-plaintext {
    color: #212529 !important;
}

html[data-bs-theme="light"] .form-control:disabled,
html[data-bs-theme="light"] .form-control:read-only {
    background-color: #e9ecef;
}

html[data-bs-theme="light"] textarea:read-only,
html[data-bs-theme="light"] input:read-only,
html[data-bs-theme="light"] select:disabled,
html[data-bs-theme="light"] .select2-container--disabled .select2-selection__rendered {
    color: #6c757d !important;
}

html[data-bs-theme="light"] .info-box {
    background-color: #f1f3f5;
    border: 1px solid #ced4da;
    color: #343a40;
}

html[data-bs-theme="light"] .tbl_pacchetti thead,
html[data-bs-theme="light"] .tbl_pacchetti tfoot {
    background-color: #e9ecef;
}
html[data-bs-theme="light"] .tbl_pacchetti tbody tr:hover {
    background-color: #f1f3f5;
}

html[data-bs-theme="light"] .chart-container {
    background: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Select2 (le regole scure sono già limitate a [data-bs-theme="dark"]) */
html[data-bs-theme="light"] .select2-container--default .select2-selection--single {
    background-color: #ffffff !important;
    border-color: #ced4da;
}
html[data-bs-theme="light"] .select2-dropdown {
    background-color: #ffffff !important;
}
