/* Modern Forum Design - Complete Redesign */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* Revolutionary Color Palette - Dark Crimson Theme */
    --primary-50: #fef2f2;
    --primary-100: #fee2e2;
    --primary-200: #fecaca;
    --primary-300: #fca5a5;
    --primary-400: #f87171;
    --primary-500: #ef4444;
    --primary-600: #dc2626;
    --primary-700: #b91c1c;
    --primary-800: #991b1b;
    --primary-900: #7f1d1d;
    --primary-950: #450a0a;
    
    /* Main Brand Colors */
    --brand-primary: #dc2626;
    --brand-secondary: #7c2d12;
    --brand-accent: #f59e0b;
    --brand-success: #10b981;
    --brand-warning: #f59e0b;
    --brand-error: #ef4444;
    --brand-info: #3b82f6;
    
    /* Sophisticated Background System */
    --bg-app: #0a0a0a;
    --bg-surface: #111111;
    --bg-elevated: #1a1a1a;
    --bg-card: #1f1f1f;
    --bg-overlay: #262626;
    --bg-hover: #2a2a2a;
    --bg-active: #333333;
    --bg-selected: rgba(220, 38, 38, 0.1);
    --bg-glass: rgba(31, 31, 31, 0.8);
    --bg-blur: rgba(31, 31, 31, 0.95);
    
    /* Advanced Text Hierarchy */
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-tertiary: #a3a3a3;
    --text-quaternary: #737373;
    --text-disabled: #525252;
    --text-inverse: #0a0a0a;
    --text-brand: #dc2626;
    --text-success: #22c55e;
    --text-warning: #f59e0b;
    --text-error: #ef4444;
    --text-info: #3b82f6;
    
    /* Refined Border System */
    --border-subtle: #262626;
    --border-default: #404040;
    --border-strong: #525252;
    --border-brand: #dc2626;
    --border-success: #22c55e;
    --border-warning: #f59e0b;
    --border-error: #ef4444;
    
    /* Professional Shadow System */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(220, 38, 38, 0.4);
    --shadow-glow-lg: 0 0 40px rgba(220, 38, 38, 0.3);
    
    /* Typography Scale */
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-display: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    --font-size-5xl: 3rem;        /* 48px */
    --font-size-6xl: 3.75rem;     /* 60px */
    
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    --font-weight-black: 900;
    
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
    
    /* Spacing System */
    --space-px: 1px;
    --space-0: 0;
    --space-1: 0.25rem;    /* 4px */
    --space-2: 0.5rem;     /* 8px */
    --space-3: 0.75rem;    /* 12px */
    --space-4: 1rem;       /* 16px */
    --space-5: 1.25rem;    /* 20px */
    --space-6: 1.5rem;     /* 24px */
    --space-8: 2rem;       /* 32px */
    --space-10: 2.5rem;    /* 40px */
    --space-12: 3rem;      /* 48px */
    --space-16: 4rem;      /* 64px */
    --space-20: 5rem;      /* 80px */
    --space-24: 6rem;      /* 96px */
    --space-32: 8rem;      /* 128px */
    
    /* Border Radius */
    --radius-none: 0;
    --radius-sm: 0.125rem;   /* 2px */
    --radius-base: 0.25rem;  /* 4px */
    --radius-md: 0.375rem;   /* 6px */
    --radius-lg: 0.5rem;     /* 8px */
    --radius-xl: 0.75rem;    /* 12px */
    --radius-2xl: 1rem;      /* 16px */
    --radius-3xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;
    
    /* Animation & Transitions */
    --duration-75: 75ms;
    --duration-100: 100ms;
    --duration-150: 150ms;
    --duration-200: 200ms;
    --duration-300: 300ms;
    --duration-500: 500ms;
    --duration-700: 700ms;
    --duration-1000: 1000ms;
    
    --ease-linear: linear;
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Z-Index Scale */
    --z-0: 0;
    --z-10: 10;
    --z-20: 20;
    --z-30: 30;
    --z-40: 40;
    --z-50: 50;
    --z-auto: auto;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    
    /* Breakpoints */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
}

/* Modern Base Styles */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--bg-app);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Advanced Background System */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(220, 38, 38, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(220, 38, 38, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(220, 38, 38, 0.01) 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-app) 0%, var(--bg-surface) 100%);
    pointer-events: none;
    z-index: -2;
}

/* Subtle Texture Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.01) 1px, transparent 0);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

/* Container System */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    position: relative;
}

.container-sm {
    max-width: 640px;
}

.container-md {
    max-width: 768px;
}

.container-lg {
    max-width: 1024px;
}

.container-xl {
    max-width: 1280px;
}

.container-2xl {
    max-width: 1536px;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.break-words {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Selection Styles */
::selection {
    background: rgba(220, 38, 38, 0.2);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(220, 38, 38, 0.2);
    color: var(--text-primary);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
    border-radius: var(--radius-base);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-overlay);
    border-radius: var(--radius-base);
    border: 1px solid var(--border-subtle);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

::-webkit-scrollbar-corner {
    background: var(--bg-surface);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-overlay) var(--bg-surface);
}

/* Revolutionary Header Design */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--bg-blur);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--duration-300) var(--ease-out);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--brand-primary) 20%,
        var(--brand-accent) 50%,
        var(--brand-primary) 80%,
        transparent 100%
    );
    opacity: 0.6;
    animation: headerGlow 4s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) 0;
    gap: var(--space-8);
}

/* Modern Logo Design */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-family-display);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    transition: all var(--duration-300) var(--ease-out);
}

.logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    color: white;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: logoShine 3s ease-in-out infinite;
}

@keyframes logoShine {
    0%, 100% { transform: rotate(45deg) translateX(-200%); }
    50% { transform: rotate(45deg) translateX(200%); }
}

.logo-text {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* Advanced Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--bg-elevated);
    padding: var(--space-2);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-xl);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-tertiary);
    text-decoration: none;
    transition: all var(--duration-200) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left var(--duration-300) var(--ease-out);
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-selected);
    border: 1px solid rgba(220, 38, 38, 0.2);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    box-shadow: var(--shadow-glow);
}

.nav-link i {
    font-size: var(--font-size-base);
    transition: transform var(--duration-200) var(--ease-out);
}

.nav-link:hover i {
    transform: scale(1.1);
}

/* Message Badge */
.message-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, var(--brand-error) 0%, #dc2626 100%);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* User Menu Enhancement */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.auth-buttons {
    display: flex;
    gap: var(--space-3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--bg-elevated);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-200) var(--ease-out);
    cursor: pointer;
}

.user-info:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    position: relative;
}

.user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 2px solid var(--brand-primary);
    object-fit: cover;
    transition: all var(--duration-200) var(--ease-out);
}

.user-avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: var(--brand-success);
    border: 2px solid var(--bg-elevated);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.username {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
    display: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-200) var(--ease-out);
}

.mobile-nav-toggle:hover {
    background: var(--bg-hover);
    transform: scale(1.05);
}

/* Responsive Header */
@media (max-width: 768px) {
    .header-content {
        padding: var(--space-3) 0;
        gap: var(--space-4);
    }
    
    .logo {
        font-size: var(--font-size-xl);
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: var(--font-size-lg);
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-blur);
        backdrop-filter: blur(20px);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-xl);
        margin: var(--space-2);
        padding: var(--space-4);
        flex-direction: column;
        gap: var(--space-2);
        box-shadow: var(--shadow-xl);
    }
    
    .nav.mobile-open {
        display: flex;
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: var(--space-4);
    }
    
    .mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .user-info {
        padding: var(--space-2);
    }
    
    .username {
        display: none;
    }
}

/* Revolutionary Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-family-sans);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--duration-200) var(--ease-out);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    outline: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left var(--duration-300) var(--ease-out);
}

.btn:hover::before {
    left: 100%;
}

.btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled::before {
    display: none;
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--brand-primary) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-default);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--brand-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--brand-error) 0%, #dc2626 100%);
    color: white;
    border-color: var(--brand-error);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #f87171 0%, var(--brand-error) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--brand-success) 0%, #059669 100%);
    color: white;
    border-color: var(--brand-success);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399 0%, var(--brand-success) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(16, 185, 129, 0.4);
}

/* Button Sizes */
.btn-xs {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-lg);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
    border-radius: var(--radius-2xl);
}

.btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--font-size-xl);
    border-radius: var(--radius-2xl);
}

/* Button States */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Icon Buttons */
.btn-icon {
    padding: var(--space-3);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xl);
}

.btn-icon.btn-sm {
    padding: var(--space-2);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-lg);
}

.btn-icon.btn-lg {
    padding: var(--space-4);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-2xl);
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.btn-group .btn {
    border-radius: 0;
    border-right-width: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--radius-xl);
    border-bottom-left-radius: var(--radius-xl);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    border-right-width: 1px;
}

.btn-group .btn:hover {
    z-index: 1;
    border-right-width: 1px;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    transition: all var(--duration-300) var(--ease-out);
    z-index: var(--z-50);
}

.fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: var(--shadow-2xl), var(--shadow-glow);
}

.fab:active {
    transform: scale(1.05);
}

/* Modern Card System */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--duration-300) var(--ease-out);
}

.card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

/* Glass Card Variant */
.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Elevated Card Variant */
.card-elevated {
    box-shadow: var(--shadow-lg);
    border: none;
}

.card-elevated:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

/* Interactive Card Variant */
.card-interactive {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card-interactive::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left var(--duration-500) var(--ease-out);
}

.card-interactive:hover::before {
    left: 100%;
}

/* Badge System */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: var(--brand-primary);
    color: white;
}

.badge-secondary {
    background: var(--bg-overlay);
    color: var(--text-secondary);
}

.badge-success {
    background: var(--brand-success);
    color: white;
}

.badge-warning {
    background: var(--brand-warning);
    color: var(--text-inverse);
}

.badge-error {
    background: var(--brand-error);
    color: white;
}

.badge-outline {
    background: transparent;
    border: 1px solid currentColor;
}

/* Avatar System */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    background: var(--bg-overlay);
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-xs {
    width: 24px;
    height: 24px;
    font-size: var(--font-size-xs);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-sm);
}

.avatar-md {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-base);
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: var(--font-size-lg);
}

.avatar-xl {
    width: 64px;
    height: 64px;
    font-size: var(--font-size-xl);
}

.avatar-2xl {
    width: 80px;
    height: 80px;
    font-size: var(--font-size-2xl);
}

/* Avatar Status Indicator */
.avatar-status {
    position: relative;
}

.avatar-status::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 25%;
    height: 25%;
    border: 2px solid var(--bg-card);
    border-radius: var(--radius-full);
    background: var(--brand-success);
}

.avatar-status.offline::after {
    background: var(--text-quaternary);
}

.avatar-status.away::after {
    background: var(--brand-warning);
}

.avatar-status.busy::after {
    background: var(--brand-error);
}

/* Revolutionary Main Content Design */
.main {
    padding: var(--space-8) 0;
    min-height: calc(100vh - 80px);
    position: relative;
}

.page {
    animation: pageEnter 0.6s var(--ease-out);
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section - Revolutionary Design */
.hero-section {
    text-align: center;
    padding: var(--space-16) 0 var(--space-12);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(220, 38, 38, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(220, 38, 38, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-family-display);
    font-size: clamp(var(--font-size-3xl), 6vw, var(--font-size-6xl));
    font-weight: var(--font-weight-black);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-6);
    background: linear-gradient(
        135deg,
        var(--text-primary) 0%,
        var(--brand-primary) 30%,
        var(--brand-accent) 60%,
        var(--brand-primary) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
    border-radius: var(--radius-full);
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: var(--line-height-relaxed);
}

.hero-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-12);
}

/* Advanced Stats Grid */
.stats-section {
    margin-bottom: var(--space-16);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-3xl);
    padding: var(--space-8);
    position: relative;
    overflow: hidden;
    transition: all var(--duration-300) var(--ease-out);
    cursor: pointer;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-300) var(--ease-out);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--border-default);
}

.stat-card-content {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.stat-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    color: white;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.stat-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: iconShine 4s ease-in-out infinite;
}

@keyframes iconShine {
    0%, 100% { transform: rotate(45deg) translateX(-200%); }
    50% { transform: rotate(45deg) translateX(200%); }
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-number {
    font-family: var(--font-family-display);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-black);
    line-height: 1;
    margin-bottom: var(--space-2);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.stat-trend.positive {
    color: var(--brand-success);
}

.stat-trend.negative {
    color: var(--brand-error);
}

/* Modern Activity Section */
.activity-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-16);
}

.recent-activity {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-3xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-family-display);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    border-radius: var(--radius-full);
}

.section-action {
    font-size: var(--font-size-sm);
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: color var(--duration-200) var(--ease-out);
}

.section-action:hover {
    color: var(--primary-400);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    transition: all var(--duration-200) var(--ease-out);
    cursor: pointer;
}

.activity-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
    transform: translateX(4px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-lg);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    line-height: var(--line-height-snug);
}

.activity-text strong {
    color: var(--brand-primary);
    font-weight: var(--font-weight-semibold);
}

.activity-text a {
    color: var(--brand-info);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
}

.activity-text a:hover {
    text-decoration: underline;
}

.activity-time {
    color: var(--text-quaternary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

/* Online Users Widget */
.online-users-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-3xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
    height: fit-content;
}

.online-users-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-height: 400px;
    overflow-y: auto;
}

.online-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    transition: all var(--duration-200) var(--ease-out);
    cursor: pointer;
}

.online-user:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
    transform: scale(1.02);
}

.online-user .avatar {
    position: relative;
}

.online-user .avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--brand-success);
    border: 2px solid var(--bg-card);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.online-user-info {
    flex: 1;
    min-width: 0;
}

.online-user-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-px);
}

.online-user-status {
    font-size: var(--font-size-xs);
    color: var(--text-quaternary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: var(--font-size-5xl);
    margin-bottom: var(--space-4);
    color: var(--text-quaternary);
}

.empty-state h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: var(--space-6);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .activity-section {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: var(--space-4);
    }
    
    .stat-card {
        padding: var(--space-6);
    }
    
    .stat-card-content {
        gap: var(--space-4);
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: var(--font-size-xl);
    }
}

@media (max-width: 768px) {
    .main {
        padding: var(--space-6) 0;
    }
    
    .hero-section {
        padding: var(--space-12) 0 var(--space-8);
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .stat-card-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-4);
    }
    
    .activity-item {
        padding: var(--space-3);
    }
    
    .activity-content {
        font-size: var(--font-size-sm);
    }
}

/* Forums Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    font-size: var(--font-size-2xl);
    color: var(--text-primary);
}

.forum-category {
    margin-bottom: 2rem;
}

.category-header {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.forum-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
}

.forum-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.forum-item:last-child {
    border-bottom: none;
}

.forum-item:hover {
    background: var(--bg-hover);
}

.forum-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
    color: white;
}

.forum-info {
    flex: 1;
}

.forum-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.forum-description {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.forum-stats {
    text-align: right;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.forum-stats div {
    margin-bottom: 0.25rem;
}

/* Enhanced Post Styles */
.post {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-xl);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.post:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(217, 48, 37, 0.2);
}

.post-header {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-quaternary) 100%);
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.post-author img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary-color);
    object-fit: cover;
    transition: all var(--transition-normal);
}

.post-author img:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.author-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
}

.author-role {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.author-role.admin {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.author-role.moderator {
    background: linear-gradient(135deg, var(--accent-color) 0%, #f59e0b 100%);
    color: var(--bg-primary);
}

.post-date {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.post-date i {
    color: var(--primary-color);
}

.post-content {
    padding: var(--spacing-xl);
    line-height: 1.8;
    font-size: var(--font-size-base);
}

.post-content h1, .post-content h2, .post-content h3 {
    color: var(--text-primary);
    margin: var(--spacing-lg) 0 var(--spacing-md) 0;
}

.post-content p {
    margin-bottom: var(--spacing-md);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: var(--spacing-md) 0;
    box-shadow: var(--shadow-md);
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    background: var(--bg-tertiary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: var(--spacing-md) var(--spacing-lg);
    font-style: italic;
}

.post-content code {
    background: var(--bg-tertiary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    color: var(--text-info);
}

.post-content pre {
    background: var(--bg-tertiary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: var(--spacing-md) 0;
    border: 1px solid var(--border-color);
}

.post-content pre code {
    background: none;
    padding: 0;
}

/* Enhanced Post Actions */
.post-actions {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
}

.post-actions-left {
    display: flex;
    gap: var(--spacing-md);
}

.post-actions-right {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.post-action {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.post-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left var(--transition-normal);
}

.post-action:hover::before {
    left: 100%;
}

.post-action:hover {
    color: var(--primary-color);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.post-action.liked {
    color: var(--primary-color);
    background: rgba(217, 48, 37, 0.1);
    border-color: var(--primary-color);
}

.post-action.liked i {
    animation: heartbeat 0.6s ease-in-out;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.reaction-count {
    background: var(--bg-quaternary);
    color: var(--text-tertiary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.reaction-count.has-reactions {
    background: var(--primary-color);
    color: white;
}

/* Reactions Dropdown */
.reactions-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-xl);
    display: none;
    z-index: var(--z-dropdown);
    backdrop-filter: blur(20px);
}

.reactions-dropdown.show {
    display: flex;
    gap: var(--spacing-sm);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reaction-emoji {
    font-size: var(--font-size-xl);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.reaction-emoji:hover {
    transform: scale(1.3);
    background: var(--bg-hover);
}

.reaction-emoji::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.reaction-emoji:hover::after {
    opacity: 1;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Enhanced Modal Styles */
.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
    backdrop-filter: blur(20px);
}

.modal-content.large-modal {
    max-width: 900px;
}

.modal-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h2 {
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.modal-header h2 i {
    color: var(--primary-color);
}

.modal-close {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.modal-close:hover {
    color: var(--primary-color);
    background: var(--bg-active);
    transform: scale(1.1);
}

.modal form {
    padding: var(--spacing-xl);
}

/* Rich Text Editor Styles */
.rich-editor-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.rich-editor-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.1);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-quaternary);
    border-bottom: 1px solid var(--border-color);
}

.toolbar-group {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    padding: 0 var(--spacing-sm);
    border-right: 1px solid var(--border-color);
}

.toolbar-group:last-child {
    border-right: none;
}

.toolbar-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover,
.toolbar-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.toolbar-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toolbar-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.color-picker {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    padding: 2px;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-xs);
}

.rich-editor {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding: var(--spacing-lg);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    line-height: 1.6;
    outline: none;
    background: var(--bg-card);
}

.rich-editor:empty::before {
    content: attr(placeholder);
    color: var(--text-muted);
    font-style: italic;
}

.rich-editor img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--spacing-sm) 0;
}

.rich-editor a {
    color: var(--primary-color);
    text-decoration: underline;
}

.rich-editor blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    background: var(--bg-tertiary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: var(--spacing-md) var(--spacing-lg);
}

/* Enhanced Form Styles */
.form-group {
    margin-bottom: var(--spacing-xl);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label i {
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: all var(--transition-normal);
    font-family: var(--font-family);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.1);
    background: var(--bg-card);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Reply Form Styles */
.reply-form {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.reply-header h3 {
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.reply-header h3 i {
    color: var(--primary-color);
}

.reply-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
}

/* Online Users Widget */
.online-users-widget {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    margin-top: var(--spacing-xl);
}

.online-users-widget h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.online-users-widget h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent-secondary);
    border-radius: var(--radius-sm);
}

.online-users-widget h3 i {
    color: var(--accent-secondary);
}

.online-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.online-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-tertiary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.online-user:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.online-user img {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    border: 1px solid var(--accent-secondary);
}

.online-user span {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.online-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent-secondary);
    border-radius: var(--radius-full);
    box-shadow: 0 0 6px var(--accent-secondary);
}

/* Loading Spinner */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 4000;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    min-width: 300px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--text-success);
}

.toast.error {
    border-left: 4px solid var(--text-danger);
}

.toast.warning {
    border-left: 4px solid var(--text-warning);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover,
.pagination button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 150px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.3s ease;
}

.dropdown-menu a:hover {
    background: var(--bg-hover);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Message Badge */
.message-badge {
    background: var(--primary-color);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    margin-left: var(--spacing-sm);
    min-width: 20px;
    text-align: center;
    animation: pulse 2s infinite;
}

/* Messages Layout */
.messages-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: var(--spacing-xl);
    height: calc(100vh - 200px);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.conversations-sidebar {
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.conversations-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-quaternary);
}

.conversations-header h3 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.conversations-filter {
    display: flex;
    gap: var(--spacing-sm);
}

.filter-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.conversation-item:hover {
    background: var(--bg-hover);
}

.conversation-item.active {
    background: var(--primary-color);
    color: white;
}

.conversation-item.unread {
    background: rgba(217, 48, 37, 0.1);
    border-left: 4px solid var(--primary-color);
}

.conversation-avatar {
    position: relative;
    flex-shrink: 0;
}

.conversation-avatar img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-color);
    object-fit: cover;
}

.conversation-avatar.online::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: var(--accent-secondary);
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-full);
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.conversation-item.active .conversation-name {
    color: white;
}

.conversation-preview {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item.active .conversation-preview {
    color: rgba(255, 255, 255, 0.8);
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-xs);
}

.conversation-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.conversation-item.active .conversation-time {
    color: rgba(255, 255, 255, 0.7);
}

.unread-count {
    background: var(--primary-color);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.conversation-item.active .unread-count {
    background: white;
    color: var(--primary-color);
}

/* Messages Main */
.messages-main {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
}

.messages-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.placeholder-content {
    color: var(--text-muted);
}

.placeholder-content i {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-disabled);
}

.placeholder-content h3 {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

/* Chat Interface */
.messages-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
}

.chat-user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary-color);
}

.chat-user-details h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.chat-user-status {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.chat-user-status.online {
    color: var(--accent-secondary);
}

.chat-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.message-item {
    display: flex;
    gap: var(--spacing-md);
    max-width: 80%;
}

.message-item.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.message-content {
    background: var(--bg-tertiary);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-xl);
    position: relative;
    max-width: 100%;
}

.message-item.own .message-content {
    background: var(--primary-color);
    color: white;
}

.message-content::before {
    content: '';
    position: absolute;
    top: 10px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
}

.message-content::before {
    left: -16px;
    border-right-color: var(--bg-tertiary);
}

.message-item.own .message-content::before {
    left: auto;
    right: -16px;
    border-left-color: var(--primary-color);
    border-right-color: transparent;
}

.message-text {
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
    text-align: right;
}

.message-item.own .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Chat Input */
.chat-input {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-end;
}

.chat-input .rich-editor-container {
    flex: 1;
}

.chat-input .rich-editor.compact {
    min-height: 60px;
    max-height: 120px;
}

.editor-toolbar.compact {
    padding: var(--spacing-sm);
}

.chat-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Recipient Input */
.recipient-input {
    position: relative;
}

.recipient-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.recipient-suggestions.show {
    display: block;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.suggestion-item:hover {
    background: var(--bg-hover);
}

.suggestion-avatar img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.suggestion-info {
    flex: 1;
}

.suggestion-name {
    font-weight: 600;
    color: var(--text-primary);
}

.suggestion-role {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Avatar Change Modal */
.avatar-change-content {
    padding: var(--spacing-xl);
}

.current-avatar {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
}

.current-avatar h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    font-weight: 600;
}

.avatar-preview {
    display: inline-block;
    position: relative;
}

.avatar-preview img {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    border: 4px solid var(--primary-color);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

.avatar-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xl);
}

.avatar-upload-section,
.avatar-presets-section,
.avatar-generator-section {
    background: var(--bg-tertiary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.avatar-upload-section h3,
.avatar-presets-section h3,
.avatar-generator-section h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.avatar-upload-section h3 i {
    color: var(--text-info);
}

.avatar-presets-section h3 i {
    color: var(--accent-color);
}

.avatar-generator-section h3 i {
    color: var(--accent-secondary);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-card);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(217, 48, 37, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(217, 48, 37, 0.1);
    transform: scale(1.02);
}

.upload-placeholder i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.upload-placeholder p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.upload-placeholder small {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.new-avatar-preview {
    text-align: center;
    padding: var(--spacing-xl);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.new-avatar-preview img {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    border: 4px solid var(--primary-color);
    object-fit: cover;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

.avatar-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

/* Avatar Presets */
.avatar-presets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--spacing-md);
    max-height: 300px;
    overflow-y: auto;
}

.preset-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-normal);
    object-fit: cover;
}

.preset-avatar:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.preset-avatar.selected {
    border-color: var(--primary-color);
    border-width: 4px;
    box-shadow: var(--shadow-glow);
}

/* Avatar Generator */
.generator-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.generator-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.generator-row label {
    min-width: 120px;
    color: var(--text-secondary);
    font-weight: 500;
}

.generator-row select {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

.generator-row select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.generator-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.generated-avatar-preview {
    text-align: center;
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.generated-avatar-preview canvas {
    border-radius: var(--radius-full);
    border: 4px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
}

/* Dropdown Menu Enhancement */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.dropdown-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    min-width: 180px;
    box-shadow: var(--shadow-xl);
    z-index: var(--z-dropdown);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.dropdown.show .dropdown-menu {
    display: block;
    animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-fast);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.dropdown-menu a:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

.dropdown-menu a i {
    width: 16px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-sm) 0;
}

/* Responsive Avatar Modal */
@media (max-width: 768px) {
    .avatar-options {
        gap: var(--spacing-xl);
    }
    
    .avatar-presets {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .preset-avatar {
        width: 60px;
        height: 60px;
    }
    
    .generator-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    .generator-row label {
        min-width: auto;
    }
    
    .generator-row select {
        width: 100%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .forum-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .forum-stats {
        text-align: left;
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ===== REGISTER MODAL ===== */
.register-modal-content {
    background: linear-gradient(145deg, #0d0d1a, #1a0a0a);
    border: 1px solid #3d0000;
    border-radius: 16px;
    padding: 0;
    max-width: 420px;
    width: 90%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.8), 0 0 40px rgba(180,0,0,0.15);
}

.register-modal-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8b0000, #ff4444, #8b0000);
}

.register-close-btn {
    position: absolute;
    top: 14px; right: 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #aaa;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    z-index: 10;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.register-close-btn:hover { background: rgba(220,38,38,0.3); color: #fff; border-color: #dc2626; }

#registerStep1, #registerStep2 { padding: 35px 30px 30px; }

.register-header { text-align: center; margin-bottom: 24px; }

.register-logo {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, #8b0000, #cc0000);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    font-size: 24px;
    box-shadow: 0 0 20px rgba(200,0,0,0.4);
}
.register-logo.verify { background: linear-gradient(135deg, #1a3a6b, #2563eb); box-shadow: 0 0 20px rgba(37,99,235,0.4); }

.register-header h2 { font-size: 22px; color: #fff; margin-bottom: 6px; }
.register-header p { color: #888; font-size: 13px; }

.register-steps {
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin-bottom: 24px;
}
.step-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #333;
    border: 2px solid #555;
    transition: all 0.3s;
}
.step-dot.active { background: #dc2626; border-color: #dc2626; box-shadow: 0 0 8px rgba(220,38,38,0.6); }
.step-dot.done { background: #16a34a; border-color: #16a34a; }
.step-line {
    width: 60px; height: 2px;
    background: #333;
    transition: all 0.3s;
}
.step-line.active { background: linear-gradient(90deg, #16a34a, #dc2626); }

.reg-form-group {
    position: relative;
    margin-bottom: 14px;
}
.reg-form-group input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px 40px 12px 42px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
}
.reg-form-group input:focus {
    border-color: #dc2626;
    background: rgba(220,38,38,0.05);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}
.reg-form-group input::placeholder { color: #555; }
.reg-input-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: #666; font-size: 14px; pointer-events: none;
}
.reg-eye-btn {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; color: #555;
    cursor: pointer; font-size: 14px; padding: 4px;
    transition: color 0.2s;
}
.reg-eye-btn:hover { color: #dc2626; }

.reg-error {
    background: rgba(220,38,38,0.1);
    border: 1px solid rgba(220,38,38,0.3);
    border-radius: 8px;
    padding: 10px 14px;
    color: #ff6b6b;
    font-size: 13px;
    margin-bottom: 14px;
}

.reg-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #8b0000, #dc2626);
    border: none;
    border-radius: 10px;
    padding: 13px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
    letter-spacing: 0.5px;
}
.reg-submit-btn:hover { background: linear-gradient(135deg, #a00000, #ef4444); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(220,38,38,0.4); }
.reg-submit-btn:active { transform: translateY(0); }
.reg-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.reg-login-link { text-align: center; margin-top: 16px; font-size: 13px; color: #666; }
.reg-login-link a { color: #dc2626; text-decoration: none; font-weight: 500; }
.reg-login-link a:hover { color: #ff4444; }

/* Code input */
.code-inputs {
    display: flex; gap: 10px; justify-content: center;
    margin: 10px 0 20px;
}
.code-digit {
    width: 50px; height: 58px;
    background: rgba(255,255,255,0.04);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    outline: none;
    transition: all 0.2s;
    caret-color: #dc2626;
}
.code-digit:focus {
    border-color: #dc2626;
    background: rgba(220,38,38,0.08);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}
.code-digit.filled { border-color: #dc2626; color: #ff4444; }

.reg-resend { text-align: center; margin-top: 14px; font-size: 13px; color: #666; }
.reg-resend a { color: #dc2626; text-decoration: none; }
.reg-resend a:hover { color: #ff4444; }
#resendTimer { color: #888; font-size: 12px; }
