/* Moltbook Archive Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 15px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.header h1 {
    font-size: 24px;
    color: #2c3e50;
}

.user-menu {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-menu span {
    color: #7f8c8d;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;  /* Keep cards centered */
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-change {
    color: #27ae60;
    font-size: 12px;
}

.stat-action {
    margin-top: 10px;
}

.stat-action a {
    color: #3498db;
    text-decoration: none;
    font-size: 13px;
}

.stat-action a:hover {
    text-decoration: underline;
}

/* Search Section */
.search-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
}

.search-tips {
    margin-top: 10px;
    font-size: 13px;
    color: #7f8c8d;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.filters select,
.filters input[type="date"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

/* Recent Posts */
.recent-section, .trending-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #2c3e50;
}

.posts-list {
    min-height: 200px;
}

.post-card {
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 6px;
    transition: box-shadow 0.2s;
    background: #fff;
}

.post-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-title {
    margin-bottom: 10px;
}

.post-title a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
}

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

.post-preview {
    color: #555;
    margin: 10px 0;
    line-height: 1.5;
}

.post-preview mark {
    background: #fff3cd;
    padding: 2px 4px;
}

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #7f8c8d;
    margin: 10px 0;
    flex-wrap: wrap;
}

.post-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    align-items: center;
    flex-wrap: wrap;
}

.upvotes { color: #27ae60; }
.downvotes { color: #e74c3c; }
.comments { color: #7f8c8d; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-small, .btn-link {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

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

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

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

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

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    background: #e74c3c;
    color: #fff;
}

.btn-small:hover {
    background: #c0392b;
}

.btn-link {
    color: #3498db;
    background: none;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Trending */
.trending-list {
    min-height: 100px;
}

.trending-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.trending-item:last-child {
    border-bottom: none;
}

.submolt-name {
    font-weight: 500;
    color: #2c3e50;
}

.submolt-stats {
    color: #7f8c8d;
    font-size: 13px;
}

/* Alerts */
.alerts-list {
    min-height: 100px;
}

.alert-item {
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: #fff;
    border-left: 4px solid #f39c12;
}

.alert-search {
    font-weight: 600;
    color: #f39c12;
    margin-bottom: 5px;
    font-size: 13px;
}

.alert-content {
    color: #555;
    margin: 5px 0;
}

.alert-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 8px;
}

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

.pagination button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button:hover {
    background: #f5f5f5;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Utilities */
.loading, .no-results, .error {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.error {
    color: #e74c3c;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.login-error {
    background: #fee;
    color: #c00;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .post-meta, .post-stats {
        flex-direction: column;
        gap: 5px;
    }
}

/* Analytics Page */
.analytics-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    text-align: left;
}

.analytics-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    text-align: left;
}

.analytics-section h4 {
    color: #34495e;
    margin-bottom: 15px;
    text-align: left;
}

.table-container {
    overflow-x: auto;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table-container th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
}

.table-container td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
    text-align: left;
}

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

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 968px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    min-height: 200px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    text-align: left;
}

.bar-label {
    min-width: 100px;
    font-size: 13px;
    color: #555;
    text-align: left;
}

.bar-container {
    flex: 1;
    height: 24px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    text-align: left;
}

.bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transition: width 0.3s ease;
}

.bar-value {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

/* User Management */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal form {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}


/* Post Detail Page */
.post-detail-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: left;
}

.post-detail h1 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 28px;
    text-align: left;
}

.post-url {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: left;
}

.post-url a {
    color: #3498db;
    text-decoration: none;
}

.post-url a:hover {
    text-decoration: underline;
}

.post-content {
    margin: 20px 0;
    line-height: 1.8;
    font-size: 16px;
    color: #333;
    white-space: pre-wrap;
    text-align: left;
}

.post-metadata {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #7f8c8d;
    font-size: 13px;
    text-align: left;
}

.pinned {
    background: #fff3cd;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Comments */
#comments-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: left;
}

.comment {
    border-left: 2px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: left;
}

.comment-meta {
    margin-bottom: 8px;
    font-size: 14px;
    text-align: left;
}

.comment-meta strong {
    color: #2c3e50;
}

.comment-meta .time {
    color: #7f8c8d;
    font-size: 12px;
    margin-left: 10px;
}

.comment-content {
    margin: 10px 0;
    line-height: 1.6;
    color: #555;
    white-space: pre-wrap;
    text-align: left;
}

.comment-stats {
    font-size: 12px;
    margin-top: 8px;
    text-align: left;
}
