/* Modern Table Styling */
.user-contacts-wrapper {
    /* margin: 2rem auto; */
    /* max-width: 1200px; */
    font-family: 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.contact-filters {
    background: #f8f9fa;
    padding-top: 0.5rem;
    /* padding: 1.5rem; */
    border-bottom: 1px solid #e0e0e0;
}

.contact-filters th {
    /* padding: 1rem; */
    padding: 0px 5px 5px;
    text-align: center;
}

.detail-row{
    margin-bottom: 5px;
}

.detail-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
}

.filters-button a {
    margin-top: 8px;
    margin-right: 4px;
    margin-left: 4px;
}

.filter-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    margin-top: 0.5rem;
    transition: border-color 0.2s;
}

.filter-input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

table.widefat {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
}

table.widefat thead th {
    background: #f1f1f1;
    position: sticky;
    top: 0;
    cursor: pointer;
    transition: background 0.2s;
}

table.widefat th a {
    color: #333;
    text-decoration: none;
    align-items: center;
    justify-content: center;
}

table, td, th {
    border: 0px;
    /* border: 1px solid var(--ast-border-color); */
}

tbody tr:hover {
    background: #f8f9fa;
    transition: background 0.2s;
}

tbody td {
    /* padding: 1.25rem; */
    border-bottom: 1px solid #eee;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1.5rem;
    background: #f8f9fa;
}

.pagination a {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    background: white;
    border: 1px solid #dee2e6;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #e9ecef;
}

.pagination .current {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.button {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    transition: transform 0.2s;
}

.button-mini {
    border-radius: 6px;
    transition: transform 0.2s;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: #0d6efd;
    border: none;
}

.button-secondary {
    background: #6c757d;
}

.actions-column {
    white-space: nowrap;
    text-align: center;
}

.button-danger {
    background: #dc3545 !important;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.button-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 2px rgba(0,0,0,0.1);
}

.button-view {
    background: #28a745 !important;
    border: none;
    color: white;
    margin-right: 5px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.button-view:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 2px rgba(0,0,0,0.1);
}

.button-filter {
    background:rgb(53, 81, 220) !important;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashicons {
    font-size: 14px;
    color: #666;
}

.dashicons-filter {
    color: white;
    font-size: 1.25em;
    width: 1em;
    height: 1em;
}

.dashicons-no {
    color: white;
    font-size: 1.25em;
    width: 1em;
    height: 1em;
}

.dashicons-trash {
    color: white;
    font-size: 1.25em;
    width: 1em;
    height: 1em;
}

.dashicons-visibility {
    color: white;
    font-size: 1.25em;
    width: 1em;
    height: 1em;
}

.dashicons-edit {
    color: white;
    font-size: 1.25em;
    width: 1em;
    height: 1em;
}

/* Modal styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 50%; /* Half width */
    margin-left: 25%; /* Centered */
    height: 100%; /* Full height */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    /*width: 80%; */ /* Could be more or less, depending on screen size */
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto; /* Center the spinner */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Edit Modal Styles */
#edit-contact-modal .modal-content {
    width: 100%;
    max-width: 100%; /* Updated to 100% */
    padding: 0px 20px 0px 20px;
}

.edit-contact-form {
    margin-top: 50px;
}

.edit-contact-form .form-row {
    margin-bottom: 15px;
}

.edit-contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.edit-contact-form input[type="text"],
.edit-contact-form input[type="email"],
.edit-contact-form input[type="url"],
.edit-contact-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
}

.edit-contact-form textarea {
    height: 100px;
}

#edit-contact-form-content {
    margin-top: 10px;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #3498db;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Add to your CSS */
.edit-form-columns {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.edit-form-col {
    flex: 1;
}

.edit-form-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.edit-form-buttons .button {
    margin: 0;
}

.cancel-edit {
    background: #ddd;
    color: #333;
    border-color: #ccc;
}

.cancel-edit:hover {
    background: #ccc;
}

.document-item{
    background: #f8f9fa;
    transition: background 0.2s;
}

.document-actions{
    padding-right: 0px;
}

.document-icon {
    font-size: 21px;
    margin: 2px 4px 0px 0px;
}

.document-scroll-container {
    max-height: 120px;
    height: 120px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-top: 8px;
    padding: 5px;
}

/* Scrollbar styling */
.document-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.document-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.document-scroll-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.document-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.documents-table {
    width: 100%;
    border-collapse: collapse;
}

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

.document-item td {
    padding: 6px 6px;
    border-bottom: 1px solid #eee;
}

.document-name {
    width: 90%;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

/* Responsive Design */
/* Small devices (mobile/tablets, 519px and below) */
@media (max-width: 520px) {
    
    .title-column{
        display: none;
    }

    .telephone-column{
        display: none;
    }

    .company-column{
        display: none;
    }

    .email-column{
        display: none;
    }

    .edit-form-columns {
        flex-direction: column;
        gap: 15px;
    }
}

/* Small devices (mobile/tablets, 767px and below) */
@media (max-width: 768px) {
    
    .title-column{
        display: none;
    }

    .telephone-column{
        display: none;
    }

    .company-column{
        display: none;
    }
}

/* Medium devices (tablets/desktops, 768px and up) */
@media (min-width: 768px) {
    .telephone-column{
        display: none;
    }
}

/* Large devices (large laptops and desktops, 1168px and up) */
@media (min-width: 1168px) {
}
