/* Estilos para tabelas */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-top: 1px;
}

.table-wrapper {
    overflow-x: auto;
}

.table thead {
    /* position: sticky;
    top: 40px;
    padding: 10px 0;
    z-index: 3; */
}
.table thead tr {
    /* background: #FFFFFF99;
    backdrop-filter: blur(10px);
    border-radius: 5px;
    z-index: 3; */
}

.table th {
    font-size: 14px;
    font-weight: 900;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.table tbody tr:hover {
    background: rgba(136, 136, 136, 0.114);
}

.table-hover tbody tr:hover {
    background: rgba(136, 136, 136, 0.114);
}



/* Estilos para filtros de tabela */
.table-filters {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
    width: 100%;
    align-items: stretch;
    justify-content: flex-end;
}

.table-filters.multi-filters {
    display: flex;
    flex-wrap: wrap;
}

.table-filters .btn {
    min-width: 160px;
}

.img-thumbnail {
    border-radius: 50px;
    height: 40px;
    width: 40px;
    object-fit: cover;
    background: #55555555;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .table-container {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .table th {
        white-space: nowrap;
        min-width: 80px;
    }
    
    .table td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    .table td.actions {
        min-width: 100px;
        max-width: none;
        flex-direction: column;
        gap: 5px;
    }
    
    .table td.actions .btn {
        font-size: 11px;
        padding: 4px 8px;
        min-width: auto;
    }
    
    /* Table Filters Mobile */
    .table-filters {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .table-filters.multi-filters {
        flex-direction: column;
    }
    
    .filter-item {
        min-width: 100%;
        width: 100%;
    }
    
    .table-filters .btn {
        min-width: 100%;
        width: 100%;
    }
    
    /* Scroll hint for tables */
    .table-container::after {
        content: "← Deslize para ver mais →";
        display: block;
        text-align: center;
        font-size: 11px;
        color: var(--text);
        opacity: 0.6;
        padding: 10px;
        background: var(--card-bg);
        border-top: 1px solid var(--border-color);
    }
}

.filter-item {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    width: 100%;
    flex: 20%;
    /* justify-content: space-between; */
    justify-content: flex-start;

    position: relative;
}
.filter-item:has(.disabled) {
    cursor: not-allowed;
}

.filter-item:has(.material-symbols-rounded) .select-field,
.filter-item:has(.material-symbols-rounded) input{
    padding-left: 50px;
}

.filter-item:has(.material-symbols-rounded) .material-symbols-rounded {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 10px;
    font-size: 26px;
    color: #332a2a;
}

.filter-item.main-filter .material-symbols-rounded {
    color: #FFFFFF;
}

.filter-item.main-filter input {
    background: #FFFFFF11;
    color: #FFFFFF;
    border: none;
    max-width: 100%;
    width: 300px;
    margin: 0;
}

.filter-item.main-filter input:focus {
    border: solid 1px #FFFFFF99;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.1);
    width: 400px;
}

.filter-item.main-filter input::placeholder {
    color: #FFFFFF99;
}

html[data-color-scheme="light"] .filter-item.main-filter input {
    background: #00000011;
    color: #000000;
    border: solid 1px #00000022;
    max-width: 100%;
    width: 300px;
}

html[data-color-scheme="light"] .filter-item.main-filter input:focus {
    border: solid 1px #00000099;
    box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.1);
    width: 400px;
}

html[data-color-scheme="light"] .filter-item.main-filter input::placeholder {
    color: #00000099;
}

html[data-color-scheme="light"] .filter-item.main-filter .material-symbols-rounded {
    color: #000000;
}

.table-filters.multi-filters .filter-item {
    width: auto;
}

.saved-search {
    display: flex;
    gap: 10px;
    padding-right: 15px;
    border-right: solid 1px var(--border-color);
    margin-right: 10px;
}

/* .filter-item label {
    font-size: 12px;
    margin-bottom: 5px;
} */


/* Estilos para os grupos de filtros */
.filter-group {
    margin-bottom: 20px;
    padding: 0;
    border-radius: 10px;   
}

.filters .filter-group {
    /* background: #00000022; */
    border: solid 1px var(--border-color);
    border-radius: 10px;
    padding: 5px 10px;
    max-height: 1000px;
}

.filters .filter-group:not(.open) {
    transition: ease-in-out 0.3s;
    max-height: 57px;
}

.filter-group-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    transition: background-color 0.2s ease;
}


.filter-group-header span {
    margin-right: 0.5rem;
}

.filter-group-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.filter-group-content {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-group-content {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    display: flex; /* Para manter o flex, mas ele não será usado até que o conteúdo esteja visível */
    /* flex-direction: column; */
}

.filter-group.open .filter-group-content {
    max-height: 500px; /* Ajuste conforme necessário ou use algo alto o suficiente */
    opacity: 1;
    overflow: visible;
}



.section-header {
    width: 40%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-top: 40px;
    padding-bottom: 8px;
}

.section-header .material-symbols-rounded {
    font-size: 24px;
    background: var(--main);
    color: #000;
    padding: 10px;
    border-radius: 10px;
}

.section-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 200;
    margin-bottom: 10px;
}

.section-header p {
    font-size: 14px;
    font-weight: 400;
}

.section-body  {
    width: 60%;
}

/* .filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
    width: 100%;
} */

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-left: auto;
    flex: 100%;

    justify-content: flex-end;
}

/* Paginação */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.pagination-info {
    font-size: 14px;
    color: #888;
}

.pagination-controls {
    display: flex;
    gap: 5px;
}

.pagination-controls .btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-controls .active {
    background: var(--theme-color);
    color: white;
}





/*  --------------  */


.badge.bg-success {
    background-color: #28a745;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.badge.bg-secondary {
    background-color: #6c757d;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.badge.bg-danger {
    background-color: #dc3545;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.badge.bg-warning {
    background-color: #ffc107;
    color: black;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}
.badge.big-badge {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    width: 100%;
    text-align: center;
    display: block;
}

.table-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

/* Estilos para as tags de filtro */
.filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    transition: ease-in-out 300ms all;
}
.filter-list:has(.filter-tag){
    border-top: solid 1px var(--border-color);
    padding-top: 15px;
    margin-top: 15px;

}

.filter-tag {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--border-color);
    border-radius: 4px;
    padding: 5px 10px;
    padding-right: 35px;
    font-size: 0.85rem;
    /* border: var(--border-color) solid 1px; */
}
/* html[data-color-scheme="dark"] .filter-tag {
    background-color: #3d3d3d;
} */

.filter-tag-label {
    font-weight: 700;
    margin-right: 5px;
}

.filter-tag-value {
    margin-right: 5px;
    font-weight: 300;
    opacity: .8;
}

.filter-tag-remove {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 30px;
    font-size: 16px;
    cursor: pointer;
    margin-left: 5px;
    border-left: solid 1px var(--border-color);
    /* color: #dc3545; */
    /* font-weight: bold; */
}

.filter-tag-remove:hover {
    background: #00000033;
    /* color: #c82333; */
}

/* Estilos para ordenação na tabela */
.sort-link {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.sort-link:hover {
    color: #007bff;
    text-decoration: none;
}

.sort-icon {
    font-size: 16px;
    margin-left: 5px;
}

th {
    white-space: nowrap;
}