/* General Body and Layout */
body {
    font-family: Arial, sans-serif;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
    max-width: 1400px;
}

/* Header Styles */
.header {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.header h1 a {
    text-decoration: none;
    color: #333;
}
.header-nav {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}
.header-nav a {
    text-decoration: none;
    background-color: #e9ecef;
    color: #333;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
}
.header-nav a:hover {
    background-color: #dee2e6;
}

/* Upload Form */
.upload-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
}
.upload-form input[type="file"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.upload-form button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.upload-form button:hover {
    background-color: #0056b3;
}

/* Flash Messages */
.flash-messages {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}
.flash-messages li {
    padding: 15px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Table Styles */
.table-container {
    margin-top: 40px;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
th, td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
td a {
    text-decoration: none;
    color: #007bff;
}
td a:hover {
    text-decoration: underline;
}
th {
    background-color: #f2f2f2;
    font-weight: bold;
}
tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
tbody tr:hover {
    background-color: #f1f1f1;
}

/* Pagination */
.pagination {
    margin-top: 20px;
    text-align: center;
}
.pagination .page-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    margin: 0 5px;
}
.pagination .page-link:hover {
    background-color: #0056b3;
}
.pagination .page-info {
    display: inline-block;
    padding: 8px 16px;
    color: #6c757d;
}

/* Grid View for All Posts */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.post-card {
    position: relative;
    aspect-ratio: 9 / 16;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: #e0e0e0;
}
.post-card a { display: block; width: 100%; height: 100%; }
.post-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s ease-in-out; }
.post-card:hover img { transform: scale(1.05); }
.overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); color: white; display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.2s ease-in-out; pointer-events: none; }
.post-card:hover .overlay { opacity: 1; }
.overlay-stat { font-size: 1.1em; font-weight: bold; }

/* Single Post Detail Card */
.post-detail-card { background-color: #fff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); max-width: 600px; width: 100%; overflow: hidden; }
.post-detail-card-image a { display: block; }
.post-detail-card-image img { width: 100%; display: block; }
.post-detail-card-content { padding: 20px; }
.post-title { font-size: 1.2em; font-weight: bold; color: #333; margin-bottom: 10px; }
.post-author { color: #555; margin-bottom: 20px; }
.post-stats { display: flex; justify-content: space-around; text-align: center; color: #666; font-size: 0.9em; }
.stat { flex: 1; }
.stat strong { display: block; font-size: 1.1em; color: #333; }

/* Utility */
.no-data { text-align: center; color: #666; padding: 40px; grid-column: 1 / -1; }

/* New Export Page Styles */
.export-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 20px auto;
}
.export-form fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}
.export-form legend {
    font-weight: bold;
    color: #333;
    padding: 0 10px;
}
.radio-option {
    margin-bottom: 10px;
}
.radio-option label {
    margin-left: 8px;
    color: #555;
}
.export-button {
    background-color: #28a745;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    width: 100%;
}
.export-button:hover {
    background-color: #218838;
}