/* WP Posts Table - Frontend Styles */

.wp-posts-table-wrapper {
    margin: 20px 0;
     overflow: visible;
    background: #fff;
    border-radius: 8px;
}

.wp-posts-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #fff;
}

.wp-posts-table thead {
    background: #ffffff;
    border-bottom: 2px solid #dee2e6;
}

.wp-posts-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #dee2e6;
}

.wp-posts-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: top;
}

.wp-posts-table tbody tr {
    transition: background-color 0.2s ease;
}

.wp-posts-table tbody tr:hover .category-link{
    background: #f7ff1761;
    color: #212529;
    text-decoration: none;
    border: 1px solid #f7ff17;
}

.wp-posts-table tbody tr:hover {
    background-color: #f8f9fa;
}

.wp-posts-table tbody tr:last-child td {
    border-bottom: none;
}

/* Title Column */
.wp-posts-table-title {
    width: 40%;
    min-width: 200px;
}

.wp-posts-table-title strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
    margin-top: 8px;
}

/* Category Column */
.wp-posts-table-category {
    width: 20%;
    min-width: 120px;
}

.category-link {
    display: inline-block;
    padding: 4px 8px;
    background: white;
    color: #212529;
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    font-size: 12px;
    font-weight: 500;
    margin: 2px;
    transition: all 0.2s ease;
}


.no-category {
    color: #6c757d;
    font-style: italic;
    font-size: 13px;
}

/* Date Column */
.wp-posts-table-date {
    width: 15%;
    min-width: 100px;
}

.wp-posts-table-date time {
    display: block;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.post-time {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

/* Action Column */
.wp-posts-table-action {
    width: 15%;
    min-width: 120px;
    text-align: right;
    position: relative;
    padding-right: 20px;
}

.wp-posts-table-button {
    display: inline-block;
    padding: 12px;
    margin: 2px;
    text-decoration: none;
    border-radius: 50%;
    font-size: 0;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    position: relative;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 16px 16px;
}
.wp-posts-table-button img {
    width: 40px;
    height: 40px;
}

/* Post Image - Hidden by default, shown on row hover */
.post-image {
    pointer-events: none;
    position: absolute;
    top: -20%;
    right: calc(100% - 150px);
    transform: translateY(-30%);
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Show image on row hover */
.wp-posts-table tbody tr:hover .post-image {
    opacity: 1;
    visibility: visible;
    transform: rotate(-10deg);
}

.wp-posts-table tbody tr:hover .wp-posts-table-read-more {
    background: transparent;
    outline: 4px dotted #2c3338;
    text-decoration: none;
    transform: translateY(-1px) scale(1.05) rotate(-45deg);
}

.wp-posts-table-read-more {
    background: #0000000c;
}

.wp-posts-table-edit {
    background: #f0f0f1;
    color: #2c3338;
    border: 1px solid #c3c4c7;
}

.wp-posts-table-edit:hover {
    background: #e8e8e9;
    color: #1d2327;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Pagination */
.wp-posts-table-pagination {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.wp-posts-table-pagination-link {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    text-decoration: none;
    background: #fff;
    color: #007cba;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.wp-posts-table-pagination-link:hover {
    background: #007cba;
    color: #fff;
    text-decoration: none;
}

.wp-posts-table-pagination-link.current {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

/* No posts message */
.wp-posts-table-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wp-posts-table-wrapper {
        margin: 10px 0;
        border-radius: 6px;
    }
    
    .wp-posts-table {
        font-size: 14px;
    }
    
    .wp-posts-table th,
    .wp-posts-table td {
        padding: 10px 8px;
    }
    
    .wp-posts-table-title {
        width: 100%;
    }
    
    .wp-posts-table-category,
    .wp-posts-table-date {
        width: 100%;
    }
    
    .wp-posts-table-action {
        width: auto;
    }
    
    .wp-posts-table-button {
        display: inline-block;
        margin: 4px;
        width: 40px;
        height: 40px;
        right: 0;
    }
}

@media (max-width: 600px) {
    .wp-posts-table,
    .wp-posts-table thead,
    .wp-posts-table tbody,
    .wp-posts-table th,
    .wp-posts-table td,
    .wp-posts-table tr {
        display: block;
    }
    
    .wp-posts-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .wp-posts-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 15px;
        border-radius: 8px;
        background: #fff;
    }
    
    .wp-posts-table td {
        border: none;
        position: relative;
        padding: 8px 0 8px 120px;
        border-bottom: 1px solid #f1f3f4;
    }
    
    .wp-posts-table td:last-child {
        border-bottom: none;
    }
    
    .wp-posts-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 110px;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #495057;
        font-size: 13px;
    }
    
    .post-image {
        right:10px;
        width: 120px;
        height: 90px;
    }
    
    .wp-posts-table-action {
        text-align: left;
    }
}

/* Loading state */
.wp-posts-table-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.wp-posts-table-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}