/* ============================================
   BraceCoder - Modern Blog Theme
   A unique developer-focused blog design
   ============================================ */

/* --- CSS Variables / Theme --- */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: #eef2ff;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --success: #10b981;
    --danger: #ef4444;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --bg: #f8fafc;
    --bg-white: #ffffff;
    --bg-dark: #0f172a;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --max-width: 1200px;
    --header-height: 70px;
    /* Accent colors for content elements */
    --accent-cyan: #00d4ff;
    --accent-orange: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-purple: #a78bfa;
    --bg-code: #1e293b;
    --heading: #1e293b;
    --code-keyword: #c792ea;
    --code-string: #c3e88d;
    --code-comment: #546e7a;
    --code-function: #82e0aa;
    --code-number: #f78c6c;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* --- Top Bar --- */
.top-bar {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    padding: 0.4rem 0;
}
.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar-left span { display: flex; align-items: center; gap: 0.4rem; }
.top-bar-right { display: flex; gap: 1rem; }
.top-bar-right a {
    color: rgba(255,255,255,0.6);
    transition: color 0.2s;
    font-size: 0.85rem;
}
.top-bar-right a:hover { color: #fff; }

/* --- Navbar --- */
.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.95);
}
.nav-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 100%;
}

/* Logo */
.logo, .footer-logo {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}
.logo:hover { color: var(--text); }
.logo-brace {
    color: var(--primary);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.5em;
    line-height: 1;
}
.logo-text { letter-spacing: -0.5px; }

/* Nav Search */
.nav-search {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.4rem 0.5rem 0.4rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.nav-search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    color: var(--text);
}
.nav-search input::placeholder { color: var(--text-muted); }
.nav-search button {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.2s;
}
.nav-search button:hover { background: var(--primary-dark); }

/* Nav Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-link {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}
.nav-link:hover {
    background: var(--primary-bg);
    color: var(--primary);
}
.btn-login {
    background: var(--primary) !important;
    color: #fff !important;
    border-radius: 100px !important;
    padding: 0.5rem 1.25rem !important;
}
.btn-login:hover { background: var(--primary-dark) !important; }

/* User Dropdown */
.nav-user { position: relative; }
.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    transition: border-color 0.2s;
}
.nav-user-btn:hover { border-color: var(--primary); }
.nav-user-btn i { font-size: 0.7rem; color: var(--text-muted); }
.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 100;
}
.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    color: var(--text);
    font-size: 0.85rem;
    transition: background 0.15s;
}
.user-dropdown a:hover { background: var(--bg); }
.user-dropdown a i { color: var(--text-muted); width: 16px; text-align: center; }

/* Mobile Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 0.5rem;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Search */
.mobile-search {
    display: none;
    background: var(--bg-white);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.mobile-search form {
    display: flex;
    gap: 0.5rem;
}
.mobile-search input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.9rem;
    outline: none;
}
.mobile-search input:focus { border-color: var(--primary); }
.mobile-search button {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 40px;
    border-radius: 50%;
    font-size: 0.9rem;
}

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245,158,11,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
}
.hero-text { color: #fff; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(99,102,241,0.2);
    color: var(--primary-light);
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(99,102,241,0.3);
}
.hero-text h1 {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}
.hero-text h1 a { color: #fff; }
.hero-text h1 a:hover { color: var(--primary-light); }
.hero-text > p {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}
.hero-meta span { display: flex; align-items: center; gap: 0.4rem; }
.hero-meta i { color: var(--primary-light); }

/* Hero Code Card */
.hero-visual {
    display: flex;
    justify-content: center;
}
.hero-code-card {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
.code-header-dots {
    display: flex;
    gap: 6px;
    padding: 0.85rem 1rem;
    background: rgba(0,0,0,0.3);
}
.code-header-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.code-header-dots span:nth-child(1) { background: #ff5f57; }
.code-header-dots span:nth-child(2) { background: #febc2e; }
.code-header-dots span:nth-child(3) { background: #28c840; }
.code-body {
    padding: 1.25rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 2;
}
.code-body .line { display: block; }
.code-body .kw { color: #c792ea; }
.code-body .var { color: #82aaff; }
.code-body .fn { color: #82e0aa; }
.code-body .str { color: #c3e88d; }
.code-body .cm { color: #546e7a; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.8rem; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

/* --- Categories Ribbon --- */
.categories-ribbon {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}
.categories-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.25rem;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 100px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.category-chip:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}
.chip-count {
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 100px;
    font-weight: 700;
}

/* --- Content Grid --- */
.content-section { padding: 2.5rem 0; }
.content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2.5rem;
    align-items: start;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-header h2 i { color: var(--primary); }

/* --- Post Cards --- */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
}
.post-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.post-card-body { padding: 1.5rem; }
.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.post-category {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.post-date { font-size: 0.8rem; color: var(--text-muted); }
.post-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-light);
}
.post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 500;
}
.author-avatar-tiny {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}
.post-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.post-stats span { display: flex; align-items: center; gap: 0.3rem; }

/* --- Post Card Cover Image --- */
.post-card.has-cover {
    display: grid;
    grid-template-columns: 280px 1fr;
}
.post-card-cover {
    overflow: hidden;
    position: relative;
}
.post-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.post-card:hover .post-card-cover img {
    transform: scale(1.05);
}

/* Hero Cover Image */
.hero-cover-image {
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}
.hero-cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Article Cover Image */
.article-cover {
    width: 100%;
    max-height: 450px;
    overflow: hidden;
}
.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Image Upload Area (Admin) */
.image-upload-area {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s;
    background: var(--bg);
}
.image-upload-area:hover {
    border-color: var(--primary);
}
.image-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    text-align: center;
    gap: 0.5rem;
}
.upload-placeholder i {
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: 0.25rem;
}
.upload-placeholder p {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-light);
}
.upload-placeholder span {
    font-size: 0.78rem;
}
.upload-preview {
    position: relative;
}
.upload-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}
.remove-image {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    border: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.15s;
}
.remove-image:hover {
    transform: scale(1.1);
}

/* --- Sidebar --- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
}
.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-bg);
}
.widget-title i { color: var(--primary); }

/* Widget Search */
.widget-search { background: var(--primary); padding: 1.5rem; }
.widget-search form {
    display: flex;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.widget-search input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    color: #fff;
    outline: none;
    font-size: 0.85rem;
}
.widget-search input::placeholder { color: rgba(255,255,255,0.6); }
.widget-search button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 0 1rem;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.widget-search button:hover { background: rgba(255,255,255,0.3); }

/* Popular Posts */
.popular-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    transition: all 0.2s;
}
.popular-item:last-child { border-bottom: none; padding-bottom: 0; }
.popular-item:first-child { padding-top: 0; }
.popular-item:hover { color: var(--primary); }
.popular-num {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-bg);
    line-height: 1;
    min-width: 36px;
}
.popular-item:hover .popular-num { color: var(--primary); }
.popular-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}
.popular-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Category List */
.category-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    color: var(--text);
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.15s;
}
.category-list li:last-child a { border-bottom: none; }
.category-list li a:hover {
    color: var(--primary);
    padding-left: 0.5rem;
}
.cat-count {
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
}

/* --- Ad Styles --- */
.ad-section { padding: 1.5rem 0; }
.ad-banner, .ad-inline, .widget-ad {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ad-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}
.ad-inline { margin: 1.25rem 0; }
.ad-sticky-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 0.5rem;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.ad-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg);
    border: 1px solid var(--border);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.ad-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* --- Article Page --- */
.breadcrumb-section {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 0;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb i { font-size: 0.6rem; }

.post-section { padding: 2.5rem 0; }

.article {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.article-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}
.article-category {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 1rem;
}
.article-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 1.25rem;
    letter-spacing: -0.5px;
    color: var(--text);
}
.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.article-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
}
.article-author strong { display: block; font-size: 0.9rem; }
.article-author span { font-size: 0.8rem; color: var(--text-muted); }
.article-stats {
    display: flex;
    gap: 1.25rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.article-stats span { display: flex; align-items: center; gap: 0.3rem; }

/* Article Content */
.article-content {
    padding: 2rem;
    font-size: 1.05rem;
    line-height: 1.85;
    color: #334155;
}
.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--text);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-bg);
}
.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.75rem 0 0.75rem;
    color: var(--text);
}
.article-content p { margin-bottom: 1.25rem; }
.article-content ul, .article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}
.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.75;
    border: 1px solid #334155;
}
.article-content pre code {
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
}
.article-content code {
    font-family: var(--font-mono);
    background: #1e293b;
    border: 1px solid #334155;
    color: #e8b4b8;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.85em;
}
.article-content a { color: var(--primary); text-decoration: underline; }
.article-content strong { font-weight: 600; color: var(--text); }
.article-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--primary-bg);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-light);
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0 1.75rem;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.article-content table th {
    background: var(--bg);
    color: var(--text);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.article-content table td {
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    vertical-align: top;
}
.article-content table tbody tr:nth-child(even) {
    background: var(--bg);
}
.article-content table tbody tr:hover {
    background: var(--primary-bg);
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
}
.article-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 2rem 0;
}
.article-content mark {
    background: #fef08a;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* Video Embed (responsive 16:9) */
.article-content .video-embed,
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 20px 0;
    border-radius: 10px;
    background: #000;
}
.article-content .video-embed iframe,
.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Content Buttons / CTA */
.article-content .content-btn,
.content-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    margin: 8px 6px 8px 0;
    border: 2px solid transparent;
    line-height: 1.4;
}
.content-btn i {
    font-size: 0.85em;
}
/* Download — green */
.content-btn.btn-download {
    background: #059669;
    color: #fff;
    border-color: #059669;
}
.content-btn.btn-download:hover {
    background: #047857;
    border-color: #047857;
    box-shadow: 0 4px 12px rgba(5,150,105,0.35);
    transform: translateY(-2px);
}
/* Click Here — primary */
.content-btn.btn-click {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.content-btn.btn-click:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
    transform: translateY(-2px);
}
/* Read More — outline */
.content-btn.btn-more {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.content-btn.btn-more:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
    transform: translateY(-2px);
}
/* Live Demo — orange/amber */
.content-btn.btn-demo {
    background: #f59e0b;
    color: #1e293b;
    border-color: #f59e0b;
}
.content-btn.btn-demo:hover {
    background: #d97706;
    border-color: #d97706;
    box-shadow: 0 4px 12px rgba(245,158,11,0.35);
    transform: translateY(-2px);
}
/* GitHub — dark */
.content-btn.btn-github {
    background: #24292e;
    color: #fff;
    border-color: #24292e;
}
.content-btn.btn-github:hover {
    background: #1b1f23;
    border-color: #1b1f23;
    box-shadow: 0 4px 12px rgba(36,41,46,0.4);
    transform: translateY(-2px);
}
/* View Docs — teal */
.content-btn.btn-docs {
    background: #0d9488;
    color: #fff;
    border-color: #0d9488;
}
.content-btn.btn-docs:hover {
    background: #0f766e;
    border-color: #0f766e;
    box-shadow: 0 4px 12px rgba(13,148,136,0.35);
    transform: translateY(-2px);
}
/* Watch Video — red */
.content-btn.btn-video {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.content-btn.btn-video:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 4px 12px rgba(220,38,38,0.35);
    transform: translateY(-2px);
}
/* Custom — slate outline */
.content-btn.btn-custom {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.content-btn.btn-custom:hover {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
    box-shadow: 0 4px 12px rgba(30,41,59,0.25);
    transform: translateY(-2px);
}
/* Responsive buttons */
@media (max-width: 480px) {
    .content-btn {
        padding: 8px 16px;
        font-size: 0.82rem;
    }
}

/* Share Buttons */
.article-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
}
.share-buttons { display: flex; gap: 0.5rem; }
.share-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: none;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.share-btn:hover { transform: scale(1.1); color: #fff; }
.share-twitter { background: #1da1f2; }
.share-linkedin { background: #0077b5; }
.share-copy { background: var(--text-light); }

/* Related Posts */
.related-posts {
    padding: 2rem;
    border-top: 1px solid var(--border-light);
}
.related-posts h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.related-posts h3 i { color: var(--primary); }
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.related-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    color: var(--text);
    transition: all 0.2s;
}
.related-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--text);
}
.related-category {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.related-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0.5rem 0;
    line-height: 1.4;
}
.related-views {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* --- Comments --- */
.comments-section {
    padding: 2rem;
    border-top: 1px solid var(--border-light);
}
.comments-section > h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.comments-section > h3 i { color: var(--primary); }

.comment-form {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 2rem;
}
.comment-form-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-light);
}
.comment-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    background: var(--bg-white);
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}
.comment-form textarea:focus { border-color: var(--primary); }

.comment-login-prompt {
    background: var(--primary-bg);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-light);
}
.comment-login-prompt i { font-size: 1.5rem; color: var(--primary); margin-bottom: 0.5rem; display: block; }
.comment-login-prompt a { font-weight: 600; }

.comments-list { display: flex; flex-direction: column; gap: 1.25rem; }
.comment {
    display: flex;
    gap: 0.85rem;
}
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}
.comment-body {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
}
.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.comment-header strong { font-size: 0.88rem; }
.comment-date { font-size: 0.75rem; color: var(--text-muted); }
.comment-body p { font-size: 0.9rem; color: var(--text-light); line-height: 1.65; }

.no-comments {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}
.no-comments i { font-size: 2rem; margin-bottom: 0.75rem; display: block; color: var(--border); }

/* --- Auth Pages --- */
.auth-page {
    padding: 2rem 0;
    min-height: calc(100vh - var(--header-height) - 40px);
    display: flex;
    align-items: center;
}
.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    width: 100%;
}
.auth-card { padding: 2.5rem; }
.auth-header { text-align: center; margin-bottom: 1.75rem; }
.auth-logo {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
}
.auth-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.35rem; }
.auth-header p { color: var(--text-muted); font-size: 0.9rem; }

.auth-visual {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}
.auth-visual::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99,102,241,0.2), transparent 70%);
    border-radius: 50%;
}
.auth-visual-content {
    text-align: center;
    position: relative;
    z-index: 1;
}
.code-block-visual {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: left;
    margin-bottom: 1.5rem;
}
.code-block-visual pre {
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 2;
    color: #e2e8f0;
}
.code-block-visual .kw { color: #c792ea; }
.code-block-visual .var { color: #82aaff; }
.code-block-visual .fn { color: #82e0aa; }
.code-block-visual .str { color: #c3e88d; }
.code-block-visual .cm { color: #546e7a; }
.auth-visual h2 { color: #fff; font-size: 1.25rem; margin-bottom: 0.5rem; }
.auth-visual p { color: rgba(255,255,255,0.6); font-size: 0.9rem; }

/* Auth Form */
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.form-group label i { color: var(--text-muted); font-size: 0.8rem; }
.form-group input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    background: var(--bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.password-input {
    position: relative;
    display: flex;
    align-items: center;
}
.password-input input { padding-right: 2.75rem; }
.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.25rem;
}
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.auth-footer a { font-weight: 600; }

/* --- Alerts --- */
.alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}
.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* --- Search Page --- */
.search-page { padding: 2.5rem 0; }
.search-header { text-align: center; margin-bottom: 2rem; }
.search-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.search-header h1 i { color: var(--primary); }
.search-form-large {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 100px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.search-form-large:focus-within { border-color: var(--primary); }
.search-form-large input {
    flex: 1;
    padding: 0.85rem 1.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
}
.search-form-large button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}
.search-form-large button:hover { background: var(--primary-dark); }
.search-results-info {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-light);
}
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.no-results i { font-size: 3rem; margin-bottom: 1rem; display: block; color: var(--border); }
.no-results h2 { font-size: 1.25rem; color: var(--text); margin-bottom: 0.5rem; }
.search-suggestions { text-align: center; padding: 2rem 0; }
.search-suggestions h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

/* --- Categories Page --- */
.categories-page { padding: 2.5rem 0; }
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.page-header h1 i { color: var(--primary); }
.page-header p { color: var(--text-muted); }
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
    color: var(--text);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
}
.category-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    color: var(--text);
}
.category-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 1rem;
    transition: all 0.3s;
}
.category-card:hover .category-icon {
    background: var(--accent);
    color: #fff;
    transform: scale(1.1);
}
.category-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; }
.category-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.category-count {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 600;
}

/* --- Our Platforms / Ecosystem Section --- */
.our-platforms {
    padding: 3rem 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
}
.platforms-header {
    text-align: center;
    margin-bottom: 2rem;
}
.platforms-header h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.platforms-header h2 i { color: var(--primary); }
.platforms-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}
.platforms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.platform-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
}
.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    color: var(--text);
}
.platform-card-header {
    padding: 1.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.platform-cloud .platform-card-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}
.platform-sales .platform-card-header {
    background: linear-gradient(135deg, #78350f 0%, #f59e0b 100%);
}
.platform-icon {
    width: 54px;
    height: 54px;
    background: rgba(255,255,255,0.18);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.3s;
}
.platform-card:hover .platform-icon { transform: scale(1.1) rotate(-4deg); }
.platform-header-text h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
}
.platform-badge {
    display: inline-flex;
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.platform-card-body {
    padding: 1.5rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.platform-card-body > p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 1.25rem;
}
.platform-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.platform-features li {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.platform-features li i {
    color: var(--success);
    font-size: 0.72rem;
    flex-shrink: 0;
}
.platform-cta {
    margin-top: auto;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: gap 0.25s;
}
.platform-card:hover .platform-cta { gap: 0.7rem; }
.platform-cloud .platform-cta { color: #2563eb; }
.platform-sales .platform-cta { color: #d97706; }
.platform-cloud:hover { border-color: #2563eb44; }
.platform-sales:hover  { border-color: #f59e0b44; }

@media (max-width: 768px) {
    .platforms-grid { grid-template-columns: 1fr; }
}

/* --- 404 Page --- */
.not-found {
    text-align: center;
    padding: 4rem 1rem;
}
.not-found h1 {
    font-size: 5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.not-found p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Category Page Header */
.category-page { padding: 2rem 0; }
.category-header {
    margin-bottom: 2rem;
}
.category-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 0.25rem;
}
.category-header h1 i { color: var(--primary); }
.category-header p { color: var(--text-muted); font-size: 0.9rem; }

/* --- Footer --- */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    padding: 3.5rem 0 0;
    margin-top: 2rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-logo {
    display: inline-flex;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}
.footer-logo .logo-text { color: #fff; }
.footer-about p { font-size: 0.88rem; line-height: 1.7; margin-bottom: 1.25rem; }
.footer-social {
    display: flex;
    gap: 0.75rem;
}
.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.footer-social a:hover {
    background: var(--primary);
    color: #fff;
}
.footer-links h4, .footer-newsletter h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}
.footer-links ul { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    transition: all 0.2s;
}
.footer-links a:hover { color: #fff; padding-left: 0.3rem; }
.footer-newsletter p { font-size: 0.88rem; margin-bottom: 1rem; }
.newsletter-form {
    display: flex;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.newsletter-form input {
    flex: 1;
    padding: 0.7rem 1rem;
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    font-size: 0.85rem;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.4); }
.newsletter-form button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.7rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}
.newsletter-form button:hover { background: var(--primary-dark); }
.footer-bottom {
    padding: 1.25rem 0;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
}

/* --- Admin Styles --- */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - var(--header-height) - 40px);
}
.admin-sidebar {
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
}
.admin-sidebar h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.admin-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s;
}
.admin-nav a:hover, .admin-nav a.active {
    background: var(--primary-bg);
    color: var(--primary);
}
.admin-nav a i { width: 18px; text-align: center; }
.admin-main { padding: 2rem; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.admin-header h1 { font-size: 1.5rem; font-weight: 700; }

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.admin-table th {
    background: var(--bg);
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }
.admin-actions { display: flex; gap: 0.5rem; }
.admin-actions a, .admin-actions button {
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text);
    transition: all 0.15s;
}
.admin-actions a:hover { border-color: var(--primary); color: var(--primary); }
.admin-actions .delete-btn:hover { border-color: var(--danger); color: var(--danger); background: #fef2f2; }

/* Admin Form */
.admin-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}
.admin-form .form-group { margin-bottom: 1.25rem; }
/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.65rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: sticky;
    top: var(--header-height);
    z-index: 10;
}
.toolbar-group {
    display: flex;
    gap: 2px;
}
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.toolbar-btn:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}
.toolbar-btn:active {
    background: var(--primary);
    color: #fff;
    transform: scale(0.95);
}
.toolbar-btn i {
    font-size: 0.82rem;
}
.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 0.35rem;
    flex-shrink: 0;
}
.editor-toolbar + textarea {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.admin-form textarea {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    outline: none;
    resize: vertical;
    background: var(--bg);
    transition: border-color 0.2s;
}
.admin-form textarea:focus { border-color: var(--primary); }
.admin-form select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    background: var(--bg);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}
.admin-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-published { background: #f0fdf4; color: #16a34a; }
.status-draft { background: #fefce8; color: #ca8a04; }

/* Admin Cover Thumbnail */
.admin-cover-thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.no-cover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 40px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    .sidebar { position: static; }
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero-visual { display: none; }
    .hero-meta { justify-content: center; }
    .hero-text .btn { display: inline-flex; }
    .post-card.has-cover { grid-template-columns: 220px 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .related-grid { grid-template-columns: 1fr 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
}

/* Mobile */
@media (max-width: 768px) {
    html { font-size: 15px; }

    .top-bar { display: none; }

    .nav-search { display: none; }
    .mobile-search { display: block; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 1.5rem;
        gap: 0.5rem;
        z-index: 999;
        box-shadow: var(--shadow-lg);
        border-bottom: 2px solid var(--primary);
        max-height: none;
        overflow: visible;
    }
    .nav-links.active { display: flex; }
    .nav-link { padding: 0.85rem 1rem; font-size: 1rem; border-radius: var(--radius-sm); }
    .btn-login { text-align: center; margin-top: 0.5rem; }

    .nav-toggle { display: flex; }

    .post-card.has-cover {
        grid-template-columns: 1fr;
    }
    .post-card-cover {
        height: 200px;
    }

    .hero-section { padding: 2.5rem 0; }
    .hero-text h1 { font-size: 1.75rem; }
    .hero-meta { gap: 0.75rem; font-size: 0.8rem; }

    .auth-container { grid-template-columns: 1fr; max-width: 450px; }
    .auth-visual { display: none; }
    .auth-card { padding: 2rem 1.5rem; }

    .article-header { padding: 1.5rem; }
    .article-title { font-size: 1.5rem; }
    .article-content { padding: 1.5rem; font-size: 1rem; }
    .article-content pre { font-size: 0.8rem; padding: 1rem; }
    .article-share { padding: 1rem 1.5rem; flex-direction: column; gap: 0.75rem; }
    .article-meta { flex-direction: column; align-items: flex-start; }
    .related-posts { padding: 1.5rem; }
    .related-grid { grid-template-columns: 1fr; }
    .comments-section { padding: 1.5rem; }

    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }

    .categories-grid { grid-template-columns: 1fr 1fr; }

    .search-form-large { flex-direction: column; border-radius: var(--radius); }
    .search-form-large input { padding: 0.85rem 1rem; }
    .search-form-large button { padding: 0.85rem; justify-content: center; }

    .admin-form .form-row { grid-template-columns: 1fr; }

    .editor-toolbar {
        position: static;
        gap: 0.15rem;
        padding: 0.4rem;
    }
    .toolbar-btn { width: 30px; height: 30px; font-size: 0.75rem; }
    .toolbar-btn i { font-size: 0.75rem; }
    .toolbar-divider { margin: 0 0.2rem; height: 20px; }

    .ad-sticky-bottom { padding: 0.35rem; }
}

/* Small Mobile */
@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .hero-text h1 { font-size: 1.4rem; }
    .categories-grid { grid-template-columns: 1fr; }
    .post-card-body { padding: 1.25rem; }
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2.5rem 0 1rem;
    flex-wrap: wrap;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.page-btn:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}
.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.page-dots {
    color: var(--text-muted);
    padding: 0 0.25rem;
    user-select: none;
}
.page-indicator {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--primary-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* ============================================
   Tags / Hashtags
   ============================================ */
.article-tags,
.article-tags-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}
.article-tags-bottom {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border-light);
    align-items: center;
}
.article-tags-bottom > span {
    font-weight: 600;
    color: var(--text);
    margin-right: 0.25rem;
}
.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.3rem 0.75rem;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.tag-badge:hover {
    background: var(--primary);
    color: #fff;
}
.tag-badge i {
    font-size: 0.7rem;
}

/* Tags checkbox in admin */
.tags-checkbox-group {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem 0.6rem;
    padding: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 280px;
    overflow-y: auto;
}
.tags-checkbox-group::-webkit-scrollbar { width: 4px; }
.tags-checkbox-group::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
@media (max-width: 1024px) {
    .tags-checkbox-group { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .tags-checkbox-group { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
    .tags-checkbox-group { grid-template-columns: repeat(2, 1fr); }
}
.tag-checkbox {
    cursor: pointer;
    display: block;
}
.tag-checkbox input[type="checkbox"] {
    display: none;
}
.tag-checkbox span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.5rem;
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}
.tag-checkbox input:checked + span {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}
.tag-checkbox:hover span {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}
.tag-checkbox input:checked:hover + span {
    background: var(--primary-dark);
    color: #fff;
    border-color: var(--primary-dark);
}

/* ============================================
   New Tag Input (Admin)
   ============================================ */
.new-tag-input-wrap {
    margin-top: 0.75rem;
    padding: 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.new-tag-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.new-tag-row input {
    flex: 1;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    outline: none;
    background: var(--bg-white);
    transition: border-color 0.2s;
}
.new-tag-row input:focus {
    border-color: var(--primary);
}
.new-tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.new-tag-pills:empty {
    margin-bottom: 0;
}
.new-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: var(--success);
    color: #fff;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.new-tag-pill button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.1rem;
    cursor: pointer;
    transition: color 0.15s;
}
.new-tag-pill button:hover {
    color: #fff;
}

/* ============================================
   Article Content - Info Boxes
   ============================================ */
.article-content .info-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-cyan);
    border-radius: 8px;
    padding: 18px 22px;
    margin: 20px 0;
    font-size: 15px;
}
.article-content .info-box.warn { border-left-color: var(--accent-orange); }
.article-content .info-box.success { border-left-color: var(--accent-green); }
.article-content .info-box.error { border-left-color: var(--accent-red); }
.article-content .info-box strong { color: var(--heading); }
.article-content .info-box .label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    display: block;
}
.article-content .info-box .label { color: var(--accent-cyan); }
.article-content .info-box.warn .label { color: var(--accent-orange); }
.article-content .info-box.success .label { color: var(--accent-green); }
.article-content .info-box.error .label { color: var(--accent-red); }

/* ============================================
   Article Content - Code Blocks (Enhanced)
   ============================================ */
.article-content pre {
    background: var(--bg-code);
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 20px 24px;
    overflow-x: auto;
    margin: 16px 0 24px;
    position: relative;
}
.article-content pre code {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.65;
    color: #e0e6f0;
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
}
.article-content code {
    font-family: var(--font-mono);
    background: #1e293b;
    border: 1px solid #334155;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.85em;
    color: #e8b4b8;
    font-weight: 400;
}

/* Syntax highlighting — shared classes */
.article-content .kw { color: var(--code-keyword); font-weight: 500; }
.article-content .str { color: var(--code-string); }
.article-content .cmt { color: var(--code-comment); font-style: italic; }
.article-content .fn { color: var(--code-function); }
.article-content .num { color: var(--code-number); }
.article-content .var { color: #82aaff; }
.article-content .type { color: #ffcb6b; font-weight: 500; }
.article-content .attr { color: #bb80b3; }
.article-content .val { color: var(--code-string); }
.article-content .tag-name { color: #f07178; }
.article-content .anno { color: #ffcb6b; font-style: italic; }
.article-content .prompt { color: var(--accent-green); user-select: none; }
.article-content .output { color: var(--text-muted); }

/* Legacy SQL-prefixed classes (backward compatible) */
.article-content .sql-kw { color: var(--code-keyword); font-weight: 500; }
.article-content .sql-str { color: var(--code-string); }
.article-content .sql-cmt { color: var(--code-comment); font-style: italic; }
.article-content .sql-fn { color: var(--code-function); }
.article-content .sql-num { color: var(--code-number); }

/* ============================================
   Language-Specific Tag Label Colors
   ============================================ */
.article-content pre .tag {
    position: absolute;
    top: 10px;
    right: 14px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 0.85;
}
/* SQL */
.article-content pre.lang-sql .tag { color: #ff9800; background: rgba(255,152,0,0.1); }
/* PHP */
.article-content pre.lang-php .tag { color: #8892be; background: rgba(136,146,190,0.1); }
/* JavaScript / JS */
.article-content pre.lang-javascript .tag,
.article-content pre.lang-js .tag { color: #f7df1e; background: rgba(247,223,30,0.1); }
/* TypeScript / TS */
.article-content pre.lang-typescript .tag,
.article-content pre.lang-ts .tag { color: #3178c6; background: rgba(49,120,198,0.15); }
/* Python */
.article-content pre.lang-python .tag { color: #3776ab; background: rgba(55,118,171,0.15); }
/* Java */
.article-content pre.lang-java .tag { color: #f89820; background: rgba(248,152,32,0.1); }
/* Kotlin */
.article-content pre.lang-kotlin .tag { color: #b125ea; background: rgba(177,37,234,0.1); }
/* XML */
.article-content pre.lang-xml .tag { color: #e44d26; background: rgba(228,77,38,0.1); }
/* HTML */
.article-content pre.lang-html .tag { color: #e44d26; background: rgba(228,77,38,0.1); }
/* CSS */
.article-content pre.lang-css .tag { color: #264de4; background: rgba(38,77,228,0.15); }
/* JSON */
.article-content pre.lang-json .tag { color: #a6e22e; background: rgba(166,226,46,0.1); }
/* YAML */
.article-content pre.lang-yaml .tag { color: #cb171e; background: rgba(203,23,30,0.1); }
/* Bash / Shell */
.article-content pre.lang-bash .tag,
.article-content pre.lang-shell .tag { color: #4eaa25; background: rgba(78,170,37,0.1); }
/* C */
.article-content pre.lang-c .tag { color: #a8b9cc; background: rgba(168,185,204,0.1); }
/* C++ */
.article-content pre.lang-c .tag { color: #00599c; background: rgba(0,89,156,0.15); }
/* C# */
.article-content pre.lang-c .tag { color: #68217a; background: rgba(104,33,122,0.1); }
/* Go */
.article-content pre.lang-go .tag { color: #00add8; background: rgba(0,173,216,0.1); }
/* Rust */
.article-content pre.lang-rust .tag { color: #dea584; background: rgba(222,165,132,0.1); }
/* Ruby */
.article-content pre.lang-ruby .tag { color: #cc342d; background: rgba(204,52,45,0.1); }
/* Swift */
.article-content pre.lang-swift .tag { color: #f05138; background: rgba(240,81,56,0.1); }
/* Dart */
.article-content pre.lang-dart .tag { color: #0175c2; background: rgba(1,117,194,0.15); }
/* Docker */
.article-content pre.lang-docker .tag,
.article-content pre.lang-dockerfile .tag { color: #2496ed; background: rgba(36,150,237,0.1); }
/* Nginx */
.article-content pre.lang-nginx .tag { color: #009639; background: rgba(0,150,57,0.1); }
/* PowerShell */
.article-content pre.lang-powershell .tag { color: #5391fe; background: rgba(83,145,254,0.1); }
/* Groovy */
.article-content pre.lang-groovy .tag { color: #4298b8; background: rgba(66,152,184,0.1); }
/* Scala */
.article-content pre.lang-scala .tag { color: #dc322f; background: rgba(220,50,47,0.1); }
/* R */
.article-content pre.lang-r .tag { color: #276dc3; background: rgba(39,109,195,0.15); }
/* Lua */
.article-content pre.lang-lua .tag { color: #000080; background: rgba(0,0,128,0.15); }
/* Perl */
.article-content pre.lang-perl .tag { color: #39457e; background: rgba(57,69,126,0.15); }
/* INI / TOML / Config */
.article-content pre.lang-ini .tag,
.article-content pre.lang-toml .tag,
.article-content pre.lang-config .tag { color: #6d8086; background: rgba(109,128,134,0.1); }
/* Markdown */
.article-content pre.lang-markdown .tag,
.article-content pre.lang-md .tag { color: #083fa1; background: rgba(8,63,161,0.15); }
/* Apache */
.article-content pre.lang-apache .tag { color: #d22128; background: rgba(210,33,40,0.1); }
/* Default fallback */
.article-content pre[class^="lang-"] .tag {
    color: var(--text-muted);
    background: rgba(148,163,184,0.1);
}

/* ============================================
   Article Content - Tables (Enhanced)
   ============================================ */
.article-content .env-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 15px;
}
.article-content .env-table th {
    background: var(--bg-card);
    color: var(--heading);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border: 1px solid var(--border);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.article-content .env-table td {
    padding: 10px 16px;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 14px;
}

/* ============================================
   Article Content - Diagram Box
   ============================================ */
.article-content .diagram {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    margin: 24px 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-muted);
    line-height: 2;
    overflow-x: auto;
    white-space: pre;
}
.article-content .diagram .db { color: var(--accent-cyan); font-weight: 600; }
.article-content .diagram .arrow { color: var(--accent-purple); }
.article-content .diagram .log { color: var(--accent-orange); }

/* ============================================
   Article Content - Responsive
   ============================================ */
@media (max-width: 640px) {
    .article-content pre { padding: 14px 16px; }
    .article-content code { font-size: 12.5px; }
    .article-content .info-box { padding: 14px 16px; font-size: 14px; }
    .article-content .diagram { padding: 16px; font-size: 12px; }
    .article-content table { font-size: 0.85rem; }
    .article-content table th,
    .article-content table td { padding: 0.5rem 0.65rem; }
}

/* ============================================
   OTP Verification Page
   ============================================ */
.otp-input-group {
    display: flex;
    justify-content: center;
}
.otp-input {
    text-align: center;
    font-size: 1.75rem !important;
    font-weight: 700;
    letter-spacing: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.85rem 1rem !important;
    max-width: 280px;
}
.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}
.otp-actions {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}
.otp-actions .divider {
    color: var(--border);
    margin: 0 0.5rem;
}
.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s;
}
.btn-text:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Forgot password link */
.form-options {
    display: flex;
    justify-content: flex-end;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
}
.forgot-link {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.forgot-link:hover {
    text-decoration: underline;
}

/* ============================================
   Newsletter Message
   ============================================ */
.newsletter-msg {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}
.newsletter-msg.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}
.newsletter-msg.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ============================================
   Admin Cards & Subscriber Page
   ============================================ */
.admin-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
}
.admin-card h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.send-to-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.radio-option:hover {
    background: var(--bg);
}
.radio-option input[type="radio"] {
    accent-color: var(--primary);
}
.subscriber-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* ============================================
   Post Navigation (Prev / Next)
   ============================================ */
.post-navigation {
    display: flex;
    gap: 1.5rem;
    margin: 2.5rem 0;
    padding: 0;
}
.post-nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
    min-height: 80px;
}
.post-nav-link:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.post-nav-link:hover .post-nav-label {
    color: var(--primary);
}
.post-nav-link i {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: color 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}
.post-nav-link:hover i {
    color: var(--primary);
}
.post-nav-prev:hover i {
    transform: translateX(-4px);
}
.post-nav-next:hover i {
    transform: translateX(4px);
}
.post-nav-next {
    text-align: right;
    flex-direction: row-reverse;
}
.post-nav-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.post-nav-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    transition: color 0.3s ease;
}
.post-nav-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-nav-empty {
    flex: 1;
    min-height: 80px;
    border: none;
    background: transparent;
}

/* ============================================
   Admin Ads Management Page
   ============================================ */
.ads-slots-list {
    display: grid;
    gap: 1.25rem;
}
.ad-slot-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.ad-slot-card:hover {
    box-shadow: var(--shadow);
}
.ad-slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
}
.ad-slot-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.ad-slot-name {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 4px;
    font-family: var(--font-mono);
}
.ad-slot-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
}
.ad-slot-toggle input[type="checkbox"] {
    accent-color: var(--success);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.ad-slot-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}
.ad-slot-fields label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
}
.ad-slot-fields input[type="text"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    transition: border-color 0.2s;
}
.ad-slot-fields input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============================================
   Category-Based Tag Suggestions
   ============================================ */
.tag-suggested-label {
    display: block;
    width: 100%;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 0.25rem;
    padding: 0.35rem 0.5rem;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
}
.tag-suggested {
    position: relative;
    background: rgba(99, 102, 241, 0.04);
    border-radius: var(--radius-sm);
    padding: 0.15rem 0.25rem;
}
.tag-suggested::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 2px;
}

/* ============================================
   Responsive - Post Navigation
   ============================================ */
@media (max-width: 640px) {
    .post-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    .post-nav-next {
        text-align: left;
        flex-direction: row;
    }
    .post-nav-link {
        padding: 1rem;
    }
    .post-nav-empty {
        display: none;
    }
    .ad-slot-fields {
        grid-template-columns: 1fr;
    }
}
