:root {
    --primary: #6b7280;
    --primary-dark: #4b5563;
    --primary-light: #f3f4f6;
    --accent: #9ca3af;
    --bg: #f8fafc;
    --bg-soft: #f1f5f9;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06);
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
    --shadow-lg: 0 25px 60px rgba(15, 23, 42, .15);
    --shadow-glow: 0 10px 40px rgba(107, 114, 128, .25);
    --transition: all .25s cubic-bezier(.4, 0, .2, 1);
    --grad-1: linear-gradient(135deg, #374151 0%, #6b7280 50%, #9ca3af 100%);
    --grad-2: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    --grad-3: linear-gradient(135deg, #06b6d4 0%, #6b7280 100%);
    --brand-gray: linear-gradient(135deg, #4b5563 0%, #6b7280 50%, #9ca3af 100%);
    --brand-gray-glow: rgba(107, 114, 128, 0.28);
}

[data-theme="dark"] {
    --primary: #9ca3af;
    --primary-dark: #6b7280;
    --primary-light: #1f2937;
    --bg: #0b1020;
    --bg-soft: #0f172a;
    --surface: #111a32;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-lg: 0 25px 60px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*::selection { background: var(--primary); color: #fff; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    transition: background .3s ease, color .3s ease;
    overflow-x: hidden;
}

body::before {
    content:'';
    position: fixed; inset: 0;
    background:
        radial-gradient(900px 600px at 10% -10%, rgba(107, 114, 128, .18), transparent 60%),
        radial-gradient(700px 500px at 100% 0%, rgba(236, 72, 153, .15), transparent 60%),
        radial-gradient(600px 600px at 50% 110%, rgba(6, 182, 212, .12), transparent 60%);
    z-index: -1;
    pointer-events: none;
}
[data-theme="dark"] body::before { opacity: .55; }

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* NAVBAR */
.navbar {
    background: rgba(255, 255, 255, .7);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid rgba(226, 232, 240, .6);
    position: sticky; top: 0; z-index: 100;
}
[data-theme="dark"] .navbar { background: rgba(11, 16, 32, .75); border-bottom-color: rgba(30, 41, 59, .8); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; gap: 1rem; }
.brand {
    font-weight: 800; font-size: 1.5rem;
    color: #111827;
    letter-spacing: -.02em; display: inline-flex; align-items: center; gap: .55rem;
}
.brand::before {
    content:''; width: 28px; height: 28px;
    background: var(--brand-gray); border-radius: 8px;
    box-shadow: 0 6px 18px var(--brand-gray-glow);
}
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 42px; height: 42px; border-radius: var(--radius-sm); }
.nav-toggle span { display:block; width:22px; height:2px; background:var(--text); margin:5px auto; transition:var(--transition); border-radius: 2px; }

.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-links a { color: var(--text); font-weight: 500; font-size: .95rem; position: relative; }
.nav-links a:not(.btn)::after {
    content:''; position: absolute; left: 0; right: 0; bottom: -6px;
    height: 2px; background: var(--grad-1); border-radius: 2px;
    transform: scaleX(0); transform-origin: left; transition: var(--transition);
}
.nav-links a:not(.btn):hover { color: var(--primary); }
.nav-links a:not(.btn):hover::after { transform: scaleX(1); }

.theme-btn {
    background: var(--bg-soft); border: 1px solid var(--border);
    width: 38px; height: 38px; border-radius: 50%;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; color: var(--text); transition: var(--transition);
}
.theme-btn:hover { transform: rotate(20deg); border-color: var(--primary); color: var(--primary); }

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .75rem 1.4rem; border-radius: 999px; border: 0;
    font-weight: 600; font-size: .95rem; cursor: pointer;
    transition: var(--transition); text-decoration: none; white-space: nowrap;
    position: relative; overflow: hidden; font-family: inherit;
}
.btn-primary { background: var(--grad-1); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(107, 114, 128, .5); color:#fff; }
.btn-outline { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color:#fff; transform: translateY(-1px); }
.btn-sm { padding: .5rem .95rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* HERO */
.hero { padding: 5rem 0 4rem; text-align: center; position: relative; }
.hero-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .4rem 1rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; font-size: .85rem; color: var(--text-muted);
    margin-bottom: 1.5rem; box-shadow: var(--shadow-sm);
    animation: float 3s ease-in-out infinite;
}
.hero-badge .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--success); box-shadow: 0 0 0 4px rgba(16, 185, 129, .2);
}
.hero h1 {
    font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 800;
    line-height: 1.05; margin-bottom: 1.2rem; letter-spacing: -.03em;
}
.hero h1 .grad { color: #111827; }
.hero p { font-size: 1.15rem; color: var(--text-muted); max-width: 680px; margin: 0 auto 2rem; }
.hero-actions { display:flex; gap:.75rem; justify-content:center; flex-wrap:wrap; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes fadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.hero > * { animation: fadeUp .6s ease both; }
.hero > *:nth-child(2) { animation-delay: .1s; }
.hero > *:nth-child(3) { animation-delay: .2s; }
.hero > *:nth-child(4) { animation-delay: .3s; }

/* TOOLBAR */
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.search {
    display: flex; background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; padding: .35rem .35rem .35rem 1.3rem;
    flex: 1; min-width: 280px; box-shadow: var(--shadow-sm); transition: var(--transition);
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(107, 114, 128, .15); }
.search input { flex: 1; border: 0; outline: none; background: transparent; font-size: .95rem; color:var(--text); font-family: inherit; }
.search button { border-radius: 999px; padding: .6rem 1.3rem; background: var(--grad-1); color: #fff; border: 0; cursor: pointer; font-weight:600; font-family: inherit; }

.chips { display:flex; flex-wrap:wrap; gap:.5rem; }
.chip { padding: .5rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; color: var(--text); transition: var(--transition); font-weight: 500; }
.chip:hover { transform: translateY(-2px); border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--grad-1); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }

/* SECTION TITLE */
.section-title { font-size: 1.7rem; font-weight: 800; margin-bottom: 1.4rem; display:flex; align-items:center; justify-content:space-between; letter-spacing: -.01em; }

/* GRID + CARDS */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.75rem; }

.card {
    background: var(--surface); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    transition: var(--transition); display: flex; flex-direction: column; position: relative;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: transparent; }

.card-thumb {
    aspect-ratio: 16/9; background: var(--grad-1);
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.card-thumb::before { content: '✦'; position: absolute; font-size: 6rem; color: rgba(255,255,255,.15); font-weight: 800; }
.card-thumb img { width:100%; height:100%; object-fit:cover; transition: transform .6s ease; position: relative; z-index: 1; }
.card:hover .card-thumb img { transform: scale(1.08); }
.card-cat {
    position:absolute; top:.85rem; left:.85rem; z-index: 2;
    background: rgba(255,255,255,.95); color: var(--primary);
    padding: .3rem .8rem; border-radius: 999px; font-size:.75rem; font-weight:700;
    backdrop-filter: blur(10px);
}

.card-body { padding: 1.4rem; display:flex; flex-direction:column; gap:.7rem; flex:1; }
.card-title { font-size: 1.15rem; font-weight:700; color:var(--text); line-height:1.35; letter-spacing: -.01em; }
.card-title a { color:inherit; }
.card-title a:hover { color: var(--primary); }
.card-excerpt { font-size:.9rem; color:var(--text-muted); flex:1; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.card-meta { display:flex; align-items:center; gap:.6rem; font-size:.8rem; color:var(--text-muted); padding-top:.8rem; border-top:1px solid var(--border); }
.avatar {
    width:30px; height:30px; border-radius:50%; background: var(--grad-1);
    color:#fff; display:inline-flex; align-items:center; justify-content:center;
    font-size:.78rem; font-weight:700; box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.views-pill {
    margin-left: auto; display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .55rem; background: var(--bg-soft);
    border-radius: 999px; font-size: .72rem; font-weight: 600;
}

/* ARTICLE DETAIL */
.article { background: var(--surface); border-radius: var(--radius); padding: 3rem; margin: 2rem 0; box-shadow: var(--shadow); border: 1px solid var(--border); }
.article header { margin-bottom: 2rem; }
.article h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 800; line-height:1.15; margin-bottom: 1rem; letter-spacing:-.02em; }
.article-meta { display:flex; gap:1rem; align-items:center; color:var(--text-muted); font-size:.9rem; flex-wrap:wrap; }
.article-cover { aspect-ratio: 16/8; border-radius: var(--radius); overflow:hidden; margin: 1.5rem 0; background: var(--grad-1); box-shadow: var(--shadow); }
.article-cover img { width:100%; height:100%; object-fit:cover; }
.article-content { font-size: 1.08rem; line-height: 1.85; color: var(--text); }
.article-content p { margin-bottom: 1.3rem; }
.article-content h2 { margin: 2rem 0 1rem; font-size:1.6rem; font-weight: 800; letter-spacing: -.01em; }
.article-content h3 { margin: 1.5rem 0 .8rem; font-size:1.25rem; font-weight: 700; }
.article-content img { border-radius: var(--radius-sm); margin: 1.2rem 0; }
.article-content blockquote { border-left: 4px solid var(--primary); padding: 1rem 1.4rem; background: var(--primary-light); border-radius: var(--radius-sm); margin: 1.5rem 0; color: var(--text); font-style: italic; }
.article-content code { background: var(--bg-soft); padding: .1rem .4rem; border-radius: 4px; font-size: .9em; }

/* SHARE */
.share { margin-top: 2.5rem; padding: 1.8rem; background: var(--bg-soft); border-radius: var(--radius); }
.share h3 { font-size:1.05rem; font-weight:700; margin-bottom:1rem; }
.share-buttons { display:flex; gap:.6rem; flex-wrap:wrap; }
.share-btn {
    display:inline-flex; align-items:center; justify-content:center; gap:.45rem;
    padding:.65rem 1.1rem; border-radius:999px; font-size:.85rem; font-weight:600;
    color:#fff; border:0; cursor:pointer; transition:var(--transition); text-decoration:none; font-family: inherit;
}
.share-btn:hover { transform: translateY(-3px); color:#fff; box-shadow: 0 10px 25px rgba(0,0,0,.15); }
.share-btn.fb { background:#1877f2; }
.share-btn.tw { background:#000; }
.share-btn.wa { background:#25d366; }
.share-btn.li { background:#0a66c2; }
.share-btn.cp { background: var(--grad-1); }

/* AUTH */
.auth-wrapper { min-height: calc(100vh - 200px); display:flex; align-items:center; justify-content:center; padding:2rem 1rem; }
.auth-card {
    background: var(--surface); border-radius: var(--radius); padding: 2.8rem;
    width: 100%; max-width: 460px; box-shadow: var(--shadow-lg);
    border: 1px solid var(--border); position: relative; animation: fadeUp .5s ease both;
}
.auth-card::before { content:''; position: absolute; top: -2px; left: 20%; right: 20%; height: 4px; background: var(--grad-1); border-radius: 999px; box-shadow: 0 4px 20px rgba(107, 114, 128, .5); }
.auth-card h2 { font-size:1.8rem; font-weight:800; margin-bottom:.4rem; letter-spacing: -.01em; }
.auth-card .muted { color: var(--text-muted); margin-bottom:1.8rem; font-size:.95rem; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display:block; font-size:.9rem; font-weight:600; margin-bottom:.5rem; color:var(--text); }
.form-control {
    width:100%; padding:.85rem 1.1rem;
    border:1.5px solid var(--border); border-radius:var(--radius-sm);
    font-size:.95rem; background:var(--surface); color:var(--text);
    transition:var(--transition); font-family:inherit;
}
.form-control:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 4px rgba(99,102,241,.15); }
textarea.form-control { resize:vertical; min-height:120px; line-height: 1.6; }
select.form-control { cursor: pointer; }

.form-footer { text-align:center; margin-top:1.3rem; font-size:.9rem; color:var(--text-muted); }

/* ALERTS */
.alert {
    padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.3rem;
    font-size: .92rem; border-left: 4px solid;
    display: flex; align-items: center; gap: .6rem; animation: fadeUp .4s ease;
}
.alert-error   { background:#fef2f2; border-color:var(--danger);  color:#991b1b; }
.alert-success { background:#f0fdf4; border-color:var(--success); color:#065f46; }
.alert-info    { background:var(--primary-light); border-color:var(--primary); color:var(--primary-dark); }
[data-theme="dark"] .alert-error   { background: rgba(239, 68, 68, .15); color: #fca5a5; }
[data-theme="dark"] .alert-success { background: rgba(16, 185, 129, .15); color: #6ee7b7; }
[data-theme="dark"] .alert-info    { background: rgba(107, 114, 128, .15); color: #d1d5db; }

/* DASHBOARD */
.dash-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:1.2rem; margin-bottom:2rem; }
.stat-card {
    background:var(--surface); border-radius:var(--radius); padding:1.5rem;
    border:1px solid var(--border); box-shadow:var(--shadow-sm);
    position: relative; overflow: hidden; transition: var(--transition);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.stat-card::after {
    content: ''; position: absolute; right: -30px; top: -30px;
    width: 100px; height: 100px; border-radius: 50%;
    background: var(--grad-1); opacity: .12;
}
.stat-card:nth-child(2)::after { background: var(--grad-2); }
.stat-card:nth-child(3)::after { background: var(--grad-3); }
.stat-card:nth-child(4)::after { background: linear-gradient(135deg, #10b981, #06b6d4); }
.stat-card .label { color:var(--text-muted); font-size:.78rem; margin-bottom:.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat-card .value { font-size:2.2rem; font-weight:800; color:var(--text); letter-spacing: -.02em; }

.table-wrap { background:var(--surface); border-radius:var(--radius); border:1px solid var(--border); overflow:hidden; box-shadow:var(--shadow-sm); overflow-x: auto; }
table.data { width:100%; border-collapse:collapse; min-width: 700px; }
table.data th, table.data td { padding: 1rem 1.2rem; text-align:left; font-size:.92rem; }
table.data thead { background:var(--bg-soft); }
table.data thead th { font-weight:700; color:var(--text-muted); text-transform:uppercase; font-size:.72rem; letter-spacing:.06em; }
table.data tbody tr { border-top:1px solid var(--border); transition: var(--transition); }
table.data tbody tr:hover { background: var(--primary-light); }

.badge { display:inline-block; padding:.25rem .7rem; border-radius:999px; font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
.badge-published { background:#d1fae5; color:#065f46; }
.badge-draft     { background:#fef3c7; color:#6b7280; }

/* FOOTER */
.footer { background: #0b1020; color:#cbd5e1; padding: 3rem 0 1.5rem; margin-top:auto; position: relative; overflow: hidden; }
.footer::before { content:''; position: absolute; top:0; left:0; right:0; height: 1px; background: var(--grad-1); }
.footer-inner { display:flex; flex-wrap:wrap; gap:2.5rem; justify-content:space-between; }
.footer h4 { color:#fff; font-size:1.05rem; margin-bottom:1rem; font-weight: 700; }
.footer a { color:#cbd5e1; font-size:.9rem; display:block; margin-bottom:.5rem; }
.footer a:hover { color:#fff; padding-left: 4px; }
.footer-bottom { border-top:1px solid #1e293b; margin-top:2.5rem; padding-top:1.5rem; text-align:center; font-size:.85rem; color:#94a3b8; }

/* PAGINATION */
.pagination { display:flex; gap:.4rem; justify-content:center; margin-top:2.5rem; flex-wrap:wrap; }
.pagination a, .pagination span {
    padding:.6rem 1rem; border-radius:var(--radius-sm); background:var(--surface);
    border:1px solid var(--border); color:var(--text); font-size:.9rem; font-weight:600; transition: var(--transition);
}
.pagination a:hover { border-color:var(--primary); color:var(--primary); transform: translateY(-2px); }
.pagination .current { background: var(--grad-1); color:#fff; border-color:transparent; box-shadow: var(--shadow-glow); }

/* EMPTY */
.empty { text-align:center; padding:4rem 1.5rem; color:var(--text-muted); background:var(--surface); border-radius:var(--radius); border:2px dashed var(--border); }
.empty h3 { font-size: 1.3rem; color: var(--text); margin-bottom: .5rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-toggle { display:block; }
    .nav-links {
        position:absolute; top:68px; left:0; right:0;
        background:var(--surface); flex-direction:column;
        padding:1.5rem; gap:.8rem;
        border-bottom:1px solid var(--border); box-shadow:var(--shadow);
        display:none;
    }
    .nav-links.open { display:flex; }
    .nav-links a { width:100%; padding:.6rem 0; }
    .nav-links a:not(.btn)::after { display:none; }
    .article { padding:1.5rem; }
    .auth-card { padding:1.8rem; }
    .hero { padding: 3rem 0 2rem; }
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
