/* Styles pour le tableau CSV to Table */
.owoxa-csv-to-table {
    overflow-x: auto;
    max-width: 100%;
}

.owoxa-table-search {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.owoxa-table-search input {
    padding: 8px;
    width: 100%;
    max-width: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.owoxa-table-search label {
    font-size: 14px;
    color: #666;
}

.owoxa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    text-align: left;
}

.owoxa-csv-to-table.owoxa-spacing-on .owoxa-table {
    margin: 20px 0 !important;
}

.owoxa-csv-to-table:not(.owoxa-spacing-on) .owoxa-table {
    margin: 0 !important;
}

.owoxa-table th,
.owoxa-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    vertical-align: middle;
}

.owoxa-table th {
    background-color: #f4f4f4;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    padding-right: 30px;
}

.owoxa-table th .sort-icon-container {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    z-index: 10; /* Priorité sur les autres éléments */
}

.owoxa-table th .sort-icon-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.owoxa-table th .sort-icon {
    display: block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    margin: 0;
    transition: border-color 0.3s ease; /* Transition fluide */
}

.owoxa-table th .sort-icon-up {
    border-bottom: 5px solid #aaa;
}

.owoxa-table th .sort-icon-down {
    border-top: 5px solid #aaa;
}

.owoxa-table th .sort-icon-up.active,
.owoxa-table th .sort-icon-down.active {
    border-color: #000 !important; /* Renforcer la priorité */
}

/* Styles de base laissés pour compatibilité */
.owoxa-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.owoxa-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .owoxa-table-search {
        flex-direction: column;
        align-items: flex-start;
    }

    .owoxa-table-search input {
        max-width: 100%;
    }

    .owoxa-table thead {
        display: none;
    }

    .owoxa-table tr {
        display: block;
        margin-bottom: 10px;
        border-bottom: 2px solid #ddd;
    }

    .owoxa-table td {
        display: block;
        text-align: right;
        position: relative;
        padding-left: 50%;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .owoxa-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
    }
}