/* ==================== TABLE ==================== */
/* Tabella contatti e tutte le sue parti */

.contacts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

/* Colonne nascoste: !important per vincere display:flex/block dei layout responsive */
#contacts-table th.column-hidden,
#contacts-table td.column-hidden {
    display: none !important;
}

.contacts-table thead {
    background: rgba(179, 225, 255, 0.15);
    border-radius: 0.5rem;
}

.contacts-table th {
    padding: 1.125rem 0.9375rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(179, 225, 255, 0.2);
    position: relative;
}

.contacts-table th:last-child {
    border-right: none;
}

/* Colonna Note - solo header con colore leggermente diverso */
.contacts-table th[data-column="note"] {
    background: rgba(141, 209, 240, 0.25);
}

.contacts-table th.resizable {
    position: relative;
    min-width: 100px;
}

.checkbox-cell {
    width: 2.5rem;
    padding: 1.125rem 0.5rem;
    text-align: center;
}

.select-all-checkbox,
.contact-checkbox {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--celeste);
}

.contacts-table th.actions-header {
    width: 5rem;
    min-width: 5rem;
    max-width: 5rem;
    padding: 1.125rem 0.5rem;
}

.contacts-table th.checkbox-header {
    width: 2.5rem;
    min-width: 2.5rem;
    max-width: 2.5rem;
    padding: 1.125rem 0.5rem;
    text-align: center;
}

.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 0.5rem;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 20;
    user-select: none;
}

.resize-handle:hover {
    background: rgba(179, 225, 255, 0.5);
}

.resize-handle:active {
    background: rgba(179, 225, 255, 0.7);
}

.contacts-table th.resizable .resize-handle {
    right: 0;
    width: 0.5rem;
}

.contacts-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.contacts-table th.sortable:hover {
    background: rgba(179, 225, 255, 0.2);
}

.contacts-table th.sortable.active {
    background: rgba(179, 225, 255, 0.3);
}

.contacts-table th.sortable span {
    display: inline-block;
    margin-right: 0.5rem;
}

.sort-icon {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    z-index: 25;
    pointer-events: none;
}

.contacts-table th.sortable.active .sort-icon {
    opacity: 1;
}

.contacts-table th.sortable.active.asc .sort-icon path:first-child {
    opacity: 1;
}

.contacts-table th.sortable.active.desc .sort-icon path:last-child {
    opacity: 1;
}

.contacts-table td {
    padding: 1.125rem 0.9375rem;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 400;
    font-size: 0.95rem;
}

.contacts-table td:last-child {
    border-right: none;
}

.contacts-table tbody tr {
    transition: var(--transition);
    position: relative;
}

.contacts-table tbody tr:hover {
    background: rgba(179, 225, 255, 0.2);
    box-shadow: inset 0 0 20px rgba(179, 225, 255, 0.15);
}

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

.actions-cell {
    padding: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 0.375rem;
    justify-content: center;
    align-items: center;
}

.action-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    backdrop-filter: var(--blur-soft);
    -webkit-backdrop-filter: var(--blur-soft);
    box-shadow: var(--glow-soft);
    color: var(--text-secondary);
}

.action-btn-icon:hover {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: var(--blur-medium);
    -webkit-backdrop-filter: var(--blur-medium);
    transform: translateY(-1px) scale(1.05);
    box-shadow: var(--glow-medium);
}

.action-btn-icon.edit {
    color: var(--celeste-deep);
}

.action-btn-icon.edit:hover {
    background: rgba(179, 225, 255, 0.3);
    color: var(--celeste-deep);
}

.action-btn-icon.delete {
    color: #ff6b6b;
}

.action-btn-icon.delete:hover {
    background: rgba(255, 107, 107, 0.2);
    color: #ff5252;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.25);
}

.action-btn-icon svg {
    width: 16px;
    height: 16px;
}

.empty-state {
    text-align: center;
    padding: 3.75rem 1.25rem;
    color: var(--text-lighter);
    font-size: 1.1rem;
    text-shadow: 0 2px 6px rgba(179, 225, 255, 0.3);
}
