/* Custom Posts Table Styles - Updated Design */

.custom-posts-table-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Search Box */
.cpt-search-box {
    margin-bottom: 20px;
}

.cpt-search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 15px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.cpt-search-input:focus {
    outline: none;
    border-color: #0066a1;
    box-shadow: 0 0 0 2px rgba(0, 102, 161, 0.1);
}

/* Table Container */
.cpt-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 0;
}

/* Table Styles */
.custom-posts-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: none;
    border: 1px solid #ddd;
}

.custom-posts-table thead {
    background: linear-gradient(180deg, #0066a1 0%, #004d7a 100%);
    border: none;
}

.custom-posts-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
    position: relative;
    border: none;
}

.custom-posts-table th.cpt-sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.custom-posts-table th:first-child {
    color: #ffffff;
}

.custom-posts-table th:last-child {
    width: 150px;
    text-align: right;
    color: #ffc107;
    font-weight: 700;
}

.cpt-sort-indicator {
    display: inline-block;
    margin-left: 8px;
    font-size: 14px;
    opacity: 0.7;
}

.cpt-sort-indicator::after {
    content: "⇅";
}

.cpt-sortable.cpt-sort-asc .cpt-sort-indicator::after {
    content: "▲";
    opacity: 1;
}

.cpt-sortable.cpt-sort-desc .cpt-sort-indicator::after {
    content: "▼";
    opacity: 1;
}

.custom-posts-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.custom-posts-table tbody tr:hover {
    background-color: #f5f9fc;
}

.custom-posts-table tbody tr:last-child {
    border-bottom: none;
}

.custom-posts-table td {
    padding: 14px 20px;
    font-size: 14px;
    color: #333;
}

.custom-posts-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.custom-posts-table td a {
    color: #0066a1;
    text-decoration: none;
    font-weight: 400;
}

.custom-posts-table td a:hover {
    text-decoration: underline;
    color: #004d7a;
}

/* Loading Spinner */
.cpt-loading {
    text-align: center;
    padding: 40px;
}

.cpt-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066a1;
    border-radius: 50%;
    animation: cpt-spin 1s linear infinite;
}

@keyframes cpt-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination */
.cpt-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.cpt-pagination button {
    padding: 10px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 44px;
}

.cpt-pagination button:hover:not(:disabled) {
    background: #0066a1;
    color: #fff;
    border-color: #0066a1;
}

.cpt-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
}

.cpt-pagination button.active {
    background: #0066a1;
    color: #fff;
    border-color: #0066a1;
}

.cpt-pagination .cpt-page-info {
    padding: 10px 16px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Empty State */
.cpt-empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
    font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .custom-posts-table th,
    .custom-posts-table td {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .cpt-search-input {
        max-width: 100%;
        font-size: 16px;
    }
    
    .cpt-pagination button {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 38px;
    }
    
    .custom-posts-table th:last-child,
    .custom-posts-table td:last-child {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .custom-posts-table th,
    .custom-posts-table td {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .custom-posts-table th:last-child,
    .custom-posts-table td:last-child {
        width: 80px;
    }
}