/* =============================================
   ForumHub — Complete CSS
   ============================================= */

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

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

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2235;
    --bg-card-hover: #222d44;
    --bg-input: #151d30;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dark: #4f46e5;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #2d3a52;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gradient-1: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    --gradient-2: linear-gradient(135deg, #3b82f6, #6366f1);
    --gradient-3: linear-gradient(135deg, #06b6d4, #6366f1);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 30px rgba(99,102,241,0.15);
    --radius-sm: 8px;
    --radius: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== ANIMATED BACKGROUND ===== */
.bg-animation {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
    animation: orbFloat 25s ease-in-out infinite;
}

.orb-1 {
    width: 600px; height: 600px;
    background: #6366f1;
    top: -15%; left: -8%;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px; height: 500px;
    background: #8b5cf6;
    top: 40%; right: -12%;
    animation-delay: -8s;
    animation-duration: 30s;
}

.orb-3 {
    width: 450px; height: 450px;
    background: #06b6d4;
    bottom: -10%; left: 25%;
    animation-delay: -16s;
    animation-duration: 22s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    20% { transform: translate(60px, -80px) scale(1.1) rotate(5deg); }
    40% { transform: translate(-40px, 60px) scale(0.95) rotate(-3deg); }
    60% { transform: translate(80px, 40px) scale(1.05) rotate(8deg); }
    80% { transform: translate(-60px, -30px) scale(0.9) rotate(-5deg); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== HEADER ===== */
header {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(45, 58, 82, 0.6);
    transition: all 0.35s ease;
}

header.scrolled {
    background: rgba(10, 14, 26, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    border-bottom-color: var(--border);
}

.header-inner {
    max-width: 1400px; margin: 0 auto;
    padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex; align-items: center; gap: 12px;
    cursor: pointer; text-decoration: none;
    transition: transform 0.2s;
}

.logo:hover { transform: scale(1.02); }

.logo-icon {
    width: 44px; height: 44px;
    background: var(--gradient-1);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 900; color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: box-shadow 0.3s, transform 0.3s;
}

.logo:hover .logo-icon {
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.6);
    transform: rotate(-3deg);
}

.logo-text {
    font-size: 24px; font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.main-nav { display: flex; gap: 4px; }

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.main-nav a::before {
    content: '';
    position: absolute; bottom: 0; left: 50%; right: 50%;
    height: 2px; background: var(--accent);
    transition: all 0.3s; border-radius: 1px;
}

.main-nav a:hover::before,
.main-nav a.active::before {
    left: 20%; right: 20%;
}

.main-nav a:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.main-nav a.active {
    color: var(--accent-light);
    background: rgba(99, 102, 241, 0.12);
}

.header-actions { display: flex; align-items: center; gap: 12px; }

.user-menu {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; padding: 6px 14px;
    border-radius: var(--radius);
    transition: var(--transition);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}

.user-menu:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.user-avatar-sm {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.user-display-name { font-weight: 600; font-size: 14px; }

.mobile-toggle {
    display: none;
    background: none; border: none;
    color: var(--text-primary);
    font-size: 26px; cursor: pointer;
    padding: 8px; border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mobile-toggle:hover { background: rgba(255,255,255,0.05); }

/* ===== MAIN CONTENT ===== */
.main-content {
    position: relative; z-index: 1;
    padding-top: 70px; min-height: 100vh;
}

.page { display: none; animation: pageIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.page.active { display: block; }

@keyframes pageIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 22px;
    border-radius: var(--radius);
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    border: none; font-family: inherit;
    text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    position: relative; overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.1);
    opacity: 0; transition: opacity 0.3s;
}

.btn:hover::after { opacity: 1; }

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--gradient-1); color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-light);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent; color: var(--text-secondary);
    padding: 8px 14px;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn:disabled::after { display: none; }

/* ===== HERO ===== */
.hero {
    padding: 100px 0 70px;
    text-align: center;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute; bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 200px; height: 2px;
    background: var(--gradient-1);
    opacity: 0.3;
}

.hero h1 {
    font-size: 56px; font-weight: 900;
    line-height: 1.15; margin-bottom: 24px;
    background: linear-gradient(135deg, #f1f5f9 0%, #6366f1 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: heroText 3s ease-in-out infinite alternate;
}

@keyframes heroText {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.1); }
}

.hero p {
    font-size: 19px; color: var(--text-secondary);
    max-width: 650px; margin: 0 auto 44px;
    line-height: 1.8;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero-stats {
    display: flex; justify-content: center;
    gap: 56px; margin-top: 60px;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    transition: var(--transition);
}

.hero-stat:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.15);
    transform: translateY(-4px);
}

.hero-stat-value {
    font-size: 38px; font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-label {
    font-size: 14px; color: var(--text-muted);
    margin-top: 6px; font-weight: 500;
}

/* ===== SECTION HEADERS ===== */
.section-header { padding: 30px 0 12px; }
.section-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.3px; }
.section-subtitle { color: var(--text-secondary); font-size: 15px; margin-bottom: 28px; }
.section-flex {
    display: flex; align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}

/* ===== FORUM GRID ===== */
.forum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px; padding: 40px 0;
}

.forum-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: hidden;
}

.forum-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.4s;
    transform-origin: left;
}

.forum-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.forum-card:hover::before { transform: scaleX(1); }

.cat-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; margin-bottom: 18px;
    transition: transform 0.3s;
}

.forum-card:hover .cat-icon { transform: scale(1.1) rotate(-5deg); }

.cat-icon.purple { background: rgba(99, 102, 241, 0.15); }
.cat-icon.blue { background: rgba(59, 130, 246, 0.15); }
.cat-icon.green { background: rgba(34, 197, 94, 0.15); }
.cat-icon.orange { background: rgba(245, 158, 11, 0.15); }
.cat-icon.pink { background: rgba(236, 72, 153, 0.15); }
.cat-icon.cyan { background: rgba(6, 182, 212, 0.15); }
.cat-icon.red { background: rgba(239, 68, 68, 0.15); }
.cat-icon.yellow { background: rgba(234, 179, 8, 0.15); }

.cat-title { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.cat-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 18px; }
.cat-meta { display: flex; gap: 24px; font-size: 13px; color: var(--text-muted); }
.cat-meta span { display: flex; align-items: center; gap: 6px; }

/* ===== FORUM HEADER ===== */
.forum-header { padding: 44px 0 20px; }
.forum-header h2 { font-size: 30px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.3px; }
.forum-header p { color: var(--text-secondary); font-size: 15px; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--text-muted);
    margin-bottom: 24px; flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--accent-light);
    text-decoration: none; cursor: pointer;
    transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb span { opacity: 0.5; }

/* ===== SEARCH BAR ===== */
.search-bar {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    margin: 20px 0;
    transition: all 0.3s;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-bar input {
    flex: 1; background: none; border: none;
    color: var(--text-primary);
    font-family: inherit; font-size: 15px;
    outline: none;
}

.search-bar input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 20px; }

/* ===== TOPIC LIST ===== */
.topic-list { margin: 20px 0 40px; }

.topic-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 26px;
    margin-bottom: 14px;
    display: flex; align-items: center; gap: 20px;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.topic-item::after {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--gradient-1);
    opacity: 0; transition: opacity 0.3s;
}

.topic-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.topic-item:hover::after { opacity: 1; }

.topic-avatar {
    width: 50px; height: 50px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px; color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.topic-item:hover .topic-avatar { transform: scale(1.08); }

.topic-info { flex: 1; min-width: 0; }
.topic-title {
    font-size: 16px; font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.topic-meta {
    font-size: 13px; color: var(--text-muted);
    display: flex; gap: 16px; flex-wrap: wrap;
}

.topic-stats {
    display: flex; gap: 28px; text-align: center; flex-shrink: 0;
}

.topic-stat-value { font-size: 18px; font-weight: 700; color: var(--accent-light); }
.topic-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== TAGS ===== */
.tag {
    display: inline-block; padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px; font-weight: 600;
    margin-right: 8px; white-space: nowrap;
}

.tag-pinned { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tag-hot { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.tag-new { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.tag-solved { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.15);
}

.card-header {
    padding: 20px 26px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}

.card-header h3 { font-size: 16px; font-weight: 700; }
.card-body { padding: 26px; }

/* ===== THREAD / POST ===== */
.thread-page { max-width: 920px; margin: 0 auto; padding: 40px 24px; }

.post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
    animation: postIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: var(--transition);
}

.post:hover {
    border-color: rgba(99, 102, 241, 0.15);
}

@keyframes postIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.post-header {
    display: flex; align-items: center; gap: 16px;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border);
}

.post-avatar {
    width: 50px; height: 50px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.post-author-name { font-weight: 700; font-size: 15px; }

.post-role {
    display: inline-block; padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px; font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-light); margin-left: 10px;
}

.post-role.admin {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.post-date { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.post-body { padding: 26px; font-size: 15px; line-height: 1.85; color: var(--text-secondary); }

.post-actions {
    display: flex; gap: 8px;
    padding: 16px 26px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.post-action {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-muted);
    cursor: pointer; padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    background: none; border: none;
    font-family: inherit; white-space: nowrap;
}

.post-action:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.post-action.liked {
    color: var(--accent-light);
    background: rgba(99, 102, 241, 0.1);
}

.post-action .count { font-weight: 600; }

.new-comment-badge {
    color: var(--accent-light);
    font-size: 12px; margin-left: 12px;
    font-weight: 600;
}

/* ===== REPLY BOX ===== */
.reply-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-top: 24px;
    animation: postIn 0.4s;
}

.reply-box h3 { margin-bottom: 18px; font-size: 18px; font-weight: 700; }

.reply-box textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    color: var(--text-primary);
    font-family: inherit; font-size: 14px;
    resize: vertical; min-height: 130px;
    transition: all 0.3s;
    line-height: 1.6;
}

.reply-box textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.reply-box textarea:disabled {
    opacity: 0.5; cursor: not-allowed;
}

.reply-box .btn { margin-top: 14px; }
.reply-box .btn + .btn { margin-left: 10px; }

/* ===== QUOTE BOX ===== */
.quote-box {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 18px;
    display: none;
    position: relative;
    animation: fadeIn 0.3s;
}

.quote-box.visible { display: block; }

.quote-author {
    font-weight: 600; color: var(--accent-light);
    font-size: 13px; margin-bottom: 8px;
}

.quote-text {
    font-size: 14px; color: var(--text-secondary);
    font-style: italic; max-height: 100px;
    overflow: hidden;
}

.quote-close {
    position: absolute; right: 14px; top: 14px;
    cursor: pointer; color: var(--text-muted);
    font-size: 18px; background: none; border: none;
    transition: color 0.2s;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}

.quote-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

/* ===== ARTICLES ===== */
.article-page { max-width: 920px; margin: 0 auto; padding: 50px 24px; }

.article-header { margin-bottom: 44px; }

.article-category-tag {
    display: inline-block; padding: 6px 18px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-light);
    font-size: 13px; font-weight: 600;
    margin-bottom: 18px;
}

.article-header h1 {
    font-size: 38px; font-weight: 900;
    line-height: 1.25; margin-bottom: 18px;
    letter-spacing: -0.5px;
}

.article-info {
    display: flex; align-items: center; gap: 14px;
    color: var(--text-secondary); font-size: 14px;
}

.article-avatar {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.article-content {
    font-size: 16px; line-height: 1.9;
    color: var(--text-secondary);
}

.article-content h2 {
    font-size: 26px; font-weight: 700;
    color: var(--text-primary);
    margin: 44px 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.article-content h3 {
    font-size: 21px; font-weight: 600;
    color: var(--text-primary);
    margin: 34px 0 14px;
}

.article-content p { margin-bottom: 18px; }
.article-content ul, .article-content ol { margin: 18px 0; padding-left: 26px; }
.article-content li { margin-bottom: 10px; }

.article-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 18px 22px; margin: 28px 0;
    background: rgba(99, 102, 241, 0.04);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article-content code {
    background: rgba(99, 102, 241, 0.12);
    padding: 3px 10px; border-radius: var(--radius-sm);
    font-size: 14px; color: var(--accent-light);
    font-family: 'Fira Code', monospace;
}

.article-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px; margin: 24px 0;
    overflow-x: auto;
}

.article-content pre code {
    background: none; padding: 0;
    color: var(--text-primary);
}

.article-tags {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-top: 34px; padding-top: 22px;
    border-top: 1px solid var(--border);
}

.article-tag {
    padding: 6px 16px; border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 13px; cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.article-tag:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-light);
    border-color: rgba(99, 102, 241, 0.2);
}

/* ===== ARTICLE CARDS ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px; padding: 40px 0;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.article-card::after {
    content: '';
    position: absolute; inset: 0;
    background: var(--gradient-1);
    opacity: 0; transition: opacity 0.4s;
    pointer-events: none;
}

.article-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.article-card:hover::after { opacity: 0.03; }

.article-card-image {
    height: 200px;
    display: flex; align-items: center; justify-content: center;
    font-size: 64px; position: relative;
}

.article-card-image.img-1 { background: linear-gradient(135deg, #1e1b4b, #312e81, #3730a3); }
.article-card-image.img-2 { background: linear-gradient(135deg, #0c4a6e, #164e63, #155e75); }
.article-card-image.img-3 { background: linear-gradient(135deg, #14532d, #1e3a2f, #166534); }
.article-card-image.img-4 { background: linear-gradient(135deg, #4a1d6e, #2d1b4e, #581c87); }
.article-card-image.img-5 { background: linear-gradient(135deg, #6e1d1d, #4e1616, #7f1d1d); }
.article-card-image.img-6 { background: linear-gradient(135deg, #1d4e6e, #16384e, #1e3a5f); }

.article-card-body { padding: 26px; }
.article-card-body h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; line-height: 1.35; }
.article-card-body p {
    font-size: 14px; color: var(--text-secondary);
    line-height: 1.65; margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-footer {
    display: flex; align-items: center;
    justify-content: space-between;
    font-size: 13px; color: var(--text-muted);
}

.article-card-author { display: flex; align-items: center; gap: 10px; }

.article-card-author-avatar {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ===== COMMENTS ===== */
.comments-section {
    margin-top: 54px; padding-top: 34px;
    border-top: 2px solid var(--border);
}

.comments-section h3 {
    font-size: 22px; font-weight: 700;
    margin-bottom: 28px;
}

.comment {
    display: flex; gap: 16px;
    padding: 22px 0;
    border-bottom: 1px solid var(--border);
    animation: commentIn 0.4s ease;
}

.comment:last-of-type { border-bottom: none; }

@keyframes commentIn {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

.comment-avatar {
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white;
    flex-shrink: 0; font-size: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.comment-body { flex: 1; }

.comment-head {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 8px; flex-wrap: wrap;
}

.comment-author-name { font-weight: 600; font-size: 14px; }

.comment-role {
    display: inline-block; padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px; font-weight: 600;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-light);
}

.comment-role.admin {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.comment-date { font-size: 13px; color: var(--text-muted); }
.comment-text { font-size: 14px; color: var(--text-secondary); line-height: 1.75; }

.comment-form { margin-top: 28px; }

.comment-form textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    color: var(--text-primary);
    font-family: inherit; font-size: 14px;
    resize: vertical; min-height: 110px;
    transition: all 0.3s;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.comment-form textarea:disabled { opacity: 0.5; cursor: not-allowed; }
.comment-form .btn { margin-top: 14px; }

/* ===== AUTH ===== */
.auth-page {
    min-height: calc(100vh - 70px);
    display: flex; align-items: center; justify-content: center;
    padding: 50px 24px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 52px;
    width: 100%; max-width: 520px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 4px; background: var(--gradient-1);
}

.auth-card h2 {
    font-size: 30px; font-weight: 900;
    margin-bottom: 10px; text-align: center;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    text-align: center; color: var(--text-secondary);
    margin-bottom: 36px; font-size: 15px;
}

.form-group { margin-bottom: 22px; }

.form-group label {
    display: block; font-size: 14px;
    font-weight: 600; margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%; padding: 13px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit; font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea { min-height: 90px; resize: vertical; }
.form-group select { cursor: pointer; }
.form-group select option { background: var(--bg-secondary); color: var(--text-primary); }

.auth-footer { text-align: center; margin-top: 28px; font-size: 14px; color: var(--text-secondary); }

.auth-footer a {
    color: var(--accent-light); text-decoration: none;
    font-weight: 600; cursor: pointer;
    transition: color 0.2s;
}

.auth-footer a:hover { color: var(--accent); text-decoration: underline; }

.form-divider {
    display: flex; align-items: center; gap: 18px;
    margin: 28px 0; color: var(--text-muted); font-size: 13px;
}

.form-divider::before, .form-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

.social-auth { display: flex; gap: 14px; }

.social-btn {
    flex: 1; padding: 13px; border-radius: var(--radius);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary); font-size: 18px;
    cursor: pointer; transition: all 0.3s;
    display: flex; align-items: center; justify-content: center;
}

.social-btn:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
}

/* ===== PASSWORD STRENGTH ===== */
.pwd-strength { margin-top: 10px; display: none; }

.pwd-bar {
    height: 6px; border-radius: 3px;
    background: var(--bg-secondary);
    overflow: hidden; margin-bottom: 8px;
}

.pwd-bar-fill {
    height: 100%; border-radius: 3px;
    transition: all 0.4s ease;
    width: 0;
}

.pwd-bar-fill.weak { width: 33%; background: var(--danger); }
.pwd-bar-fill.medium { width: 66%; background: var(--warning); }
.pwd-bar-fill.strong { width: 100%; background: var(--success); }

.pwd-text { font-size: 12px; font-weight: 600; }
.pwd-text.weak { color: var(--danger); }
.pwd-text.medium { color: var(--warning); }
.pwd-text.strong { color: var(--success); }

.pwd-rules {
    margin-top: 10px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}

.pwd-rule {
    font-size: 12px;
    display: flex; align-items: center; gap: 6px;
    color: var(--text-muted); transition: color 0.3s;
}

.pwd-rule.pass { color: var(--success); }

/* ===== PROFILE ===== */
.profile-page { padding: 44px 0; }

.profile-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden; margin-bottom: 34px;
    transition: var(--transition);
}

.profile-header-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
}

.profile-banner {
    height: 170px;
    background: var(--gradient-1);
    position: relative;
}

.profile-banner::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(to top, var(--bg-card), transparent);
}

.profile-info {
    padding: 0 36px 36px;
    display: flex; align-items: flex-end; gap: 28px;
    margin-top: -52px; position: relative; z-index: 1;
}

.profile-avatar-lg {
    width: 100px; height: 100px;
    border-radius: var(--radius-xl);
    display: flex; align-items: center; justify-content: center;
    font-size: 38px; font-weight: 900; color: white;
    border: 4px solid var(--bg-card);
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: transform 0.3s;
}

.profile-avatar-lg:hover { transform: scale(1.05) rotate(-2deg); }

.profile-details { flex: 1; padding-top: 60px; }
.profile-name { font-size: 26px; font-weight: 900; letter-spacing: -0.3px; }
.profile-username { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.profile-bio { color: var(--text-secondary); font-size: 14px; margin-top: 10px; line-height: 1.7; }

.profile-stats-row {
    display: flex; gap: 36px;
    padding: 22px 36px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.profile-stat { text-align: center; }
.profile-stat-val { font-size: 22px; font-weight: 800; color: var(--accent-light); }
.profile-stat-lbl { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ===== MEMBERS ===== */
.layout-sidebar {
    display: grid; grid-template-columns: 1fr 340px;
    gap: 30px; padding: 30px 0;
}

.sidebar-card { margin-bottom: 24px; }
.sidebar-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; }

.member-item {
    display: flex; align-items: center; gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.member-item:hover {
    background: var(--bg-card-hover);
    padding-left: 24px;
}

.member-avatar {
    width: 46px; height: 46px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white; flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.member-item:hover .member-avatar { transform: scale(1.1); }

.member-name { font-weight: 600; font-size: 15px; }
.member-username { color: var(--text-muted); font-size: 13px; font-weight: 400; }
.member-info-text { font-size: 13px; color: var(--text-muted); }

.online-badge { font-size: 12px; }
.online-badge.online { color: var(--success); }
.online-badge.offline { color: var(--text-muted); }

.top-member {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    transition: var(--transition);
}

.top-member:hover { padding-left: 8px; }

.top-member-rank { font-size: 18px; width: 28px; text-align: center; }

.top-member-avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white; font-size: 13px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.top-member-info { flex: 1; }
.top-member-name { font-size: 14px; font-weight: 600; }
.top-member-posts { font-size: 12px; color: var(--text-muted); }

.online-user {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    transition: var(--transition);
}

.online-user:hover { padding-left: 8px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px rgba(34,197,94,0.4); }

/* ===== NEW TOPIC FORM ===== */
.new-topic-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    margin: 20px 0;
    animation: fadeIn 0.4s;
}

.new-topic-form h3 { font-size: 20px; font-weight: 700; margin-bottom: 22px; }

/* ===== SEARCH RESULTS ===== */
.search-result-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    margin: 0 -6px;
}

.search-result-item:hover {
    background: rgba(99, 102, 241, 0.06);
    padding-left: 28px;
}

.search-result-title { font-weight: 600; font-size: 15px; }
.search-result-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.search-result-highlight {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-light);
    padding: 1px 4px; border-radius: 3px;
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed; top: 84px; right: 28px;
    z-index: 2000;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 26px;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 14px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 420px;
}

.notification.show { transform: translateX(0); }
.notification.success { border-left: 4px solid var(--success); }
.notification.error { border-left: 4px solid var(--danger); }
.notification.info { border-left: 4px solid var(--accent); }

/* ===== EMPTY STATE ===== */
.empty-state {
    padding: 50px; text-align: center;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }

/* ===== FOOTER ===== */
footer {
    position: relative; z-index: 1;
    border-top: 1px solid var(--border);
    padding: 54px 0 34px; margin-top: 70px;
    background: rgba(10, 14, 26, 0.5);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 44px; margin-bottom: 44px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 14px; line-height: 1.7; margin-top: 14px;
}

.footer-col h4 {
    font-size: 14px; font-weight: 700;
    margin-bottom: 18px; color: var(--text-primary);
    text-transform: uppercase; letter-spacing: 0.5px;
}

.footer-col a {
    display: block; color: var(--text-secondary);
    text-decoration: none; font-size: 14px;
    padding: 5px 0; cursor: pointer;
    transition: all 0.2s;
}

.footer-col a:hover {
    color: var(--accent-light);
    padding-left: 8px;
}

.footer-bottom {
    text-align: center; padding-top: 28px;
    border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: 13px;
}

/* ===== USER PROFILE PAGE ===== */
.user-profile-page { max-width: 920px; margin: 0 auto; padding: 40px 24px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-fade { animation: fadeIn 0.5s ease; }
.animate-slide-up { animation: slideUp 0.5s ease; }
.animate-slide-left { animation: slideInLeft 0.5s ease; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* Staggered children animation */
.stagger > * {
    opacity: 0;
    animation: slideUp 0.4s ease forwards;
}

.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }
.stagger > *:nth-child(9) { animation-delay: 0.45s; }
.stagger > *:nth-child(10) { animation-delay: 0.5s; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 30px 0;
}

.pagination button {
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: inherit; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}

.pagination button:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    transform: translateY(-2px);
}

.pagination button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .layout-sidebar { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}

@media (max-width: 800px) {
    .mobile-toggle { display: block; }
    .main-nav { display: none; }
    .main-nav.open {
        display: flex; flex-direction: column;
        position: absolute; top: 70px; left: 0; right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: 16px;
        animation: slideDown 0.3s ease;
    }
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .hero h1 { font-size: 34px; }
    .hero p { font-size: 16px; }
    .hero-stats { gap: 20px; }
    .hero-stat { padding: 12px 16px; }
    .hero-stat-value { font-size: 28px; }
    .forum-grid { grid-template-columns: 1fr; }
    .articles-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 36px 24px; }
    .topic-stats { display: none; }
    .pwd-rules { grid-template-columns: 1fr; }
    .profile-info { flex-direction: column; align-items: center; text-align: center; }
    .profile-details { padding-top: 16px; }
    .profile-stats-row { justify-content: center; }
    .article-header h1 { font-size: 28px; }
    .profile-avatar-lg { width: 80px; height: 80px; font-size: 30px; }
    .header-inner { height: 60px; }
    .main-content { padding-top: 60px; }
    .notification { right: 12px; left: 12px; max-width: none; }
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    display: flex; align-items: center; justify-content: center;
    padding: 60px;
}

.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOOLTIP ===== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 6px 12px; border-radius: var(--radius-sm);
    font-size: 12px; white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: all 0.2s;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

[data-tooltip]:hover::after {
    opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ===== BADGE ===== */
.badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px;
    border-radius: 10px;
    background: var(--danger);
    color: white; font-size: 11px; font-weight: 700;
    padding: 0 6px;
}

/* ===== DIVIDER ===== */
.divider {
    height: 1px; background: var(--border);
    margin: 30px 0;
}

/* ===== FLEX ===== */
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-gap { display: flex; gap: 12px; flex-wrap: wrap; }