/* ============================================
   JIMATULARROBI — Portal Layout
   Sidebar + Main Content (News Portal Style)
   Mobile-First Responsive Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --accent: #ec4899;
    --accent-light: #f472b6;
    --accent-glow: rgba(236, 72, 153, 0.3);
    --emerald: #10b981;
    --amber: #f59e0b;

    /* Surfaces */
    --bg-deep: #050816;
    --bg-primary: #0a0f1e;
    --bg-secondary: #111827;
    --bg-card: rgba(15, 23, 42, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-bg-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Layout */
    --sidebar-width: 340px;
    --navbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ============ LIGHT MODE ============ */
[data-theme="light"] {
    --bg-deep: #f0f2f5;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(0, 0, 0, 0.03);
    --glass-bg-hover: rgba(0, 0, 0, 0.06);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-hover: rgba(0, 0, 0, 0.14);

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.2);
    --accent: #db2777;
    --accent-light: #ec4899;
    --accent-glow: rgba(219, 39, 119, 0.2);
}

/* ============ EMERALD NOIR THEME (Modern Green Dark) ============ */
[data-theme="emerald"],
[data-theme="emerald-dark"] {
    /* Color Palette */
    --primary: #10b981;
    --primary-light: #34d399;
    --primary-dark: #059669;
    --primary-glow: rgba(16, 185, 129, 0.4);
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --accent-glow: rgba(6, 182, 212, 0.35);
    --emerald: #10b981;
    --amber: #f59e0b;

    /* Surfaces */
    --bg-deep: #020805;
    --bg-primary: #05130b;
    --bg-secondary: #081d11;
    --bg-card: rgba(5, 22, 13, 0.72);
    --glass-bg: rgba(16, 185, 129, 0.05);
    --glass-bg-hover: rgba(16, 185, 129, 0.1);
    --glass-border: rgba(52, 211, 153, 0.14);
    --glass-border-hover: rgba(52, 211, 153, 0.32);

    /* Text */
    --text-primary: #f0fdf4;
    --text-secondary: #a7f3d0;
    --text-muted: #6ee7b7;
}

/* ============ EMERALD CLEAN LIGHT THEME (Modern Green Light) ============ */
[data-theme="emerald-light"] {
    /* Color Palette */
    --primary: #059669;
    --primary-light: #10b981;
    --primary-dark: #047857;
    --primary-glow: rgba(5, 150, 105, 0.25);
    --accent: #0891b2;
    --accent-light: #06b6d4;
    --accent-glow: rgba(8, 145, 178, 0.2);
    --emerald: #059669;
    --amber: #d97706;

    /* Surfaces */
    --bg-deep: #f2fbf6;
    --bg-primary: #ffffff;
    --bg-secondary: #e8f8f0;
    --bg-card: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(5, 150, 105, 0.04);
    --glass-bg-hover: rgba(5, 150, 105, 0.08);
    --glass-border: rgba(5, 150, 105, 0.12);
    --glass-border-hover: rgba(5, 150, 105, 0.25);

    /* Text */
    --text-primary: #0d281e;
    --text-secondary: #275240;
    --text-muted: #567e6c;
}

/* ============ RESET ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============ ANIMATED BACKGROUND SYSTEM ============ */
.background-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(160deg, #050816 0%, #0a0f1e 35%, #0f172a 70%, #170d36 100%);
    transition: background 0.6s ease;
}

/* Subtle Modern Grid Texture */
.bg-grid-mesh {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 85%);
    opacity: 0.8;
}

/* Floating Aurora Orbs */
.bg-glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.65;
    will-change: transform, opacity;
    pointer-events: none;
}

.orb-1 {
    width: 45vw;
    height: 45vw;
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(99, 102, 241, 0.05) 60%, transparent 75%);
    animation: aurora-orbit-1 24s infinite ease-in-out alternate;
}

.orb-2 {
    width: 50vw;
    height: 50vw;
    top: 35%;
    right: -15%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, rgba(236, 72, 153, 0.04) 60%, transparent 75%);
    animation: aurora-orbit-2 28s infinite ease-in-out alternate;
    animation-delay: -5s;
}

.orb-3 {
    width: 35vw;
    height: 35vw;
    bottom: -8%;
    left: 20%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, rgba(16, 185, 129, 0.03) 60%, transparent 75%);
    animation: aurora-orbit-3 22s infinite ease-in-out alternate;
    animation-delay: -10s;
}

.orb-4 {
    width: 28vw;
    height: 28vw;
    top: 20%;
    left: 45%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.02) 60%, transparent 75%);
    animation: aurora-orbit-4 26s infinite ease-in-out alternate;
    animation-delay: -7s;
}

.orb-5 {
    width: 25vw;
    height: 25vw;
    bottom: 20%;
    right: 25%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.02) 60%, transparent 75%);
    animation: aurora-orbit-1 30s infinite ease-in-out alternate;
    animation-delay: -15s;
}

/* Floating Particle Sparks */
.bg-particle-field {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px var(--primary-light);
    opacity: 0;
    animation: particle-drift 18s infinite ease-in-out;
}

.p-1 { width: 3px; height: 3px; left: 15%; top: 85%; animation-duration: 16s; animation-delay: 0s; }
.p-2 { width: 4px; height: 4px; left: 35%; top: 90%; animation-duration: 22s; animation-delay: 3s; }
.p-3 { width: 2px; height: 2px; left: 55%; top: 80%; animation-duration: 18s; animation-delay: 7s; }
.p-4 { width: 5px; height: 5px; left: 75%; top: 95%; animation-duration: 24s; animation-delay: 2s; }
.p-5 { width: 3px; height: 3px; left: 88%; top: 85%; animation-duration: 19s; animation-delay: 5s; }
.p-6 { width: 2px; height: 2px; left: 25%; top: 70%; animation-duration: 21s; animation-delay: 9s; }
.p-7 { width: 4px; height: 4px; left: 65%; top: 75%; animation-duration: 25s; animation-delay: 11s; }
.p-8 { width: 3px; height: 3px; left: 45%; top: 88%; animation-duration: 20s; animation-delay: 14s; }

/* Aurora Orbit Keyframes */
@keyframes aurora-orbit-1 {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(60px, -40px) scale(1.15) rotate(15deg); }
    66% { transform: translate(-40px, 50px) scale(0.9) rotate(-10deg); }
    100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}

@keyframes aurora-orbit-2 {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-70px, 50px) scale(1.12); }
    66% { transform: translate(50px, -60px) scale(0.88); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes aurora-orbit-3 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(80px, -60px) scale(1.2); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes aurora-orbit-4 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, -40px) scale(1.1); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes particle-drift {
    0% {
        transform: translateY(0) scale(0.4);
        opacity: 0;
    }
    15% {
        opacity: 0.75;
    }
    85% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-85vh) scale(1.2);
        opacity: 0;
    }
}

/* ============ THEME SPECIFIC ANIMATED BACKGROUNDS ============ */

/* EMERALD NOIR THEME (Rich Dark Cyber Aurora) */
[data-theme="emerald"] .background-animation,
[data-theme="emerald-dark"] .background-animation {
    background: linear-gradient(160deg, #020704 0%, #031208 30%, #062112 65%, #021a0e 100%);
}
[data-theme="emerald"] .bg-grid-mesh,
[data-theme="emerald-dark"] .bg-grid-mesh {
    background-image: 
        linear-gradient(to right, rgba(52, 211, 153, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(52, 211, 153, 0.04) 1px, transparent 1px);
}
[data-theme="emerald"] .orb-1,
[data-theme="emerald-dark"] .orb-1 {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.38) 0%, rgba(16, 185, 129, 0.06) 60%, transparent 75%);
}
[data-theme="emerald"] .orb-2,
[data-theme="emerald-dark"] .orb-2 {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.32) 0%, rgba(6, 182, 212, 0.05) 60%, transparent 75%);
}
[data-theme="emerald"] .orb-3,
[data-theme="emerald-dark"] .orb-3 {
    background: radial-gradient(circle, rgba(132, 204, 22, 0.25) 0%, rgba(132, 204, 22, 0.04) 60%, transparent 75%);
}
[data-theme="emerald"] .orb-4,
[data-theme="emerald-dark"] .orb-4 {
    background: radial-gradient(circle, rgba(52, 211, 153, 0.3) 0%, rgba(52, 211, 153, 0.05) 60%, transparent 75%);
}
[data-theme="emerald"] .orb-5,
[data-theme="emerald-dark"] .orb-5 {
    background: radial-gradient(circle, rgba(20, 184, 166, 0.25) 0%, rgba(20, 184, 166, 0.04) 60%, transparent 75%);
}
[data-theme="emerald"] .particle,
[data-theme="emerald-dark"] .particle {
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.9), 0 0 20px rgba(16, 185, 129, 0.6);
}

/* EMERALD CLEAN LIGHT (Fresh Soft Spring Aurora) */
[data-theme="emerald-light"] .background-animation {
    background: linear-gradient(160deg, #f2fbf6 0%, #e6f6ee 30%, #def2e8 65%, #edf9f3 100%);
}
[data-theme="emerald-light"] .bg-grid-mesh {
    background-image: 
        linear-gradient(to right, rgba(5, 150, 105, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(5, 150, 105, 0.04) 1px, transparent 1px);
    opacity: 0.6;
}
[data-theme="emerald-light"] .bg-glow-orb {
    opacity: 0.45;
    filter: blur(90px);
}
[data-theme="emerald-light"] .orb-1 {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, rgba(16, 185, 129, 0.04) 60%, transparent 75%);
}
[data-theme="emerald-light"] .orb-2 {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.16) 0%, rgba(6, 182, 212, 0.03) 60%, transparent 75%);
}
[data-theme="emerald-light"] .orb-3 {
    background: radial-gradient(circle, rgba(132, 204, 22, 0.14) 0%, rgba(132, 204, 22, 0.02) 60%, transparent 75%);
}
[data-theme="emerald-light"] .orb-4 {
    background: radial-gradient(circle, rgba(52, 211, 153, 0.18) 0%, rgba(52, 211, 153, 0.03) 60%, transparent 75%);
}
[data-theme="emerald-light"] .orb-5 {
    background: radial-gradient(circle, rgba(20, 184, 166, 0.14) 0%, rgba(20, 184, 166, 0.02) 60%, transparent 75%);
}
[data-theme="emerald-light"] .particle {
    background: #059669;
    box-shadow: 0 0 10px rgba(5, 150, 105, 0.4);
    opacity: 0.3;
}

/* CLEAN SLATE (Light Theme) */
[data-theme="light"] .background-animation {
    background: linear-gradient(160deg, #f0f2f5 0%, #e8ecf4 30%, #dfe6f0 65%, #eee5f5 100%);
}
[data-theme="light"] .bg-grid-mesh {
    background-image: 
        linear-gradient(to right, rgba(99, 102, 241, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(99, 102, 241, 0.035) 1px, transparent 1px);
    opacity: 0.5;
}
[data-theme="light"] .bg-glow-orb {
    opacity: 0.4;
    filter: blur(90px);
}
[data-theme="light"] .orb-1 {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 75%);
}
[data-theme="light"] .orb-2 {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.14) 0%, transparent 75%);
}
[data-theme="light"] .orb-3 {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 75%);
}
[data-theme="light"] .orb-4 {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 75%);
}
[data-theme="light"] .orb-5 {
    background: radial-gradient(circle, rgba(79, 70, 229, 0.14) 0%, transparent 75%);
}
[data-theme="light"] .particle {
    background: #6366f1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
    opacity: 0.3;
}

/* ============ READING PROGRESS BAR ============ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 9999;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* ============ NAVBAR ============ */
.navbar {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    transition: all 0.3s var(--ease-out);
}
.navbar.scrolled {
    background: var(--bg-deep);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}
.navbar::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.6;
}
.navbar.scrolled::after {
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 1;
    box-shadow: 0 0 10px var(--primary-glow);
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.85);
}
[data-theme="light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="emerald-light"] .navbar {
    background: rgba(255, 255, 255, 0.88);
    border-bottom-color: rgba(5, 150, 105, 0.12);
}
[data-theme="emerald-light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 25px rgba(5, 150, 105, 0.08);
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    font-size: 1rem;
    margin-right: 6px;
    position: relative;
    overflow: hidden;
}
.theme-toggle:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
    transform: rotate(15deg);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: all 0.4s var(--ease-out);
}
.theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
    color: #f59e0b;
}
.theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #818cf8;
}

/* Green Dark Theme (Emerald Noir): Moon Icon with green glow */
[data-theme="emerald"] .theme-toggle .icon-moon,
[data-theme="emerald-dark"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #34d399;
}
[data-theme="emerald"] .theme-toggle .icon-sun,
[data-theme="emerald-dark"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* Green Light Theme (Emerald Clean): Sun Icon with emerald color */
[data-theme="emerald-light"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #059669;
}
[data-theme="emerald-light"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

/* Midnight Dark */
[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #818cf8;
}
[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* Indigo Clean Light */
[data-theme="light"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #f59e0b;
}
[data-theme="light"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--navbar-height);
}
.brand {
    font-size: 1.15rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.brand-logo {
    max-height: 32px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}
.nav-links {
    display: flex;
    list-style: none;
    gap: 4px;
}
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.3s var(--ease-out);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-light);
    background: var(--glass-bg-hover);
}
.nav-links a i { font-size: 0.8rem; }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px; height: 40px;
    cursor: pointer;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    transition: background 0.3s;
    gap: 5px; padding: 8px;
    z-index: 1001;
}
.hamburger:hover { background: var(--glass-bg-hover); }
.hamburger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s var(--ease-out);
    transform-origin: center;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* ============ CONTAINER ============ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============ PAGE LAYOUT (2 Columns) ============ */
.page-layout {
    display: flex;
    gap: 28px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 24px 60px;
    align-items: flex-start;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--navbar-height) + 20px);
    max-height: calc(100vh - var(--navbar-height) - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
    padding: 0;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Sidebar Profile */
.sidebar-profile {
    text-align: center;
    padding: 28px 20px 20px;
}
.avatar-container {
    width: 90px; height: 90px;
    margin: 0 auto 16px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--emerald));
    background-size: 300% 300%;
    animation: gradient-rotate 6s ease infinite;
    position: relative;
}
.avatar-container::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    background-size: 300% 300%;
    animation: gradient-rotate 6s ease infinite;
    z-index: -1;
    opacity: 0.3;
    filter: blur(10px);
}
.avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-deep);
}
@keyframes gradient-rotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.sidebar-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.bio {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 8px;
    font-weight: 400;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 50px;
    font-size: 0.72rem;
    color: var(--emerald);
    font-weight: 500;
    margin-bottom: 16px;
}
.status-badge::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--emerald);
    border-radius: 50%;
    animation: blink 2s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.35s var(--ease-bounce);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.social-icons a::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.35s;
}
.social-icons a:nth-child(1)::before { background: linear-gradient(135deg, #ea4335, #fbbc05); }
.social-icons a:nth-child(2)::before { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-icons a:nth-child(3)::before { background: #000; }
.social-icons a:nth-child(4)::before { background: linear-gradient(135deg, #ff0000, #cc0000); }
.social-icons a:nth-child(5)::before { background: linear-gradient(135deg, #25d366, #128c7e); }
.social-icons a:hover {
    transform: translateY(-3px) scale(1.1);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.social-icons a:hover::before { opacity: 1; }
.social-icons a i { position: relative; z-index: 1; }

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border-hover), transparent);
    margin: 0 20px;
}

/* Sidebar Links Section */
.sidebar-links-section {
    padding: 16px 16px 20px;
}
.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    padding: 0 4px;
}
.sidebar-section-title i {
    color: var(--primary-light);
    font-size: 0.75rem;
}
.link-count {
    margin-left: auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Search */
.search-box {
    position: relative;
    margin-bottom: 12px;
}
.search-box input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: inherit;
    transition: all 0.3s var(--ease-out);
    outline: none;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}
.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Category Tabs in Sidebar */
.category-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.category-tab {
    padding: 5px 12px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    white-space: nowrap;
    font-family: inherit;
}
.category-tab:hover {
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
    background: var(--glass-bg-hover);
}
.category-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px var(--primary-glow);
}

/* Sidebar Links */
.links-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.25s var(--ease-out);
    position: relative;
    gap: 10px;
}
.sidebar-link:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border);
    color: var(--text-primary);
}
.sidebar-link i:first-child {
    font-size: 0.85rem;
    width: 20px;
    text-align: center;
    color: var(--primary-light);
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.25s;
}
.sidebar-link:hover i:first-child { opacity: 1; }
.sidebar-link span {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.link-arrow {
    font-size: 0.6rem;
    opacity: 0;
    transition: all 0.25s var(--ease-out);
    color: var(--text-muted);
    transform: translateX(-4px);
    flex-shrink: 0;
}
.sidebar-link:hover .link-arrow {
    opacity: 0.6;
    transform: translateX(0);
}
.link-item.hidden { display: none; }
.no-results {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-muted);
    font-size: 0.82rem;
    display: none;
}
.no-results.show { display: block; }
.no-results i {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 8px;
    opacity: 0.4;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    min-width: 0;
}

.main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.main-title {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}
.main-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
}
.btn-sm {
    font-size: 0.82rem;
    padding: 8px 16px;
}

/* ============ ARTICLES GRID (3 Columns) ============ */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.35s var(--ease-out);
    position: relative;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}
.article-card:hover {
    transform: translateY(-4px);
    border-color: var(--glass-border-hover);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}
.article-card-accent {
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.35s;
}
.article-card:hover .article-card-accent { opacity: 1; }

.article-card-body {
    padding: 16px 16px 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.article-card-thumbnail {
    width: 100%;
    height: 145px;
    object-fit: cover;
    object-position: center;
    border-bottom: 1px solid var(--glass-border);
    transition: transform 0.4s var(--ease-out);
}
.article-card:hover .article-card-thumbnail {
    transform: scale(1.04);
}
.article-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.article-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}
.article-tag:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}
[data-theme="emerald"] .article-tag,
[data-theme="emerald-dark"] .article-tag {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(52, 211, 153, 0.25);
    color: #34d399;
}
[data-theme="emerald-light"] .article-tag {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.2);
    color: #059669;
}
.article-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.article-card-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    min-height: 2.7em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}
.article-card-title a:hover { color: var(--primary-light); }

.article-card-excerpt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}
.article-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.author-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    transition: all 0.3s var(--ease-out);
}
.read-more:hover { color: #fff; gap: 7px; }
.read-more i { font-size: 0.68rem; transition: transform 0.3s var(--ease-out); }
.read-more:hover i { transform: translateX(3px); }

/* ============ CATEGORY WIDGET (ARTICLE LIST) ============ */
.article-category-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}
.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
    cursor: pointer;
}
.category-pill:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}
.category-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--primary-glow);
    transform: translateY(-2px);
}
.pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
}
.category-pill.active .pill-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

[data-theme="emerald"] .category-pill.active,
[data-theme="emerald-dark"] .category-pill.active {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}
[data-theme="emerald-light"] .category-pill {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(5, 150, 105, 0.15);
    color: var(--text-secondary);
}
[data-theme="emerald-light"] .category-pill:hover {
    background: #ffffff;
    border-color: rgba(5, 150, 105, 0.3);
    color: #064e3b;
}
[data-theme="emerald-light"] .category-pill.active {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}
[data-theme="light"] .category-pill {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
}

/* ============ PAGINATION STYLES ============ */
.pagination-wrapper {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.pagination-info {
    font-size: 0.86rem;
    color: var(--text-secondary);
}
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 6px 10px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(12px);
    flex-wrap: wrap;
    justify-content: center;
}
.page-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}
.page-num, .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.25s var(--ease-out);
    background: transparent;
    border: 1px solid transparent;
    gap: 6px;
}
.page-num {
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
}
.page-num:hover, .page-btn:not(.disabled):hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover);
    border-color: var(--glass-border);
    transform: translateY(-1px);
}
.page-num.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
    border-color: transparent;
}
.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.page-dots {
    color: var(--text-muted);
    font-weight: 700;
    padding: 0 4px;
    font-size: 0.9rem;
}

[data-theme="emerald"] .page-num.active,
[data-theme="emerald-dark"] .page-num.active {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

[data-theme="emerald-light"] .pagination {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(5, 150, 105, 0.18);
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.08);
}
[data-theme="emerald-light"] .page-num, 
[data-theme="emerald-light"] .page-btn {
    color: #275240;
}
[data-theme="emerald-light"] .page-num:hover,
[data-theme="emerald-light"] .page-btn:not(.disabled):hover {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.2);
    color: #047857;
}
[data-theme="emerald-light"] .page-num.active {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

[data-theme="light"] .pagination {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .page-num, 
[data-theme="light"] .page-btn {
    color: #475569;
}
[data-theme="light"] .page-num:hover,
[data-theme="light"] .page-btn:not(.disabled):hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    color: #4338ca;
}
[data-theme="light"] .page-num.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 24px;
    background: var(--bg-card);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-lg);
}
.empty-icon {
    width: 70px; height: 70px;
    margin: 0 auto 20px;
    background: var(--glass-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.empty-icon i {
    font-size: 1.6rem;
    color: var(--text-muted);
}
.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* ============ ARTICLE FULL (READ PAGE) ============ */
.article-read-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}
.article-full {
    padding: 32px 28px;
}
.article-full .article-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-primary);
    margin-bottom: 40px;
    white-space: normal;
    word-break: break-word;
}
.article-full .article-content,
.article-full .article-content p,
.article-full .article-content span,
.article-full .article-content h1,
.article-full .article-content h2,
.article-full .article-content h3,
.article-full .article-content h4,
.article-full .article-content h5,
.article-full .article-content h6,
.article-full .article-content li,
.article-full .article-content strong,
.article-full .article-content em,
.article-full .article-content b,
.article-full .article-content i {
    color: var(--text-primary) !important;
    background-color: transparent !important;
}
.article-content p {
    margin-bottom: 1.25rem;
    line-height: 1.85;
}
.article-content h1, .article-content h2, .article-content h3, .article-content h4 {
    color: var(--text-primary);
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    font-weight: 700;
    line-height: 1.3;
}
.article-content h1 { font-size: 1.65rem; }
.article-content h2 { font-size: 1.4rem; }
.article-content h3 { font-size: 1.2rem; }
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.article-content a {
    color: var(--primary-light);
    text-decoration: underline;
}
.article-content a:hover {
    text-decoration: none;
}
.article-content ul, .article-content ol {
    margin-left: 2rem;
    margin-bottom: 1.25rem;
}
.article-content li {
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}
.article-content strong {
    font-weight: 700;
    color: var(--text-primary);
}
.article-content em {
    font-style: italic;
}
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 18px;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--glass-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-content pre.ql-syntax {
    background: #0f172a;
    border: 1px solid var(--glass-border);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.9rem;
    color: #38bdf8;
    margin: 1.5rem 0;
}
.article-content .ql-align-center { text-align: center; }
.article-content .ql-align-right { text-align: right; }
.article-content .ql-align-justify { text-align: justify; text-justify: inter-word; }
.article-content .ql-size-small { font-size: 0.85em; }
.article-content .ql-size-large { font-size: 1.35em; font-weight: 600; }
.article-content .ql-size-huge { font-size: 1.8em; font-weight: 700; }
.article-hero-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    max-height: 380px;
    object-fit: cover;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.article-full .article-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}
.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.article-meta i { color: var(--primary-light); }
.reading-time { display: flex; align-items: center; gap: 6px; }

/* Share */
.share-section {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}
.share-section h4 {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}
.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.3s var(--ease-out);
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.share-btn.whatsapp {
    background: rgba(37, 211, 102, 0.12);
    color: #25d366;
    border: 1px solid rgba(37, 211, 102, 0.2);
}
.share-btn.whatsapp:hover { background: #25d366; color: #fff; }
.share-btn.copy-link {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}
.share-btn.copy-link:hover { background: var(--glass-bg-hover); color: var(--text-primary); }
.share-btn.copy-link.copied {
    background: rgba(16, 185, 129, 0.12);
    color: var(--emerald);
    border-color: rgba(16, 185, 129, 0.2);
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 20px;
    transition: all 0.3s var(--ease-out);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}
.back-link:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

/* ============ ADMIN PAGE ============ */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 14px;
}
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    font-family: inherit;
    font-size: 0.88rem;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 2px 10px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}
.w-100 { width: 100%; justify-content: center; padding: 14px; }

/* Form */
.form-container { padding: 28px; }
.form-group { margin-bottom: 22px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.88rem;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    transition: all 0.3s var(--ease-out);
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Table */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.modern-table { width: 100%; border-collapse: collapse; }
.modern-table th, .modern-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}
.modern-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.modern-table tbody tr { transition: background 0.2s; }
.modern-table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* Drag & Drop Reordering Table */
.drag-handle {
    cursor: grab;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all 0.2s ease;
    user-select: none;
}
.drag-handle:hover {
    color: var(--primary-light);
    transform: scale(1.2);
}
.drag-handle:active {
    cursor: grabbing;
}
tr.link-row {
    transition: all 0.2s ease, background 0.15s ease;
}
tr.link-row.dragging {
    opacity: 0.35;
    background: var(--glass-bg-hover);
}
tr.link-row.drag-over-top {
    border-top: 2px solid var(--primary-light);
}
tr.link-row.drag-over-bottom {
    border-bottom: 2px solid var(--primary-light);
}

.actions { display: flex; gap: 8px; }
.btn-icon {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s var(--ease-bounce);
    font-size: 0.82rem;
}
.btn-icon:hover { transform: scale(1.15); }
.btn-view { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }
.btn-edit { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.btn-delete { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-view:hover { background: #3b82f6; color: #fff; }
.btn-edit:hover { background: #f59e0b; color: #fff; }
.btn-delete:hover { background: #ef4444; color: #fff; }

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(10px);
}

/* ============ FOOTER ============ */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 36px 24px 24px;
    margin-top: 20px;
}
.footer-container { max-width: 1280px; margin: 0 auto; }
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}
.footer-brand {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.footer-social { display: flex; gap: 10px; }
.footer-social a {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
}
.footer-social a:hover {
    color: var(--primary-light);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}
.footer-info { color: var(--text-muted); font-size: 0.78rem; line-height: 1.6; }
.footer-info a { color: var(--text-secondary); text-decoration: none; transition: color 0.3s; }
.footer-info a:hover { color: var(--primary-light); }
.footer-divider {
    width: 50px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border-hover), transparent);
}
.footer-copyright { color: var(--text-muted); font-size: 0.72rem; }

/* ============ ANIMATIONS ============ */
@keyframes fadeInKeyframe {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes slideInKeyframe {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in {
    opacity: 1;
    animation: fadeInKeyframe 0.5s var(--ease-out) forwards;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.slide-in {
    opacity: 1;
    animation: slideInKeyframe 0.55s var(--ease-bounce) forwards;
}
.slide-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.link-item {
    opacity: 1;
    transform: translateX(0);
}
.link-item.visible {
    opacity: 1;
    transform: translateX(0);
}
.link-item:nth-child(1) { transition-delay: 0s; }
.link-item:nth-child(2) { transition-delay: 0.02s; }
.link-item:nth-child(3) { transition-delay: 0.04s; }
.link-item:nth-child(4) { transition-delay: 0.06s; }
.link-item:nth-child(5) { transition-delay: 0.08s; }
.link-item:nth-child(6) { transition-delay: 0.10s; }
.link-item:nth-child(7) { transition-delay: 0.12s; }
.link-item:nth-child(8) { transition-delay: 0.14s; }

/* ============ TABLET (768px - 1023px) ============ */
@media (min-width: 768px) and (max-width: 1023px) {
    .page-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        position: relative;
        top: auto;
        max-height: none;
    }
    .sidebar-profile {
        display: flex;
        align-items: center;
        gap: 16px;
        text-align: left;
        padding: 20px;
    }
    .avatar-container {
        width: 60px; height: 60px;
        margin: 0;
        flex-shrink: 0;
    }
    .sidebar-name { font-size: 1rem; }
    .bio { margin-bottom: 4px; }
    .status-badge { margin-bottom: 0; }
    .social-icons { justify-content: flex-start; }

    .sidebar-links-section {
        max-height: 300px;
        overflow-y: auto;
    }

    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============ DESKTOP (1024px+) ============ */
@media (min-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .article-full .article-title {
        font-size: 2.2rem;
    }
    .article-full {
        padding: 40px 36px;
    }
}

/* Large Desktop */
@media (min-width: 1280px) {
    :root {
        --sidebar-width: 360px;
    }
}

/* ============ MOBILE (max 767px) ============ */
@media (max-width: 767px) {
    .hamburger { display: flex; }

    .nav-links {
        position: fixed;
        top: 0; right: -280px;
        width: 280px; height: 100vh;
        flex-direction: column;
        background: rgba(10, 15, 30, 0.98);
        backdrop-filter: blur(20px);
        padding: 80px 20px 40px;
        gap: 4px;
        z-index: 999;
        transition: right 0.4s var(--ease-out);
        border-left: 1px solid var(--glass-border);
    }
    .nav-links.active { right: 0; }
    .nav-links a { padding: 14px 16px; font-size: 0.95rem; }
    .mobile-overlay { display: none; pointer-events: none; visibility: hidden; }
    .mobile-overlay.active { display: block; opacity: 1; pointer-events: auto; visibility: visible; }
    [data-theme="emerald"] .nav-links,
    [data-theme="emerald-dark"] .nav-links {
        background: rgba(3, 15, 8, 0.98);
        border-left-color: rgba(52, 211, 153, 0.2);
    }

    .nav-container { height: 56px; padding: 0 16px; }
    .container { padding: 0 16px; }

    /* Stack layout */
    .page-layout {
        flex-direction: column;
        padding: 16px 16px 40px;
        gap: 20px;
    }

    .sidebar {
        width: 100%;
        position: relative;
        top: auto;
        max-height: none;
        border-radius: var(--radius-md);
    }
    .sidebar-profile {
        padding: 20px 16px 16px;
    }
    .avatar-container { width: 70px; height: 70px; }
    .sidebar-name { font-size: 1rem; }
    .bio { font-size: 0.78rem; }
    .social-icons a { width: 32px; height: 32px; font-size: 0.8rem; }

    .sidebar-links-section {
        padding: 12px 12px 16px;
    }

    /* Collapsible links on mobile */
    .sidebar-links-section .links-container {
        max-height: 240px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.1) transparent;
    }

    .sidebar-link {
        padding: 9px 10px;
        font-size: 0.78rem;
    }

    /* Main content */
    .main-header { margin-bottom: 18px; }
    .main-title { font-size: 1.2rem; }
    .main-subtitle { font-size: 0.8rem; }
    .btn-sm { font-size: 0.78rem; padding: 7px 12px; }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .article-card { border-radius: var(--radius-md); }
    .article-card-body { padding: 18px 16px; }
    .article-card-title { font-size: 1rem; }
    .article-card-excerpt { font-size: 0.82rem; -webkit-line-clamp: 2; }

    /* Article read */
    .article-read-container { padding: 20px 16px 40px; }
    .article-full { padding: 20px 16px; border-radius: var(--radius-md); }
    .article-full .article-title { font-size: 1.3rem; }
    .article-meta { flex-direction: column; gap: 8px; }
    .article-content { font-size: 0.92rem; line-height: 1.75; }

    /* Admin */
    .admin-header { flex-direction: column; align-items: stretch; }
    .admin-header .btn { justify-content: center; }
    .modern-table th, .modern-table td { padding: 10px; font-size: 0.82rem; }

    .share-buttons { flex-direction: column; }
    .share-btn { justify-content: center; }

    footer { padding: 24px 16px 16px; }
}

/* ============ SMALL MOBILE (max 380px) ============ */
@media (max-width: 380px) {
    .sidebar-name { font-size: 0.9rem; }
    .avatar-container { width: 60px; height: 60px; }
    .social-icons a { width: 30px; height: 30px; font-size: 0.75rem; }
    .category-tab { padding: 4px 10px; font-size: 0.68rem; }
    .sidebar-link { font-size: 0.75rem; padding: 8px; }
    .main-title { font-size: 1.05rem; }
    .article-card-title { font-size: 0.92rem; }
}

/* ============ UTILITY ============ */
.text-center { text-align: center; }
.p-4 { padding: 24px 16px; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    z-index: 10000;
    transition: transform 0.4s var(--ease-bounce);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast i { color: var(--emerald); }

/* ============ LIGHT MODE OVERRIDES ============ */
/* These target elements with hard-coded dark colors */

[data-theme="light"] .brand {
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .sidebar-name {
    background: linear-gradient(135deg, var(--text-primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .avatar {
    border-color: #fff;
}

[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .article-card {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .article-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .main-title {
    background: linear-gradient(135deg, var(--text-primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .article-full .article-title {
    background: linear-gradient(135deg, var(--text-primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .article-content {
    color: #374151;
}

[data-theme="light"] .footer-brand {
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .hamburger span {
    background: var(--text-primary);
}

[data-theme="light"] .toast {
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .empty-state {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .nav-links a {
    color: #475569;
}
[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-links a.active {
    color: #4338ca;
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .sidebar-link {
    color: #475569;
}
[data-theme="light"] .sidebar-link:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
    color: #1e293b;
}
[data-theme="light"] .sidebar-link i:first-child {
    color: #4f46e5;
}

[data-theme="light"] .portal-link-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .portal-link-card:hover {
    background: #ffffff;
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.12);
}
[data-theme="light"] .portal-link-icon {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
[data-theme="light"] .portal-link-content h3 {
    color: #1e293b;
}
[data-theme="light"] .portal-category-badge {
    background: rgba(79, 70, 229, 0.08);
    color: #4338ca;
    border: 1px solid rgba(79, 70, 229, 0.15);
}
[data-theme="light"] .portal-link-arrow {
    color: #94a3b8;
}
[data-theme="light"] .portal-link-card:hover .portal-link-arrow {
    color: #4f46e5;
}

/* Light mode mobile nav */
@media (max-width: 767px) {
    [data-theme="light"] .nav-links {
        background: rgba(255, 255, 255, 0.98);
        border-left-color: var(--glass-border);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.08);
    }
    [data-theme="light"] .mobile-overlay.active {
        background: rgba(0, 0, 0, 0.3);
    }
}

/* ============ EMERALD NOIR THEME OVERRIDES ============ */
[data-theme="emerald"] .brand {
    background: linear-gradient(135deg, #34d399 0%, #06b6d4 50%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="emerald"] .sidebar-name {
    background: linear-gradient(135deg, #f0fdf4 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="emerald"] .main-title {
    background: linear-gradient(135deg, #f0fdf4 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="emerald"] .article-full .article-title {
    background: linear-gradient(135deg, #f0fdf4 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="emerald"] .footer-brand {
    background: linear-gradient(135deg, #34d399, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="emerald"] .avatar-container {
    background: linear-gradient(135deg, #10b981, #06b6d4, #84cc16);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
}

[data-theme="emerald"] .avatar-container::before {
    background: linear-gradient(135deg, #10b981, #06b6d4);
}

[data-theme="emerald"] .article-card:hover {
    border-color: rgba(52, 211, 153, 0.35);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.15);
}

[data-theme="emerald"] .portal-link-card:hover {
    border-color: rgba(52, 211, 153, 0.4);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.2);
}

[data-theme="emerald"] .category-tab.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

[data-theme="emerald"] .btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

[data-theme="emerald"] .btn-primary:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

[data-theme="emerald"] .status-badge {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(52, 211, 153, 0.3);
    color: #34d399;
}

/* ============ EMERALD CLEAN LIGHT THEME OVERRIDES ============ */
[data-theme="emerald-light"] .brand {
    background: linear-gradient(135deg, #059669 0%, #0891b2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="emerald-light"] .sidebar-name {
    background: linear-gradient(135deg, #064e3b 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="emerald-light"] .avatar {
    border-color: #ffffff;
}

[data-theme="emerald-light"] .avatar-container {
    background: linear-gradient(135deg, #10b981, #06b6d4, #84cc16);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
}

[data-theme="emerald-light"] .sidebar {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 24px rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.15);
}

[data-theme="emerald-light"] .article-card {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 14px rgba(5, 150, 105, 0.06);
    border-color: rgba(5, 150, 105, 0.15);
}

[data-theme="emerald-light"] .article-card:hover {
    border-color: rgba(5, 150, 105, 0.4);
    box-shadow: 0 12px 35px rgba(5, 150, 105, 0.15);
}

[data-theme="emerald-light"] .glass-card {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 14px rgba(5, 150, 105, 0.06);
    border-color: rgba(5, 150, 105, 0.15);
}

[data-theme="emerald-light"] .portal-link-card {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(5, 150, 105, 0.15);
    box-shadow: 0 2px 12px rgba(5, 150, 105, 0.06);
}

[data-theme="emerald-light"] .portal-link-card:hover {
    background: #ffffff;
    border-color: rgba(5, 150, 105, 0.4);
    box-shadow: 0 8px 30px rgba(5, 150, 105, 0.15);
}

[data-theme="emerald-light"] .portal-link-icon {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

[data-theme="emerald-light"] .portal-link-content h3 {
    color: #064e3b;
}

[data-theme="emerald-light"] .portal-category-badge {
    background: rgba(5, 150, 105, 0.1);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

[data-theme="emerald-light"] .portal-link-arrow {
    color: #567e6c;
}

[data-theme="emerald-light"] .portal-link-card:hover .portal-link-arrow {
    color: #059669;
}

[data-theme="emerald-light"] .nav-links a {
    color: #275240;
}

[data-theme="emerald-light"] .nav-links a:hover,
[data-theme="emerald-light"] .nav-links a.active {
    color: #047857;
    background: rgba(5, 150, 105, 0.12);
}

[data-theme="emerald-light"] .sidebar-link {
    color: #275240;
}

[data-theme="emerald-light"] .sidebar-link:hover {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.2);
    color: #064e3b;
}

[data-theme="emerald-light"] .sidebar-link i:first-child {
    color: #059669;
}

[data-theme="emerald-light"] .category-tab.active {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

[data-theme="emerald-light"] .btn-primary {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

[data-theme="emerald-light"] .btn-primary:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

[data-theme="emerald-light"] .status-badge {
    background: rgba(5, 150, 105, 0.12);
    border-color: rgba(5, 150, 105, 0.25);
    color: #047857;
}

[data-theme="emerald-light"] .main-title {
    background: linear-gradient(135deg, #064e3b 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="emerald-light"] .article-full .article-title {
    background: linear-gradient(135deg, #064e3b 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="emerald-light"] .article-content {
    color: #1e3a2f;
}

[data-theme="emerald-light"] .footer-brand {
    background: linear-gradient(135deg, #059669, #0891b2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="emerald-light"] .hamburger span {
    background: var(--text-primary);
}

[data-theme="emerald-light"] .toast {
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(5, 150, 105, 0.12);
}

[data-theme="emerald-light"] .empty-state {
    background: rgba(255, 255, 255, 0.75);
}

@media (max-width: 767px) {
    [data-theme="emerald-light"] .nav-links {
        background: rgba(255, 255, 255, 0.98);
        border-left-color: var(--glass-border);
        box-shadow: -10px 0 40px rgba(5, 150, 105, 0.12);
    }
    [data-theme="emerald-light"] .mobile-overlay.active {
        background: rgba(5, 40, 25, 0.3);
    }
}

/* Theme Option Cards in Admin Settings */
.theme-card {
    transition: all 0.25s var(--ease-out);
    cursor: pointer;
    border-radius: var(--radius-md);
}
.theme-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.theme-card.selected {
    box-shadow: 0 0 0 2px var(--primary), 0 8px 24px var(--primary-glow);
}

/* Smooth transition for all theme-switchable elements */
body,
.navbar,
.sidebar,
.article-card,
.glass-card,
.toast,
.empty-state,
footer,
.search-box input,
.form-control,
.category-tab,
.sidebar-link,
.btn,
.btn-icon {
    transition-property: background-color, background, color, border-color, box-shadow;
    transition-duration: 0.4s;
    transition-timing-function: ease;
}

/* ============ QUILL EDITOR FIXES ============ */
.ql-toolbar.ql-snow {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.ql-container.ql-snow {
    border-color: var(--glass-border);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
}
[data-theme="light"] .ql-toolbar.ql-snow,
[data-theme="emerald-light"] .ql-toolbar.ql-snow {
    background: rgba(255, 255, 255, 0.5);
}
.ql-snow .ql-stroke {
    stroke: var(--text-primary);
}
.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill {
    fill: var(--text-primary);
}
.ql-snow .ql-picker {
    color: var(--text-primary);
}


/* ============ PORTAL LINKS GRID ============ */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.portal-link-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s var(--ease-out);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.portal-link-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-light);
    box-shadow: 0 12px 30px rgba(0,0,0,0.22);
}
.portal-link-icon {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.portal-link-card:hover .portal-link-icon {
    transform: scale(1.06) rotate(2deg);
    box-shadow: 0 6px 18px var(--primary-glow);
}
.portal-link-content {
    flex-grow: 1;
    min-width: 0;
}
.portal-link-content h3 {
    margin: 0 0 4px 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.portal-category-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    border: 1px solid rgba(99, 102, 241, 0.15);
}
.portal-link-arrow {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%) translateX(-6px);
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0;
    transition: all 0.3s var(--ease-out);
}
.portal-link-card:hover .portal-link-arrow {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    color: var(--primary-light);
}

/* ============================================
   ARTICLE VIEWS & COMMENTS BADGES & SECTION
   ============================================ */
.article-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.article-card-meta-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.article-card-meta-right .article-date,
.article-card-meta-right .article-views,
.article-card-meta-right .article-comments {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.article-card-meta-right i {
    color: var(--primary-light);
    font-size: 0.72rem;
}

/* Article Detail Meta */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}
.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.article-meta i {
    color: var(--primary-light);
}
.article-meta .comments-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}
.article-meta .comments-link:hover {
    color: var(--primary-light);
}

/* Comments Section Container */
.comments-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--glass-border);
}
.comments-header {
    margin-bottom: 24px;
}
.comments-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.comments-header h3 i {
    color: var(--primary-light);
}
.badge-count {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.25);
}
[data-theme="emerald"] .badge-count,
[data-theme="emerald-dark"] .badge-count {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.25);
}
[data-theme="emerald-light"] .badge-count {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
    border-color: rgba(5, 150, 105, 0.2);
}

/* Alert Notification Boxes */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.92rem;
    font-weight: 500;
}
.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #10b981;
}
[data-theme="light"] .alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
}
[data-theme="light"] .alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

/* Comment Form Layout */
.comment-form {
    padding: 24px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    margin-bottom: 36px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
[data-theme="emerald"] .comment-form,
[data-theme="emerald-dark"] .comment-form {
    background: rgba(4, 25, 14, 0.55);
    border-color: rgba(16, 185, 129, 0.18);
}
[data-theme="emerald-light"] .comment-form,
[data-theme="light"] .comment-form {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}
.comment-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 640px) {
    .comment-form-row {
        grid-template-columns: 1fr;
    }
}
.comment-form .form-group {
    margin-bottom: 16px;
}
.comment-form .form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.comment-form .form-group label i {
    color: var(--primary-light);
    font-size: 0.82rem;
}
.comment-form .form-control {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}
[data-theme="emerald"] .comment-form .form-control,
[data-theme="emerald-dark"] .comment-form .form-control {
    background: rgba(2, 12, 6, 0.7);
    border-color: rgba(16, 185, 129, 0.2);
    color: #f1f5f9;
}
[data-theme="light"] .comment-form .form-control,
[data-theme="emerald-light"] .comment-form .form-control {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}
.comment-form .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.comment-form-submit {
    display: flex;
    justify-content: flex-end;
}

/* Comments List Layout */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.comments-empty {
    text-align: center;
    padding: 40px 20px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    color: var(--text-muted);
}
.comments-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--primary-light);
    opacity: 0.6;
}
.comments-empty p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}
.comments-empty span {
    font-size: 0.85rem;
}

.comment-item {
    display: flex;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
[data-theme="emerald"] .comment-item,
[data-theme="emerald-dark"] .comment-item {
    background: rgba(4, 25, 14, 0.45);
    border-color: rgba(16, 185, 129, 0.12);
}
[data-theme="emerald-light"] .comment-item,
[data-theme="light"] .comment-item {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}
.comment-item:hover {
    border-color: var(--glass-border-hover);
    background: var(--glass-bg-hover);
}
.comment-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    user-select: none;
}
.comment-body {
    flex-grow: 1;
    min-width: 0;
}
.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.comment-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.comment-user-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}
.comment-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.comment-content {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-secondary);
    word-break: break-word;
}
.btn-delete-comment {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ef4444;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-delete-comment:hover {
    background: #ef4444;
    color: #ffffff;
}
