/* =================================== */
/* COMPONENT: TABLES                   */
/* Classes pour tableaux admin         */
/* =================================== */

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
}

.table thead {
    background-color: var(--gold);
    color: var(--bee-light);
}

.table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    border-bottom: 2px solid var(--bee-dark);
}

.table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--bee-gray-light);
    transition: background-color var(--transition-normal);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Column width utilities */
.col-image {
    width: 80px;
}

.col-type {
    width: 120px;
}

.col-price {
    width: 150px;
}

.col-status {
    width: 120px;
}

.col-active {
    width: 100px;
}

.col-date {
    width: 100px;
}

.col-actions {
    width: 150px;
    text-align: center;
}

/* Table variants */
.table-striped tbody tr:nth-child(odd) {
    background-color: var(--bee-gray-light);
}

.table-hover tbody tr:hover {
    background-color: #e9ecef;
    cursor: pointer;
}

.table-bordered {
    border: 1px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

/* Table cell modifiers */
.table-cell-image {
    text-align: center;
}

.table-cell-image img {
    max-width: 100%;
    height: auto;
}

.table-cell-badge {
    text-align: center;
}

.table-cell-number {
    text-align: right;
    font-weight: var(--font-weight-medium);
}

.table-cell-status {
    text-align: center;
}

/* Action buttons in tables */
.table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.table-action-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.table-action-btn-primary {
    background-color: var(--bee-yellow);
    color: var(--bee-dark);
}

.table-action-btn-primary:hover {
    background-color: var(--bee-yellow-hover);
    transform: translateY(-1px);
}

.table-action-btn-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.table-action-btn-danger:hover {
    background-color: #f5c6cb;
    transform: translateY(-1px);
}

.table-action-btn-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.table-action-btn-info:hover {
    background-color: #bee5eb;
    transform: translateY(-1px);
}

/* Responsive table wrapper */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

/* Table barème - empêche le retour à la ligne sur mobile */
.table-bareme th,
.table-bareme td {
    white-space: nowrap;
}

.table-bareme .text-bee {
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .col-image {
        width: 60px;
    }

    .col-type {
        width: 100px;
    }

    .col-price {
        width: 120px;
    }

    .col-status {
        width: 100px;
    }

    .col-active {
        width: 80px;
    }

    .col-date {
        width: 80px;
    }

    .col-actions {
        width: 120px;
    }

    .table th,
    .table td {
        padding: var(--spacing-sm);
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .col-image {
        width: 50px;
    }

    .col-type {
        width: 80px;
    }

    .col-price {
        width: 100px;
    }

    .col-status {
        width: 80px;
    }

    .col-active {
        width: 70px;
    }

    .col-date {
        width: 70px;
    }

    .col-actions {
        width: 100px;
    }

    .table th,
    .table td {
        padding: var(--spacing-xs);
        font-size: 0.75rem;
    }

    .table-action-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Réduction du padding pour le tableau barème sur très petits écrans */
    .table-bareme th,
    .table-bareme td {
        padding: 0.5rem 0.375rem !important;
        font-size: 0.7rem;
    }

    .table-bareme .h5 {
        font-size: 0.875rem;
    }

    .table-bareme strong {
        font-size: 0.7rem;
    }

    .table-bareme small {
        font-size: 0.65rem;
    }
}
