/* Custom Overrides for W-Livre */

/* VISIBILIDADE DOS BOTÕES DE TEMA */
[data-bs-theme="dark"] .hide-theme-dark {
    display: none !important;
}

[data-bs-theme="light"] .hide-theme-light,
html:not([data-bs-theme="dark"]) .hide-theme-light {
    display: none !important;
}

/* 
   FIX OFFCANVAS SIDEBAR ON DESKTOP & DARK MODE
*/
@media (min-width: 992px) {
    .offcanvas-start {
        position: static !important;
        transform: none !important;
        visibility: visible !important;
        width: auto !important;
        height: auto !important;
        background-color: transparent !important;
        border: none !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .offcanvas-header {
        display: none !important;
    }

    .offcanvas-body {
        padding: 0 !important;
        overflow: visible !important;
    }
}

/* OFFCANVAS DARK MODE (Mobile Fix) */
[data-bs-theme="dark"] .offcanvas,
[data-bs-theme="dark"] .offcanvas-start,
[data-bs-theme="dark"] .offcanvas-header,
[data-bs-theme="dark"] .offcanvas-body {
    background-color: #1a2234 !important;
    /* Mesma cor da sidebar dark */
    color: #ffffff !important;
}

[data-bs-theme="dark"] .offcanvas .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* =========================================
   DARK MODE - TABLE FIX (PRIORIDADE MÁXIMA)
   ========================================= */

[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .table> :not(caption)>*>*,
[data-bs-theme="dark"] .table-vcenter td,
[data-bs-theme="dark"] .table-vcenter th {
    background-color: transparent !important;
    color: #e2e8f0 !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .table thead th {
    background-color: #111827 !important;
    color: #ffffff !important;
    border-bottom: 2px solid #374151 !important;
}

[data-bs-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

[data-bs-theme="dark"] body {
    background-color: #0f172a !important;
}

[data-bs-theme="dark"] .card {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .modal-content {
    background-color: #1e293b !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1);
}

/* Suggestions Dropdown Theme Fix */
#mov-prod-suggestions {
    background-color: var(--tblr-card-bg, #fff) !important;
    border: 1px solid var(--tblr-border-color);
}

[data-bs-theme="dark"] #mov-prod-suggestions {
    background-color: var(--tblr-bg-surface-dark, #1f293b) !important;
    color: var(--tblr-body-color);
}

[data-bs-theme="dark"] #mov-prod-suggestions .list-group-item {
    background-color: transparent;
    color: inherit;
    border-color: var(--tblr-border-color);
}

[data-bs-theme="dark"] #mov-prod-suggestions .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}