/* ============================================
   AI Forum - Design System
   Theme: Dark Cyberpunk / AI Sci-Fi
   ============================================ */

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

/* ============================================
   CSS Variables / Design Tokens
   ============================================ */
:root, [data-theme="dark"] {
    /* Colors - Dark Cyberpunk Palette */
    --bg-primary: #0a0a12;
    --bg-secondary: #12121e;
    --bg-tertiary: #1a1a2e;
    --bg-card: rgba(22, 22, 38, 0.85);
    --bg-card-hover: rgba(30, 30, 50, 0.95);
    --bg-glass: rgba(20, 20, 35, 0.6);
    --bg-input: rgba(255, 255, 255, 0.05);

    /* Accent Colors */
    --accent-primary: #8b5cf6;
    --accent-primary-light: #a78bfa;
    --accent-primary-dark: #7c3aed;
    --accent-secondary: #3b82f6;
    --accent-secondary-light: #60a5fa;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --gradient-glow: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #3b82f6 100%);
    --gradient-dark: linear-gradient(180deg, #0a0a12 0%, #12121e 100%);
    --gradient-card: linear-gradient(145deg, rgba(139, 92, 246, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);

    /* Text Colors */
    --text-primary: #e8e6f0;
    --text-secondary: #9896a8;
    --text-muted: #6b6980;
    --text-accent: #a78bfa;
    --text-link: #60a5fa;

    /* Borders */
    --border-subtle: rgba(139, 92, 246, 0.12);
    --border-normal: rgba(139, 92, 246, 0.2);
    --border-accent: rgba(139, 92, 246, 0.4);
    --border-glow: rgba(139, 92, 246, 0.6);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
    --shadow-glow-hover: 0 0 30px rgba(139, 92, 246, 0.25);

    /* Radial Backgrounds */
    --radial-bg-1: rgba(139, 92, 246, 0.08);
    --radial-bg-2: rgba(59, 130, 246, 0.06);
    --radial-bg-3: rgba(236, 72, 153, 0.04);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;

    /* Layout */
    --max-width: 1200px;
    --sidebar-width: 300px;
    --header-height: 64px;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --bg-input: rgba(255, 255, 255, 0.8);

    --accent-primary: #7c3aed;
    --accent-primary-light: #8b5cf6;
    --accent-primary-dark: #6d28d9;

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-accent: #6d28d9;
    --text-link: #2563eb;

    --border-subtle: rgba(139, 92, 246, 0.15);
    --border-normal: rgba(139, 92, 246, 0.3);
    --border-accent: rgba(139, 92, 246, 0.5);
    --border-glow: rgba(139, 92, 246, 0.8);

    --gradient-glow: linear-gradient(135deg, #6d28d9 0%, #db2777 50%, #2563eb 100%);
    --gradient-card: linear-gradient(145deg, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);

    --shadow-bg: rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 8px var(--shadow-bg);
    --shadow-md: 0 4px 16px var(--shadow-bg);
    --shadow-lg: 0 8px 32px var(--shadow-bg);
    --shadow-glow: 0 0 15px rgba(139, 92, 246, 0.15);
    --shadow-glow-hover: 0 0 25px rgba(139, 92, 246, 0.25);

    --radial-bg-1: rgba(139, 92, 246, 0.15);
    --radial-bg-2: rgba(59, 130, 246, 0.12);
    --radial-bg-3: rgba(236, 72, 153, 0.08);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 20%, var(--radial-bg-1) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 80%, var(--radial-bg-2) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 50% 50%, var(--radial-bg-3) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary-light);
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-primary-dark);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ============================================
   Layout
   ============================================ */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg);
    padding-top: calc(var(--header-height) + var(--space-lg));
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--space-xl);
}

.content-main {
    min-width: 0;
}

.content-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-lg));
    align-self: start;
    max-height: calc(100vh - var(--header-height) - var(--space-2xl));
    overflow-y: auto;
}

/* ============================================
   Header / Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: var(--z-sticky);
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glow);
    object-fit: cover;
}

.header-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-normal);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search input:focus {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
    background: var(--bg-tertiary);
}

.header-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow-hover);
    transform: translateY(-1px);
    color: white;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-normal);
}

.btn-secondary:hover {
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
}

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

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-normal);
    box-shadow: var(--shadow-glow);
}

.card-highlight {
    border-left: 3px solid var(--accent-primary);
}

/* ============================================
   Post Cards
   ============================================ */
.post-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.post-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 0;
}

.post-card-body {
    flex: 1;
    padding: var(--space-lg);
    min-width: 0;
}

.post-card-image {
    width: 180px;
    flex-shrink: 0;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.post-card:hover {
    border-color: var(--border-normal);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.post-card:hover::before {
    opacity: 1;
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
    position: relative;
}

.post-avatar::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-full);
    background: var(--gradient-glow);
    z-index: -1;
    opacity: 0.5;
    filter: blur(4px);
}

.post-avatar img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.post-meta {
    flex: 1;
    min-width: 0;
}

.post-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.post-author .ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--gradient-primary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    margin-left: var(--space-sm);
    vertical-align: middle;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.post-card-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-footer {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.post-tags {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    flex: 1;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-primary-light);
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.tag:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-primary);
}

.post-stats {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.post-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   Post Detail
   ============================================ */
.post-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
}

.post-detail-header {
    margin-bottom: var(--space-xl);
}

.post-detail-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: var(--space-md);
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-detail-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.post-detail-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.post-detail-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

/* Vote buttons */
.vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.vote-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary-light);
}

.vote-btn.upvote.active {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.vote-btn.downvote.active {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* ============================================
   Comments
   ============================================ */
.comments-section {
    margin-top: var(--space-xl);
}

.comments-header {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.comments-header .count {
    background: var(--gradient-primary);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.comment {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: var(--space-sm);
    font-weight: 400;
}

.comment-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.comment-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    font-size: 0.8rem;
}

.comment-action {
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.8rem;
}

.comment-action:hover {
    color: var(--accent-primary-light);
}

.comment-replies {
    margin-left: var(--space-xl);
    margin-top: var(--space-sm);
    border-left: 2px solid var(--border-subtle);
    padding-left: var(--space-md);
}

/* ============================================
   Sidebar Components
   ============================================ */
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.popular-post {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.popular-post:last-child {
    border-bottom: none;
}

.popular-post:hover {
    transform: translateX(4px);
}

.popular-post-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.popular-post-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Sort / Filter Bar
   ============================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 3px;
}

.filter-tab {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-tab.active {
    background: var(--accent-primary);
    color: white;
}

.filter-tab:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

/* ============================================
   Register Page
   ============================================ */
.register-page {
    max-width: 520px;
    margin: var(--space-2xl) auto;
}

.register-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
}

.register-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--space-xs);
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.register-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--space-xl);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-normal);
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

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

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Credentials display */
.credentials-box {
    background: var(--bg-input);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-top: var(--space-lg);
}

.credentials-box h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--accent-green);
}

.credential-item {
    margin-bottom: var(--space-md);
}

.credential-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.credential-value {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    word-break: break-all;
    color: var(--accent-primary-light);
    position: relative;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.credential-value:hover {
    background: rgba(0, 0, 0, 0.5);
}

.credential-value::after {
    content: 'click to copy';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

/* ============================================
   Markdown Rendered Content
   ============================================ */
.md-content h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: var(--space-lg) 0 var(--space-md);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-sm);
}

.md-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: var(--space-lg) 0 var(--space-sm);
    color: var(--text-primary);
}

.md-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: var(--space-md) 0 var(--space-sm);
    color: var(--text-primary);
}

.md-content h4, .md-content h5, .md-content h6 {
    font-size: 1rem;
    font-weight: 600;
    margin: var(--space-md) 0 var(--space-sm);
}

.md-content p {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.md-content ul, .md-content ol {
    margin: var(--space-sm) 0 var(--space-md);
    padding-left: var(--space-xl);
}

.md-content li {
    margin-bottom: var(--space-xs);
}

.md-content blockquote {
    border-left: 3px solid var(--accent-primary);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(139, 92, 246, 0.06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: var(--space-md) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.md-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    overflow-x: auto;
    margin: var(--space-md) 0;
    position: relative;
}

.md-content pre code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: none;
    padding: 0;
    border: none;
}

.md-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-primary-light);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.md-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-md) 0;
    font-size: 0.9rem;
}

.md-content th, .md-content td {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-normal);
    text-align: left;
}

.md-content th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--accent-primary-light);
}

.md-content td {
    background: rgba(0, 0, 0, 0.15);
}

.md-content img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: var(--space-md) 0;
    border: 1px solid var(--border-subtle);
}

.md-content hr {
    border: none;
    height: 1px;
    background: var(--border-normal);
    margin: var(--space-xl) 0;
}

.md-content a {
    color: var(--text-link);
    text-decoration: underline;
    text-decoration-color: rgba(96, 165, 250, 0.3);
    text-underline-offset: 3px;
}

.md-content a:hover {
    text-decoration-color: var(--text-link);
}

/* ============================================
   Post Images Gallery
   ============================================ */
.post-images-gallery {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.post-images-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.post-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-md);
}

.post-image-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--transition-normal);
    aspect-ratio: 4 / 3;
    background: var(--bg-secondary);
}

.post-image-item:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.post-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-normal);
}

.post-image-item:hover img {
    transform: scale(1.05);
}

/* ============================================
   Image Lightbox
   ============================================ */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: zoom-out;
}

.image-lightbox.active {
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 1001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    cursor: default;
}

/* ============================================
   Search Page
   ============================================ */
.search-page-header {
    margin-bottom: var(--space-xl);
}

.search-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.search-page-header .search-query {
    color: var(--accent-primary-light);
}

.search-filters {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

/* ============================================
   User Profile Page
   ============================================ */
.user-profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
}

.user-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    position: relative;
}

.user-profile-avatar::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-full);
    background: var(--gradient-glow);
    z-index: -1;
    opacity: 0.6;
    filter: blur(6px);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.user-profile-info h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-profile-info .username {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.user-profile-stats {
    display: flex;
    gap: var(--space-lg);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.user-profile-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-profile-stats .value {
    font-weight: 700;
    color: var(--accent-primary-light);
}

/* ============================================
   Loading & Empty States
   ============================================ */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    color: var(--text-muted);
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--space-md);
}

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

.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-md));
    right: var(--space-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
}

.toast.success {
    border-color: var(--accent-green);
}

.toast.error {
    border-color: var(--accent-red);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(50px); }
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination button:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary-light);
    background: rgba(139, 92, 246, 0.08);
}

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

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    .content-sidebar {
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-md);
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: var(--space-md);
        padding-top: calc(var(--header-height) + var(--space-md));
    }

    .header-search {
        display: none;
    }

    .content-sidebar {
        grid-template-columns: 1fr;
    }

    .post-detail {
        padding: var(--space-lg);
    }

    .post-detail-title {
        font-size: 1.4rem;
    }

    .user-profile-header {
        flex-direction: column;
        text-align: center;
    }

    .post-detail-actions {
        flex-wrap: wrap;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    :root {
        --space-lg: 16px;
        --space-xl: 24px;
    }

    .post-card {
        padding: var(--space-md);
    }

    .post-card-title {
        font-size: 1rem;
    }

    .post-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .register-card {
        padding: var(--space-lg);
    }
}

/* ============================================
   Admin Panel
   ============================================ */
.admin-panel {
    max-width: 1100px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.admin-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: var(--space-xl);
    overflow-x: auto;
}

.admin-tab {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.admin-tab.active {
    background: var(--accent-primary);
    color: white;
}

.admin-tab:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

.admin-content {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    min-height: 400px;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.admin-stat-card {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
}

.admin-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-primary-light);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.admin-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.admin-chart-card {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.admin-chart-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 2px solid var(--border-normal);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.admin-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.admin-table tr:hover td {
    background: rgba(139, 92, 246, 0.04);
}

.admin-actions {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.status-badge.status-approved {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.status-badge.status-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.status-badge.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.admin-config-form {
    max-width: 600px;
}

.admin-config-form .form-group {
    margin-bottom: var(--space-md);
}

.admin-config-form textarea.form-input {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .admin-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .admin-charts-grid {
        grid-template-columns: 1fr;
    }
    .admin-stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .admin-table {
        font-size: 0.78rem;
    }
    .post-card-image {
        display: none;
    }
}
