/*
Theme Name: Post Table Theme
Description: A WordPress theme that displays posts in a filterable and sortable table format
Version: 1.0
Author: Rikard Linde
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.site-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
}

.site-title:hover {
    color: #3498db;
}

/* Filter Controls */
.filter-controls {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Posts Table */
.posts-table-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.posts-table th,
.posts-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.posts-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.posts-table th:hover {
    background: #e9ecef;
}

.posts-table th.sortable::after {
    content: "↕";
    position: absolute;
    right: 8px;
    opacity: 0.5;
}

.posts-table th.sort-asc::after {
    content: "↑";
    opacity: 1;
}

.posts-table th.sort-desc::after {
    content: "↓";
    opacity: 1;
}

.posts-table tbody tr:hover {
    background: #f8f9fa;
}

.post-title {
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    max-width: 300px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-title:hover {
    color: #3498db;
}

.post-excerpt {
    color: #666;
    font-size: 14px;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-meta {
    font-size: 12px;
    color: #999;
}

.post-tags,
.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag,
.category {
    background: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    text-decoration: none;
}

.tag:hover,
.category:hover {
    background: #dee2e6;
}

/* Loading and Empty States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-posts {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-posts h3 {
    margin-bottom: 10px;
    color: #999;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    gap: 10px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
}

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

.pagination .current {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .posts-table-container {
        overflow-x: auto;
    }
    
    .posts-table {
        min-width: 800px;
    }
    
    .post-title,
    .post-excerpt {
        max-width: 200px;
    }
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

.site-footer p {
    margin: 0;
}