/* ====================================================
   CMS.CSS — Master stylesheet for updates-project CMS
   Covers: Admin dashboard + Public frontend pages
   ==================================================== */

/* ── Google Fonts ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Montserrat:wght@500;600;700&display=swap');

/* ── Reset / Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Nunito', 'Montserrat', sans-serif; background: #f4f6fb; color: #3c434a; font-size: 14px; margin: 0; }

/* ── Layout ───────────────────────────────────────── */
.main-wrap { margin-left: 235px; min-height: 100vh; }
@media(max-width:768px){ .main-wrap { margin-left: 0; } }

/* ── Topbar ───────────────────────────────────────── */
.topbar { background:#fff; border-bottom:1px solid #e5e7eb; padding:14px 28px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:100; box-shadow:0 1px 4px rgba(0,0,0,.06); }
.topbar h5 { margin:0; font-size:18px; font-weight:700; color:#1e293b; }

/* ── Cards ────────────────────────────────────────── */
.card { background:#fff; border-radius:12px; box-shadow:0 1px 6px rgba(0,0,0,.07); border:1px solid #f1f5f9; }
.card-header { padding:16px 20px; border-bottom:1px solid #f1f5f9; display:flex; align-items:center; justify-content:space-between; }
.card-header h4 { margin:0; font-size:15px; font-weight:700; color:#1e293b; }
.card-header small { font-size:12px; color:#94a3b8; }
.card-body { padding:20px; }

/* ── Form cards ───────────────────────────────────── */
.form-card { background:#fff; border-radius:12px; padding:24px; box-shadow:0 1px 6px rgba(0,0,0,.06); border:1px solid #f1f5f9; margin-bottom:20px; }
.section-title { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; color:#ec4899; margin-bottom:16px; padding-bottom:10px; border-bottom:2px solid #fdf2f8; }

/* ── Form controls ────────────────────────────────── */
.form-label { font-size:13px; font-weight:600; color:#374151; margin-bottom:5px; }
.form-control, .form-select { border:1px solid #e2e8f0; border-radius:8px; padding:9px 12px; font-size:14px; font-family:inherit; background:#fff; width:100%; transition:border-color .15s, box-shadow .15s; }
.form-control:focus, .form-select:focus { border-color:#ec4899; box-shadow:0 0 0 3px rgba(236,72,153,.1); outline:none; }
.slug-preview { font-size:12px; color:#64748b; margin-top:5px; font-family:monospace; background:#f8fafc; padding:4px 8px; border-radius:5px; }
.new-cat-box { background:#f0fdf4; border:1px solid #bbf7d0; border-radius:8px; padding:14px; margin-top:8px; }

/* ── Stat cards ───────────────────────────────────── */
.stat-card { background:#fff; border-radius:12px; padding:20px 24px; box-shadow:0 1px 6px rgba(0,0,0,.07); border-left:4px solid #e2e8f0; cursor:pointer; transition:transform .15s, box-shadow .15s; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.1); }
.stat-card.all       { border-color:#6366f1; }
.stat-card.published { border-color:#10b981; }
.stat-card.scheduled { border-color:#f59e0b; }
.stat-card.draft     { border-color:#94a3b8; }
.stat-card .snum { font-size:32px; font-weight:800; color:#1e293b; }
.stat-card .slbl { font-size:12px; color:#64748b; font-weight:600; text-transform:uppercase; letter-spacing:.05em; }

/* ── Status badges ────────────────────────────────── */
.bs { display:inline-block; padding:3px 10px; border-radius:12px; font-size:11px; font-weight:700; }
.bs-published { background:#d1fae5; color:#065f46; }
.bs-scheduled { background:#fef3c7; color:#92400e; }
.bs-draft     { background:#f1f5f9; color:#64748b; }
.bs-trash     { background:#fee2e2; color:#991b1b; }

/* ── Tables ───────────────────────────────────────── */
.table { width:100%; border-collapse:collapse; }
.table th { background:#f8fafc; padding:10px 14px; font-size:12px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:.05em; border-bottom:1px solid #e5e7eb; text-align:left; }
.table td { padding:12px 14px; border-bottom:1px solid #f8fafc; font-size:14px; color:#374151; vertical-align:middle; }
.table tr:hover td { background:#fafbff; }

/* ── Buttons ──────────────────────────────────────── */
.btn-act { padding:4px 10px; font-size:12px; border-radius:6px; font-family:inherit; }

/* ── Pills ────────────────────────────────────────── */
.cat-pill { display:inline-block; background:#f0f4ff; color:#6366f1; padding:3px 10px; border-radius:12px; font-size:11px; font-weight:700; }
.tag-pill { background:#f1f5f9; color:#475569; padding:2px 9px; border-radius:12px; font-size:11px; font-weight:500; text-decoration:none; border:1px solid #e2e8f0; transition:all .15s; }
.tag-pill:hover, .tag-pill.active { background:#ec4899; color:#fff; border-color:#ec4899; }

/* ── Empty state ──────────────────────────────────── */
.empty-state { text-align:center; padding:60px 20px; color:#94a3b8; }
.empty-state .ei { font-size:52px; margin-bottom:16px; }

/* ── Sidebar (frontend) ───────────────────────────── */
.sb-card { background:#fff; border-radius:14px; padding:20px; box-shadow:0 2px 10px rgba(0,0,0,.06); margin-bottom:22px; border:1px solid #f1f5f9; }
.sb-post { display:flex; gap:10px; padding:10px 0; border-bottom:1px solid #f8fafc; text-decoration:none; }
.sb-post:last-child { border-bottom:none; padding-bottom:0; }
.sb-post img, .sb-post-noimg { width:54px; height:54px; border-radius:8px; flex-shrink:0; object-fit:cover; }
.sb-post-noimg { background:linear-gradient(135deg,#ede9fe,#fce7f3); display:flex; align-items:center; justify-content:center; font-size:18px; }
.sb-post-title { font-size:13px; font-weight:600; color:#0f172a; line-height:1.35; margin-bottom:3px; }
.sb-post-date  { font-size:11px; color:#94a3b8; }
.sb-post:hover .sb-post-title { color:#6366f1; }
.sb-cat-count { background:#f1f5f9; color:#64748b; font-size:11px; font-weight:700; padding:2px 8px; border-radius:10px; }

/* ── Tag cloud (frontend) ─────────────────────────── */
.cloud-tag { background:#f1f5f9; color:#475569; padding:4px 11px; border-radius:16px; font-size:12px; font-weight:500; text-decoration:none; border:1px solid #e2e8f0; transition:all .15s; }
.cloud-tag:hover, .cloud-tag.active-tag { background:#ec4899; color:#fff; border-color:#ec4899; }
.cloud-tag.size-lg { font-size:14px; padding:5px 13px; font-weight:700; }
.cloud-tag.size-sm { font-size:11px; opacity:.75; }

/* ── Dashboard table (WP-style) ───────────────────── */
.qe-row { display:none !important; }
.qe-row.open { display:table-row !important; }
.cb-col { width:36px; }
input[type=checkbox] { width:16px; height:16px; cursor:pointer; accent-color:#6366f1; }
.bulk-bar { background:#fff3cd; border:1px solid #ffc107; border-radius:8px; padding:10px 16px; margin-bottom:16px; display:none; align-items:center; gap:12px; flex-wrap:wrap; }
.bulk-bar.show { display:flex; }

/* ── Pagination ───────────────────────────────────── */
.pager { display:flex; justify-content:center; gap:6px; margin-top:40px; flex-wrap:wrap; }
.pager a, .pager span { display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:8px; font-size:14px; font-weight:600; text-decoration:none; border:1px solid #e2e8f0; color:#374151; background:#fff; }
.pager a:hover { background:#6366f1; color:#fff; border-color:#6366f1; }
.pager span.active { background:#6366f1; color:#fff; border-color:#6366f1; }

/* ── Alerts ───────────────────────────────────────── */
.alert { border-radius:10px; padding:12px 16px; font-size:14px; margin-bottom:16px; }
.alert-success { background:#d1fae5; color:#065f46; border:1px solid #6ee7b7; }
.alert-warning { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; }
.alert-danger  { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.alert-info    { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; }

/* ── Login ────────────────────────────────────────── */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#667eea 0%,#764ba2 100%); padding:20px; }
.login-card { background:#fff; border-radius:20px; padding:40px; width:100%; max-width:420px; box-shadow:0 20px 60px rgba(0,0,0,.2); }

/* ── Responsive ───────────────────────────────────── */
@media(max-width:768px){
  .form-card { padding:16px; }
  .topbar { padding:12px 16px; }
  .table td, .table th { padding:8px 10px; font-size:13px; }
  .stat-card .snum { font-size:24px; }
}

/* ── Post card (category/tag/listing pages) ───────── */
.post-card { background:#fff; border-radius:14px; overflow:hidden; box-shadow:0 2px 10px rgba(0,0,0,.07); border:1px solid #f1f5f9; display:flex; flex-direction:column; transition:transform .2s,box-shadow .2s; }
.post-card:hover { transform:translateY(-4px); box-shadow:0 8px 28px rgba(0,0,0,.11); }
.post-card-img { width:100%; height:220px; object-fit:cover; display:block; }
.post-card-noimg { height:200px; background:linear-gradient(135deg,#ede9fe,#fce7f3); display:flex; align-items:center; justify-content:center; font-size:44px; }
.post-card-body { padding:18px; display:flex; flex-direction:column; flex:1; }
.post-card-meta { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.cat-badge { background:#fce7f3; color:#9d174d; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700; text-decoration:none; }
.cat-badge:hover { background:#ec4899; color:#fff; }
.type-badge { background:#e0f2fe; color:#0369a1; padding:2px 8px; border-radius:10px; font-size:10px; font-weight:700; text-transform:uppercase; }
.post-date { font-size:12px; color:#94a3b8; }
.post-card-title { font-size:15px; font-weight:700; color:#0f172a; line-height:1.4; text-decoration:none; display:block; margin-bottom:6px; }
.post-card-title:hover { color:#ec4899; }
.post-author { font-size:12px; color:#94a3b8; margin-bottom:8px; }
.post-card-desc { font-size:13px; color:#64748b; line-height:1.6; margin-bottom:12px; flex:1; }
.post-tags { display:flex; gap:5px; flex-wrap:wrap; margin-bottom:14px; }
.post-card-footer { display:flex; gap:8px; flex-wrap:wrap; margin-top:auto; padding-top:10px; border-top:1px solid #f1f5f9; }
.btn-read-more { background:#ec4899; color:#fff; padding:7px 16px; border-radius:8px; font-size:13px; font-weight:600; text-decoration:none; transition:background .15s; }
.btn-read-more:hover { background:#be185d; color:#fff; }
.btn-pdf { background:#f1f5f9; color:#475569; padding:7px 14px; border-radius:8px; font-size:13px; font-weight:600; text-decoration:none; transition:background .15s; }
.btn-pdf:hover { background:#e2e8f0; }

/* ── Listing page hero ─────────────────────────────── */
.listing-hero { border-radius:16px; padding:36px 40px; color:#fff; margin-bottom:32px; }
.listing-hero.cat-hero { background:linear-gradient(135deg,#ec4899,#f59e0b); }
.listing-hero.tag-hero { background:linear-gradient(135deg,#6366f1,#ec4899); }
.listing-hero h1 { font-size:clamp(22px,4vw,36px); font-weight:800; margin:0 0 6px; }
.listing-hero p { margin:0; opacity:.85; font-size:15px; }
.listing-hero .back-link { display:inline-block; margin-top:14px; background:rgba(255,255,255,.2); color:#fff; padding:6px 18px; border-radius:20px; font-size:13px; text-decoration:none; transition:background .15s; }
.listing-hero .back-link:hover { background:rgba(255,255,255,.35); color:#fff; }

/* ── Other categories bar ─────────────────────────── */
.other-cats { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:24px; }
.other-cats a { background:#f1f5f9; color:#475569; padding:5px 14px; border-radius:20px; font-size:13px; text-decoration:none; border:1px solid #e2e8f0; transition:all .15s; }
.other-cats a:hover { background:#ec4899; color:#fff; border-color:#ec4899; }
