/* css/tables.css */
.table-container {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 1rem;
}

.data-table {
    width: 100%;
    overflow-x: auto;
}

.table-header {
    display: flex;
	justify-content: space-evenly;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    min-width: max-content;
}

.th {
    padding: 0.875rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.th.sortable:hover {
    color: var(--text-primary);
}

.th i {
    font-size: var(--font-size-xs);
    opacity: 0.5;
}

.checkbox-col {
    width: 40px;
    justify-content: center;
}

.actions-col {
    width: 120px;
    justify-content: center;
}

.table-body {
    min-width: max-content;
}

.table-row {
    display: flex;
	justify-content: space-evenly;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    min-width: max-content;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background-color: var(--bg-hover);
}

.td {
    padding: 1rem;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.td.checkbox-col {
    justify-content: center;
}

.td.actions-col {
    justify-content: center;
    gap: 0.5rem;
}

/* Column widths for requests table */
.th:nth-child(2), .td:nth-child(2) { width: 60px; }
.th:nth-child(3), .td:nth-child(3) { width: 100px; }
.th:nth-child(4), .td:nth-child(4) { width: 200px; }
.th:nth-child(5), .td:nth-child(5) { width: 120px; }
.th:nth-child(6), .td:nth-child(6) { width: 300px; }
.th:nth-child(7), .td:nth-child(7) { width: 120px; }
.th:nth-child(8), .td:nth-child(8) { width: 120px; }
.th:nth-child(9), .td:nth-child(9) { width: 150px; }

/* Column widths for addresses table */
#addressesTable .th:nth-child(2), #addressesTable .td:nth-child(2) { width: 80px; }
#addressesTable .th:nth-child(3), #addressesTable .td:nth-child(3) { width: 300px; }
#addressesTable .th:nth-child(4), #addressesTable .td:nth-child(4) { width: 150px; }
#addressesTable .th:nth-child(5), #addressesTable .td:nth-child(5) { flex: 1; min-width: 300px; }

/* Column widths for car types table */
#carTypesTable .th:nth-child(2), #carTypesTable .td:nth-child(2) { width: 60px; }
#carTypesTable .th:nth-child(3), #carTypesTable .td:nth-child(3) { width: 100px; }
#carTypesTable .th:nth-child(4), #carTypesTable .td:nth-child(4) { flex: 1; min-width: 200px; }

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: var(--font-size-sm);
}

.action-btn.view {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

.action-btn.view:hover {
    background-color: var(--info);
    color: white;
}

.action-btn.edit {
    background-color: var(--accent-primary);
    color: white;
}

.action-btn.edit:hover {
    background-color: var(--accent-hover);
}

.action-btn.delete {
    background-color: var(--danger);
    color: white;
}

.action-btn.delete:hover {
    background-color: #dc2626;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.status-evacuated {
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-indicator.active {
    background-color: var(--success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.status-indicator.inactive {
    background-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    border-radius: var(--radius-md);
    background-color: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.page-btn.active {
    background-color: var(--accent-primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    margin-left: 1rem;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* Mobile Cards */
.mobile-cards {
    display: none;
    padding: 1rem;
    gap: 1rem;
    flex-direction: column;
}

.mobile-card {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-card-id {
    font-weight: 600;
    color: var(--accent-primary);
}

.mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
}

.mobile-card-label {
    color: var(--text-muted);
}

.mobile-card-value {
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}