/* ===== POST PAGE GENERAL ===== */
.post-page {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    min-height: 80vh;
}

.post-hero {
    background: linear-gradient(135deg, #8e0000, #c62828);
    color: #fff;
    text-align: center;
    padding: 50px 20px 40px;
}
.post-hero h1 {
    font-size: 2rem;
    margin: 0 0 8px;
}
.post-hero p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.85;
}

.post-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ===== TOOLBAR ===== */
.post-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.search-form {
    display: flex;
    flex: 1;
    min-width: 200px;
}
.search-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    outline: none;
}
.search-form button {
    padding: 10px 16px;
    background: #8e0000;
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
}
.search-form button:hover { background: #c62828; }

.btn-post-create, .btn-admin-panel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-post-create {
    background: #8e0000;
    color: #fff;
}
.btn-post-create:hover { background: #c62828; }
.btn-admin-panel {
    background: #333;
    color: #fff;
}
.btn-admin-panel:hover { background: #555; }

/* ===== CATEGORY FILTER ===== */
.category-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.cat-btn {
    padding: 7px 16px;
    border: 2px solid #ddd;
    border-radius: 20px;
    text-decoration: none;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}
.cat-btn:hover, .cat-btn.active {
    background: #8e0000;
    border-color: #8e0000;
    color: #fff;
}

/* ===== POST GRID ===== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}
.no-post {
    grid-column: 1 / -1;
    text-align: center;
    color: #aaa;
    padding: 60px 0;
}
.no-post i { font-size: 3rem; display: block; margin-bottom: 12px; }

/* ===== POST CARD ===== */
.post-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
}
.post-card-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.post-card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.post-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.cat-tag {
    background: #fce4ec;
    color: #8e0000;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}
.post-date {
    color: #999;
    font-size: 12px;
}
.post-card-title {
    font-size: 1rem;
    margin: 0 0 8px;
    line-height: 1.4;
}
.post-card-title a {
    color: #222;
    text-decoration: none;
}
.post-card-title a:hover { color: #8e0000; }
.post-card-excerpt {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    flex: 1;
    margin: 0 0 12px;
}
.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.post-author {
    color: #888;
    font-size: 13px;
}
.btn-readmore {
    color: #8e0000;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.btn-readmore:hover { text-decoration: underline; }

/* ===== POST DETAIL ===== */
.post-detail {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 36px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.back-link {
    color: #8e0000;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 18px;
}
.back-link:hover { text-decoration: underline; }
.post-detail-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.post-detail-title {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin: 0 0 12px;
    line-height: 1.3;
}
.post-detail-author {
    color: #888;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.post-detail-img {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
}
.post-detail-img img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}
.post-detail-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
}

/* ===== CREATE / EDIT FORM ===== */
.form-post-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 30px 20px;
}
.post-form {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
    font-size: 14px;
}
.form-group input[type="text"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fafafa;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #8e0000;
}
.form-group textarea { resize: vertical; }
.form-group small { color: #999; font-size: 12px; display: block; margin-top: 4px; }
.required { color: #c62828; }

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 10px;
}
.btn-cancel {
    padding: 10px 20px;
    border: 2px solid #ccc;
    border-radius: 6px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-cancel:hover { border-color: #888; color: #333; }
.btn-submit {
    padding: 10px 24px;
    background: #8e0000;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-submit:hover { background: #c62828; }

/* ===== ALERT ===== */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }
.alert-error   { background: #ffebee; color: #c62828; border-left: 4px solid #f44336; }

/* ===== ADMIN PANEL ===== */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px;
}
.admin-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.stat-card {
    padding: 10px 20px;
    border-radius: 8px;
    background: #fff;
    border: 2px solid #ddd;
    text-decoration: none;
    color: #444;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
    position: relative;
}
.stat-card:hover, .stat-card.active { border-color: #8e0000; color: #8e0000; }
.stat-card.pending.active  { background: #fff8e1; border-color: #f9a825; color: #f9a825; }
.stat-card.approved.active { background: #e8f5e9; border-color: #4caf50; color: #2e7d32; }
.stat-card.rejected.active { background: #ffebee; border-color: #f44336; color: #c62828; }
.badge {
    background: #f44336;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.admin-search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.admin-search-form input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.admin-search-form button {
    padding: 9px 18px;
    background: #8e0000;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.admin-search-form button:hover { background: #c62828; }

.admin-table-wrap {
    overflow-x: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th {
    background: #8e0000;
    color: #fff;
    padding: 12px 14px;
    text-align: left;
    white-space: nowrap;
}
.admin-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafafa; }
.td-title a { color: #222; text-decoration: none; }
.td-title a:hover { color: #8e0000; }

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.status-pending  { background: #fff8e1; color: #f57f17; }
.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-rejected { background: #ffebee; color: #c62828; }

/* Action buttons */
.td-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.btn-approve, .btn-reject, .btn-edit, .btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: opacity 0.2s;
}
.btn-approve { background: #e8f5e9; color: #2e7d32; }
.btn-approve:hover { opacity: 0.75; }
.btn-reject  { background: #ffebee; color: #c62828; }
.btn-reject:hover  { opacity: 0.75; }
.btn-edit    { background: #e3f2fd; color: #1565c0; }
.btn-edit:hover    { opacity: 0.75; }
.btn-delete  { background: #ffebee; color: #c62828; }
.btn-delete:hover  { opacity: 0.75; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .post-container, .admin-container, .form-post-container {
        padding: 10px 4px;
    }
    .post-grid { grid-template-columns: 1fr; gap: 14px; }
    .post-detail { padding: 10px; }
    .post-form { padding: 10px; }
    .admin-table th, .admin-table td { padding: 7px 6px; font-size: 13px; }
    .admin-table-wrap { border-radius: 6px; }
    .admin-table { font-size: 13px; }
    .no-post { font-size: 15px; padding: 30px 0; }
    .btn-post-create, .btn-admin-panel { font-size: 13px; padding: 8px 10px; }
    .category-filter { gap: 5px; }
    .cat-btn { font-size: 12px; padding: 6px 10px; }
}
