/**
 * Tabloj - Formatado (forme et mise en page)
 * Structure : dimensions, espacements, typographie, border-radius
 * Inspiré du template ATUM de Joomla
 */

/* ==========================================================================
   Conteneur principal
   ========================================================================== */

.tabelo-container {
    position: relative;
}

/* ==========================================================================
   En-tête de page (titre + description)
   ========================================================================== */

.tabelo-container .table-header {
    margin-bottom: 0.75rem;
}

.tabelo-container .table-header h2,
.tabelo-container .table-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.tabelo-container .table-header p {
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* ==========================================================================
   Barre d'outils (recherche, filtres, actions en masse)
   ========================================================================== */

.tabelo-container .table-toolbar {
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.tabelo-container .table-search .input-group {
    min-width: 220px;
}

/* Filtres actifs (badges) */
.tabelo-container .table-active-filters .badge {
    font-weight: 400;
    font-size: 0.8rem;
    padding: 0.35em 0.65em;
    border: 1px solid transparent;
    border-radius: var(--osun-radius-md, 0.375rem);
}

.tabelo-container .table-active-filters .btn-close {
    font-size: 0.5rem;
    padding: 0.25rem;
}

/* Filtres inline */
.tabelo-container .table-filters .filter-text,
.tabelo-container .table-filters .filter-select,
.tabelo-container .table-filters .filter-date,
.tabelo-container .table-filters .filter-boolean {
    min-width: 150px;
}

/* ==========================================================================
   Wrapper table-responsive
   ========================================================================== */

.tabelo-container .table-responsive {
    border-radius: var(--osun-radius-md, 0.375rem);
    overflow: hidden;
}

/* ==========================================================================
   Table - Structure principale (style ATUM)
   ========================================================================== */

.tabelo-container .table {
    margin-bottom: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    border-collapse: collapse;
    width: 100%;
}

/* thead */
.tabelo-container .table > thead {
    position: relative;
}

.tabelo-container .table > thead > tr > th {
    padding: 1rem 0.75rem 1rem 0rem;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
    vertical-align: middle;
    border-bottom-width: 2px;
}

.tabelo-container .table > thead > tr > th.table-select-all {
    font-size: 0.875rem;
}

/* Colonne tri */
.tabelo-container .table th.sortable a {
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tabelo-container .table th.sortable a .icon-chevron-up,
.tabelo-container .table th.sortable a .icon-chevron-down {
    font-size: 0.625rem;
}

/* Checkbox d'en-tête */
.tabelo-container .table .table-select-all {
    width: 40px;
    padding: 0.75rem 0.5rem;
    text-align: center;
}

/* tbody */
.tabelo-container .table > tbody > tr > td {
    padding: 1rem 0.75rem 1rem 0rem;
    vertical-align: middle;
}

.tabelo-container .table > tbody > tr > td:first-child {
    padding: 0.75rem 1rem;
}

/* Alignement des colonnes */
.tabelo-container .table-column-header,
.tabelo-container .table-column-cell {
    vertical-align: middle;
}

/* Lignes avec transition */
.tabelo-container .table-row {
    transition: background-color 0.15s ease-in-out;
}

/* ==========================================================================
   Colonnes spécialisées
   ========================================================================== */

/* Images */
.tabelo-container .table-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--osun-radius-md, 0.375rem);
}

/* Avatar stack */
.tabelo-container .avatar-stack {
    display: flex;
    align-items: center;
}

.tabelo-container .avatar-stack-item {
    margin-left: -8px;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
}

.tabelo-container .avatar-stack-item:first-child {
    margin-left: 0;
}

.tabelo-container .avatar-stack-more {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
}

/* Color swatch */
.tabelo-container .color-swatch {
    flex-shrink: 0;
    border-radius: var(--osun-radius-md, 0.375rem);
}

/* Progress bar */
.tabelo-container .progress {
    min-width: 80px;
    height: 0.5rem;
    border-radius: 1rem;
}

/* Copy button */
.tabelo-container .copy-btn {
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    line-height: 1;
}

.tabelo-container tr:hover .copy-btn,
.tabelo-container .d-flex:hover .copy-btn {
    opacity: 1;
}

/* ==========================================================================
   Actions de ligne
   ========================================================================== */

.tabelo-container .table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    border-radius: var(--osun-radius-md, 0.375rem);
}

.tabelo-container .table .btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.tabelo-container .table .dropdown-menu {
    font-size: 0.875rem;
    min-width: 10rem;
    border-radius: var(--osun-radius-md, 0.375rem);
}

/* ==========================================================================
   Actions en masse (bulk actions)
   ========================================================================== */

.tabelo-container [data-bulk-actions] {
    transition: opacity 0.15s ease-in-out;
}

.tabelo-container .bulk-actions-bar {
    padding: 0.5rem 1rem;
    border-radius: var(--osun-radius-md, 0.375rem);
    font-size: 0.875rem;
}

/* ==========================================================================
   Etat vide
   ========================================================================== */

.tabelo-container .table-empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.tabelo-container .table-empty-state .empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tabelo-container .table-empty-state h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tabelo-container .table-empty-state p {
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.tabelo-container .table-pagination {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tabelo-container .table-pagination .pagination {
    margin-bottom: 0;
}

.tabelo-container .table-pagination .page-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    border-radius: 0;
}

.tabelo-container .table-pagination .page-item:first-child .page-link {
    border-top-left-radius: var(--osun-radius-md, 0.375rem);
    border-bottom-left-radius: var(--osun-radius-md, 0.375rem);
}

.tabelo-container .table-pagination .page-item:last-child .page-link {
    border-top-right-radius: var(--osun-radius-md, 0.375rem);
    border-bottom-right-radius: var(--osun-radius-md, 0.375rem);
}

/* ==========================================================================
   Modal de confirmation
   ========================================================================== */

.tabelo-container .modal .modal-content {
    border-radius: var(--osun-radius-md, 0.375rem);
}

.tabelo-container .modal .modal-header {
    padding: 1rem 1.25rem;
}

.tabelo-container .modal .modal-body {
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
}

.tabelo-container .modal .modal-footer {
    padding: 0.75rem 1.25rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767.98px) {
    .tabelo-container .table > thead > tr > th,
    .tabelo-container .table > tbody > tr > td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .tabelo-container .table-pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .tabelo-container .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 575.98px) {
    .tabelo-container .table > thead > tr > th,
    .tabelo-container .table > tbody > tr > td {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
}
