/* Tableaux récapitulatifs (scraps, équipements, etc.) */

#scraps-content,
#items-content,
#fear-table-wrap {
    width: 100%;
}

#scraps-search-bar,
#items-search-bar,
#fear-search-bar {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

#scraps-search-input,
#items-search-input,
#fear-search-input {
    width: 100%;
    max-width: 480px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s ease, background 0.2s ease;
}

#scraps-search-input::placeholder,
#items-search-input::placeholder,
#fear-search-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

#scraps-search-input:focus,
#items-search-input:focus,
#fear-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

#scraps-table,
#items-table,
#fear-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#scraps-table caption,
#items-table caption,
#fear-table caption {
    caption-side: top;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

#scraps-table th,
#scraps-table thead,
#scraps-table td,
#items-table th,
#items-table thead,
#items-table td,
#fear-table th,
#fear-table thead,
#fear-table td {
    padding: 12px 18px;
    text-align: left;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    vertical-align: middle;
}

#scraps-table thead,
#items-table thead,
#fear-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

#scraps-table thead th,
#items-table thead th,
#fear-table thead th {
    background: rgba(0, 0, 0, 0.6);
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}

#scraps-table thead th:first-child,
#items-table thead th:first-child,
#fear-table thead th:first-child {
    border-top-left-radius: 15px;
}

#scraps-table thead th:last-child,
#items-table thead th:last-child,
#fear-table thead th:last-child {
    border-top-right-radius: 15px;
}

#scraps-table tbody tr:last-child td:first-child,
#items-table tbody tr:last-child td:first-child,
#fear-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 15px;
}

#scraps-table tbody tr:last-child td:last-child,
#items-table tbody tr:last-child td:last-child,
#fear-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 15px;
}

#scraps-table tbody tr:hover td,
#items-table tbody tr:hover td,
#fear-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.06);
}

#scraps-table tbody tr[hidden],
#items-table tbody tr[hidden],
#fear-table tbody tr[hidden] {
    display: none;
}

#scraps-table tbody tr:last-child td,
#items-table tbody tr:last-child td,
#fear-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.data-table-sortable:hover,
.data-table-sortable:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.data-table-sortable.is-sorted-asc::after,
.data-table-sortable.is-sorted-desc::after {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.75rem;
    opacity: 0.85;
}

.data-table-sortable.is-sorted-asc::after {
    content: '▲';
}

.data-table-sortable.is-sorted-desc::after {
    content: '▼';
}

@media (max-width: 768px) {
    #scraps-content,
    #items-content,
    #fear-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #scraps-table th,
    #scraps-table td,
    #items-table th,
    #items-table td,
    #fear-table th,
    #fear-table td {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}
