/**
 * Last-Z Alliance Community Website
 * Main Stylesheet
 * 
 * Dark survival game aesthetic with purple/teal accents
 * Fully responsive with 20+ CSS animations
 * 
 * @package LastZAlliance
 * @version 1.0.0
 */

/* ============================================================================
   CSS VARIABLES & ROOT CONFIGURATION
   ============================================================================ */

:root {
    /* Primary Colors - Dark Survival Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #15151f;
    --bg-hover: #1e1e2a;
    
    /* Accent Colors - Purple/Teal */
    --accent-purple: #9333ea;
    --accent-purple-light: #a855f7;
    --accent-purple-dark: #7c3aed;
    --accent-teal: #14b8a6;
    --accent-teal-light: #2dd4bf;
    --accent-teal-dark: #0d9488;
    
    /* Rank Colors */
    --rank-r5: #ffd700;
    --rank-r4: #9b59b6;
    --rank-r3: #3498db;
    --rank-r2: #2ecc71;
    --rank-r1: #95a5a6;
    
    /* Status Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dark: #1e293b;
    
    /* Border Colors */
    --border-color: #2d2d3a;
    --border-light: #3d3d4a;
    
    /* Gradients */
    --gradient-purple: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-dark) 100%);
    --gradient-teal: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-teal-dark) 100%);
    --gradient-dark: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    --gradient-glow: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-teal) 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
    --shadow-glow-purple: 0 0 20px rgba(147, 51, 234, 0.3);
    --shadow-glow-teal: 0 0 20px rgba(20, 184, 166, 0.3);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Orbitron', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

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

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

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

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(147, 51, 234, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(20, 184, 166, 0.08) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

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

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

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

button {
    font-family: inherit;
    cursor: pointer;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

.text-gradient {
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-glow {
    text-shadow: 0 0 10px currentColor;
}

/* ============================================================================
   LAYOUT COMPONENTS
   ============================================================================ */

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-md);
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: var(--spacing-xl) 0;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

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

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* ============================================================================
   NAVIGATION
   ============================================================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-brand img {
    height: 40px;
    width: auto;
}

.navbar-brand:hover {
    color: var(--accent-purple-light);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    list-style: none;
}

.navbar-menu a {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.navbar-menu a.active {
    color: var(--accent-teal);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.navbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: all var(--transition-fast);
}

.navbar-avatar:hover {
    border-color: var(--accent-purple);
    transform: scale(1.05);
}

/* Language Selector */
.language-selector {
    position: relative;
}

.language-selector select {
    appearance: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
}

.language-selector::after {
    content: '▼';
    position: absolute;
    right: var(--spacing-sm);
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.625rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* Mobile Menu Toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--spacing-sm);
    background: none;
    border: none;
    cursor: pointer;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.content-card:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 8px 30px rgba(155, 89, 182, 0.2);
    transform: translateY(-4px);
}

.card-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

/* Glowing Card Variant */
.card-glow {
    position: relative;
}

.card-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: var(--gradient-glow);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

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

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

/* Button Variants */
.btn-primary {
    background: var(--gradient-purple);
    color: white;
    box-shadow: var(--shadow-glow-purple);
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(147, 51, 234, 0.5);
}

.btn-secondary {
    background: var(--gradient-teal);
    color: white;
    box-shadow: var(--shadow-glow-teal);
}

.btn-secondary:hover {
    box-shadow: 0 0 30px rgba(20, 184, 166, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-purple);
    color: var(--accent-purple);
}

.btn-outline:hover {
    background: var(--accent-purple);
    color: white;
}

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

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

/* Button Sizes */
.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.75rem;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.2);
}

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

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Textarea */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Select */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    padding-right: var(--spacing-xl);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-purple);
    cursor: pointer;
}

/* Form Validation */
.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-valid {
    border-color: var(--success);
}

.invalid-feedback {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 0.75rem;
    color: var(--danger);
}

/* ============================================================================
   BADGES & TAGS
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary { background: var(--accent-purple); color: white; }
.badge-secondary { background: var(--accent-teal); color: white; }
.badge-success { background: var(--success); color: white; }
.badge-warning { background: var(--warning); color: var(--text-dark); }
.badge-danger { background: var(--danger); color: white; }
.badge-info { background: var(--info); color: white; }

/* Rank Badges */
.badge-r5 { background: var(--rank-r5); color: var(--text-dark); }
.badge-r4 { background: var(--rank-r4); color: white; }
.badge-r3 { background: var(--rank-r3); color: white; }
.badge-r2 { background: var(--rank-r2); color: white; }
.badge-r1 { background: var(--rank-r1); color: white; }

/* ============================================================================
   AVATARS
   ============================================================================ */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-xs { width: 24px; height: 24px; font-size: 0.625rem; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md { width: 40px; height: 40px; font-size: 0.875rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.5rem; }

.avatar-ring {
    box-shadow: 0 0 0 3px var(--accent-purple);
}

/* Online Status */
.avatar-status {
    position: relative;
}

.avatar-status::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.avatar-status.online::after { background: var(--success); }
.avatar-status.offline::after { background: var(--text-muted); }
.avatar-status.away::after { background: var(--warning); }

/* ============================================================================
   POWER LEVEL DISPLAY
   ============================================================================ */

.power-level {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent-teal);
}

.power-level-icon {
    color: var(--warning);
}

.power-level-value {
    font-size: 1.25em;
}

.power-level-unit {
    font-size: 0.75em;
    color: var(--text-muted);
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================================
   MODALS
   ============================================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.25rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-xs);
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Wide modal for user edit */
.modal-wide {
    max-width: 675px;
}

/* Animated button */
.btn-animated {
    animation: pulse-glow 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-animated:hover::before {
    width: 300px;
    height: 300px;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--accent-purple), 0 0 10px var(--accent-purple);
    }
    50% {
        box-shadow: 0 0 20px var(--accent-purple), 0 0 30px var(--accent-purple), 0 0 40px var(--accent-teal);
    }
}

/* ============================================================================
   TOOLTIPS
   ============================================================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: var(--z-tooltip);
    pointer-events: none;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    color: var(--text-primary);
}

[data-tooltip]::after {
    content: '';
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border: 6px solid transparent;
    border-top-color: var(--border-color);
    margin-bottom: -12px;
}

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

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-success .toast-icon { color: var(--success); }

.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-error .toast-icon { color: var(--danger); }

.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-warning .toast-icon { color: var(--warning); }

.toast.toast-info { border-left: 4px solid var(--info); }
.toast.toast-info .toast-icon { color: var(--info); }

/* ============================================================================
   LOADING STATES
   ============================================================================ */

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

.spinner-sm { width: 20px; height: 20px; border-width: 2px; }
.spinner-lg { width: 60px; height: 60px; border-width: 4px; }

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-hover) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--spacing-sm);
}

.skeleton-avatar {
    border-radius: 50%;
}

/* ============================================================================
   ANIMATIONS (20+ CSS Animations)
   ============================================================================ */

/* 1. Fade In */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.animate-fadeIn { animation: fadeIn 0.5s ease forwards; }

/* 2. Fade In Up */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }

/* 3. Fade In Down */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fadeInDown { animation: fadeInDown 0.5s ease forwards; }

/* 4. Slide In Right */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
.animate-slideInRight { animation: slideInRight 0.5s ease forwards; }

/* 5. Slide In Left */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
.animate-slideInLeft { animation: slideInLeft 0.5s ease forwards; }

/* 6. Scale In */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.animate-scaleIn { animation: scaleIn 0.3s ease forwards; }

/* 7. Bounce In */
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}
.animate-bounceIn { animation: bounceIn 0.6s ease forwards; }

/* 8. Spin */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }

/* 9. Pulse */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* 10. Ping */
@keyframes ping {
    75%, 100% { transform: scale(2); opacity: 0; }
}
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

/* 11. Bounce */
@keyframes bounce {
    0%, 100% { transform: translateY(-5%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
    50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}
.animate-bounce { animation: bounce 1s infinite; }

/* 12. Shake */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.animate-shake { animation: shake 0.5s ease; }

/* 13. Glow Pulse */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 5px var(--accent-purple), 0 0 10px var(--accent-purple); }
    50% { box-shadow: 0 0 20px var(--accent-purple), 0 0 30px var(--accent-purple); }
}
.animate-glowPulse { animation: glowPulse 2s ease-in-out infinite; }

/* 14. Float */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.animate-float { animation: float 3s ease-in-out infinite; }

/* 15. Shimmer */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.animate-shimmer { animation: shimmer 1.5s infinite; }

/* 16. Rotate In */
@keyframes rotateIn {
    from { opacity: 0; transform: rotate(-180deg); }
    to { opacity: 1; transform: rotate(0); }
}
.animate-rotateIn { animation: rotateIn 0.5s ease forwards; }

/* 17. Flip In X */
@keyframes flipInX {
    from { opacity: 0; transform: perspective(400px) rotateX(90deg); }
    to { opacity: 1; transform: perspective(400px) rotateX(0); }
}
.animate-flipInX { animation: flipInX 0.5s ease forwards; }

/* 18. Zoom In */
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}
.animate-zoomIn { animation: zoomIn 0.3s ease forwards; }

/* 19. Slide Up Fade */
@keyframes slideUpFade {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}
.animate-slideUpFade { animation: slideUpFade 0.3s ease forwards; }

/* 20. Heartbeat */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}
.animate-heartbeat { animation: heartbeat 1.5s ease-in-out infinite; }

/* 21. Typing Cursor */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
.animate-blink { animation: blink 1s step-end infinite; }

/* 22. Wave */
@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-15deg); }
}
.animate-wave { animation: wave 0.5s ease-in-out; }

/* 23. Ripple */
@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

/* 24. Gradient Shift */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Animation Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/* Spacing */
.m-0 { margin: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.my-3 { margin-top: var(--spacing-md); margin-bottom: var(--spacing-md); }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0; }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .navbar-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }
    
    .navbar-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .toast-container {
        left: var(--spacing-md);
        right: var(--spacing-md);
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    /* Homepage mobile fixes */
    .container {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .hero-section,
    .stats-section,
    .content-section,
    .sidebar-section {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--spacing-sm);
    }
    
    .sidebar-grid {
        grid-template-columns: 1fr !important;
    }
    
    .quick-links,
    .rank-list,
    .topic-list,
    .contest-list {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .quick-link,
    .rank-item,
    .topic-card,
    .contest-card,
    .content-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Navbar mobile stacking */
    .navbar-inner {
        flex-wrap: wrap;
    }
    
    .navbar-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: var(--spacing-sm);
    }
    
    .language-selector {
        flex: 1;
        max-width: 150px;
    }
    
    .user-menu {
        flex: 1;
        display: flex;
        justify-content: flex-end;
    }
    
    /* Pro page mobile */
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .card-body {
        padding: var(--spacing-md);
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    body {
        background: white;
        color: black;
    }
    
    .navbar,
    .toast-container,
    .modal-backdrop,
    .modal {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}
/* ============================================
   FOOTER STYLES
   ============================================ */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-2xl);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-lg);
}

.footer-brand {
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-links {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   FORUM STYLES
   ============================================ */

.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.category-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.category-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.1);
}

.category-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.category-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.category-name a {
    color: var(--text-primary);
    text-decoration: none;
}

.category-name a:hover {
    color: var(--accent-purple);
}

.category-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.latest-topic-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.topic-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.category-stats {
    display: flex;
    gap: var(--spacing-xl);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-purple);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.forum-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.forum-stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
}

.forum-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-teal);
    margin-bottom: var(--spacing-xs);
}

.forum-stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Topic List */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.topic-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    transition: all var(--transition-fast);
}

.topic-item:hover {
    border-color: var(--accent-purple);
    transform: translateX(4px);
}

.topic-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.topic-content {
    flex: 1;
}

.topic-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.topic-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.topic-title a:hover {
    color: var(--accent-purple);
}

.topic-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.topic-stats {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.topic-stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================
   RANKINGS STYLES
   ============================================ */

.rankings-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
}

.rankings-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    overflow-x: auto;
    padding-bottom: var(--spacing-xs);
}

.rankings-tab {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.rankings-tab:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.rankings-tab.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.user-rank-card {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-teal) 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    color: white;
}

.user-rank-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-rank-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
}

.user-rank-position {
    font-size: 2.5rem;
    font-weight: 700;
}

.rankings-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.rank-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    transition: all var(--transition-fast);
}

.rank-item:hover {
    border-color: var(--accent-purple);
    transform: translateX(4px);
}

.rank-item.top-3 {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-color: var(--accent-purple);
}

.rank-position {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-purple);
    flex-shrink: 0;
    animation: pulse-glow 2s infinite;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.rank-item.top-3 .rank-position {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
    color: white;
    font-size: 3rem;
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.5);
}

.rank-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    object-fit: cover;
    flex-shrink: 0;
}

.rank-info {
    flex: 1;
}

.rank-username {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.rank-details {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.rank-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-teal);
}

/* Rank Badge Styles */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    transition: all var(--transition-fast);
}

.rank-badge.rank-r5 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    font-size: 0.85rem;
}

.rank-badge.rank-r4 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #000;
    font-size: 0.80rem;
}

.rank-badge.rank-r3 {
    background: linear-gradient(135deg, #cd7f32, #daa520);
    color: white;
    font-size: 0.78rem;
}

.rank-badge.rank-r2 {
    background: var(--accent-purple);
    color: white;
    font-size: 0.75rem;
}

.rank-badge.rank-r1 {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-size: 0.70rem;
}

/* Table-specific rank badge */
table td .rank-badge {
    display: inline-flex;
    width: auto;
    min-width: 60px;
    padding: var(--spacing-sm) var(--spacing-lg);
}

/* ============================================
   CHAT STYLES
   ============================================ */

.chat-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: var(--spacing-lg);
    height: calc(100vh - 300px);
    min-height: 600px;
}

.chat-sidebar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.chat-rooms {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.chat-room {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.chat-room:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.chat-room.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.chat-main {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.chat-messages {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.chat-message {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    object-fit: cover;
    flex-shrink: 0;
}

.chat-message-content {
    flex: 1;
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.chat-username {
    font-weight: 600;
    color: var(--text-primary);
}

.chat-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chat-text {
    color: var(--text-secondary);
    word-wrap: break-word;
}

.chat-input-container {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.chat-input-form {
    display: flex;
    gap: var(--spacing-sm);
}

.chat-input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.online-users {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.online-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs);
}

.online-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--accent-teal);
    object-fit: cover;
}

.online-user-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 768px) {
    .forum-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .category-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .rankings-tabs {
        flex-wrap: wrap;
    }
    
    .chat-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .chat-sidebar {
        display: none;
    }
    
    .rank-item {
        flex-wrap: wrap;
    }
    
    .user-rank-card {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }
}

/* ============================================
   SPACING IMPROVEMENTS
   ============================================ */

.card-body {
    margin-bottom: 15px;
}

.stat-card {
    margin-bottom: 15px;
}

.content-section {
    margin-bottom: 15px;
}

/* ============================================
   AUTH PAGES (LOGIN/REGISTER) STYLES
   ============================================ */

.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) 0;
}

.auth-card {
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-logo {
    font-size: 4rem;
    text-decoration: none;
    display: inline-block;
    margin-bottom: var(--spacing-md);
}

.auth-title {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

/* ============================================
   FORUM NEW TOPIC PAGE
   ============================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent-purple);
}

.breadcrumb .separator {
    color: var(--text-muted);
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

.form-container {
    max-width: 900px;
    margin: 0 auto;
}

.guide-form,
.topic-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.form-control textarea {
    min-height: 200px;
    resize: vertical;
}

.form-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* ============================================
   CHAT LAYOUT - 3 COLUMNS
   ============================================ */

.chat-container {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: var(--spacing-lg);
    height: calc(100vh - 300px);
    min-height: 600px;
}

.chat-rooms-sidebar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.chat-users-sidebar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.sidebar-title {
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

/* ============================================
   RANKINGS TABLE IMPROVEMENTS
   ============================================ */

.rankings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 var(--spacing-sm);
}

.rankings-table thead th {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.rankings-table tbody tr {
    background: var(--bg-secondary);
    transition: all var(--transition-fast);
}

.rankings-table tbody tr:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.rankings-table tbody td {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.rankings-table tbody td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.rankings-table tbody td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* ============================================
   RESPONSIVE UPDATES
   ============================================ */

@media (max-width: 768px) {
    .chat-container {
        grid-template-columns: 1fr;
    }
    
    .chat-rooms-sidebar,
    .chat-users-sidebar {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ============================================
   CHAT LAYOUT 3-COLUMN FIX
   ============================================ */

.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: var(--spacing-lg);
    height: calc(100vh - 250px);
    min-height: 600px;
}

.chat-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.users-sidebar {
    height: 100%;
}

.users-sidebar .card.h-full {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.users-sidebar .card-body {
    flex: 1;
    overflow-y: auto;
}

.chat-header {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: var(--spacing-lg);
}

.chat-message {
    animation: slideInMessage 0.3s ease-out;
}

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

.room-item {
    transition: all 0.3s ease;
}

.room-item:hover {
    transform: translateX(5px);
    background: var(--bg-hover);
}

.online-user {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Pro Page Styling */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
}

.pricing-grid .card {
    transition: all 0.3s ease;
    animation: floatUp 0.6s ease-out;
    animation-fill-mode: both;
}

.pricing-grid .card:nth-child(1) { animation-delay: 0.1s; }
.pricing-grid .card:nth-child(2) { animation-delay: 0.2s; }
.pricing-grid .card:nth-child(3) { animation-delay: 0.3s; }

.pricing-grid .card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(147, 51, 234, 0.3);
}

.pricing-grid .card.border-primary {
    border-color: var(--accent-purple);
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.2);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
}

.features-grid > div {
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    animation: fadeInScale 0.5s ease-out;
    animation-fill-mode: both;
}

.features-grid > div:nth-child(1) { animation-delay: 0.1s; }
.features-grid > div:nth-child(2) { animation-delay: 0.2s; }
.features-grid > div:nth-child(3) { animation-delay: 0.3s; }
.features-grid > div:nth-child(4) { animation-delay: 0.4s; }
.features-grid > div:nth-child(5) { animation-delay: 0.5s; }
.features-grid > div:nth-child(6) { animation-delay: 0.6s; }
.features-grid > div:nth-child(7) { animation-delay: 0.7s; }
.features-grid > div:nth-child(8) { animation-delay: 0.8s; }
.features-grid > div:nth-child(9) { animation-delay: 0.9s; }

.features-grid > div:hover {
    background: var(--bg-hover);
    transform: translateY(-5px);
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rankings Top 3 Podium */
.top-3-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl);
}

.top-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    animation: podiumRise 0.6s ease-out;
}

.top-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.top-card.gold {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, var(--bg-card) 100%);
    order: 2;
}

.top-card.silver {
    border-color: #c0c0c0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1) 0%, var(--bg-card) 100%);
    order: 1;
    margin-top: 30px;
}

.top-card.bronze {
    border-color: #cd7f32;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1) 0%, var(--bg-card) 100%);
    order: 3;
    margin-top: 30px;
}

.top-card-position {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: bounce 2s ease-in-out infinite;
}

.top-card-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    border: 4px solid var(--border-color);
    margin: 0 auto var(--spacing-md);
    display: block;
    object-fit: cover;
    transition: all 0.3s ease;
}

.top-card:hover .top-card-avatar {
    transform: scale(1.1);
    border-color: var(--accent-purple);
}

.top-card.gold .top-card-avatar {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.top-card.silver .top-card-avatar {
    border-color: #c0c0c0;
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.5);
}

.top-card.bronze .top-card-avatar {
    border-color: #cd7f32;
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.5);
}

.top-card-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-display);
}

.top-card-name a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.top-card-name a:hover {
    color: var(--accent-purple);
}

.top-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-teal);
    font-family: var(--font-display);
}

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Rankings Table Animations */
.rankings-table tbody tr {
    animation: slideInRow 0.5s ease-out;
    animation-fill-mode: both;
}

.rankings-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.rankings-table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.rankings-table tbody tr:nth-child(3) { animation-delay: 0.3s; }
.rankings-table tbody tr:nth-child(4) { animation-delay: 0.4s; }
.rankings-table tbody tr:nth-child(5) { animation-delay: 0.5s; }

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

.rankings-table tbody tr:hover {
    background: var(--bg-hover);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .top-3-cards {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .top-card.silver,
    .top-card.bronze {
        margin-top: 0;
    }
    
    .top-card.gold {
        order: 1;
    }
    
    .top-card.silver {
        order: 2;
    }
    
    .top-card.bronze {
        order: 3;
    }
    
    /* Homepage responsive fixes */
    .sidebar-grid,
    .quick-links,
    .rank-list,
    .topic-list,
    .contest-list {
        display: flex;
        flex-direction: column;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .quick-link,
    .rank-item,
    .topic-card,
    .contest-card {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: var(--spacing-sm);
    }
    
    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .content-card {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }
}

.chat-input-area {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
}

.chat-input-form {
    display: flex;
    gap: var(--spacing-md);
}

.chat-input {
    flex: 1;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

/* Chat Message Styles */
.chat-message {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.chat-message.own {
    flex-direction: row-reverse;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.message-author {
    font-weight: 600;
    color: var(--accent-purple);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.message-text {
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    line-height: 1.6;
}

.chat-message.own .message-text {
    background: var(--accent-purple)20;
    border: 1px solid var(--accent-purple)30;
}

/* Online Users */
.online-users {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.online-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.online-user:hover {
    background: var(--bg-tertiary);
}

.online-indicator {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Room List */
.room-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.room-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.room-item:hover {
    background: var(--bg-tertiary);
}

.room-item.active {
    background: var(--accent-purple);
    color: white;
}

.room-icon {
    font-size: 1.25rem;
}

.room-type-badge {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

/* Empty State */
.empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.empty-chat-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

/* Responsive Chat */
@media (max-width: 1024px) {
    .chat-layout {
        grid-template-columns: 200px 1fr;
    }
    
    .users-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .chat-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
    }
    
    .chat-sidebar,
    .users-sidebar {
        display: none;
    }
    
    .chat-main {
        height: calc(100vh - 200px);
    }
}

/* ============================================
   FORUM STATISTICS GRID
   ============================================ */

.forum-stats-section {
    margin-bottom: var(--spacing-xl);
}

.forum-stats-section .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

@media (max-width: 768px) {
    .forum-stats-section .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .forum-stats-section .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Forum Stats Bar */
.forum-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.forum-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition-normal);
}

.forum-stat-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.2);
}

.forum-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-purple);
    margin-bottom: var(--spacing-xs);
}

.forum-stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .forum-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .forum-stats-bar {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   GUIDES PAGE STYLES
   ============================================ */

.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

.guide-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.guide-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(155, 89, 182, 0.25);
}

.guide-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: rgba(155, 89, 182, 0.1);
    position: relative;
}

.guide-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
}

.guide-title {
    margin: 0 0 var(--spacing-md) 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

.guide-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.guide-title a:hover {
    color: var(--accent-purple);
}

.guide-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.category-item:hover {
    background: rgba(155, 89, 182, 0.1);
    color: var(--text-primary);
    transform: translateX(4px);
}

.category-item.active {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
    color: white;
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.category-item .badge {
    background: rgba(0, 0, 0, 0.1);
    color: white;
}

.contributor-item {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.contributor-item:hover {
    background: rgba(155, 89, 182, 0.05);
}

.contributor-item:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .guides-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-image {
        height: 180px;
    }
}


/* ============================================
   VIDEO CHAT STYLES
   ============================================ */

.video-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-xl);
    min-height: calc(100vh - 250px);
}

.video-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.video-main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.video-container {
    flex: 1;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    min-height: 500px;
    position: relative;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    height: 100%;
    align-content: center;
}

.video-grid.participants-1 {
    grid-template-columns: 1fr;
}

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

.video-grid.participants-3,
.video-grid.participants-4 {
    grid-template-columns: repeat(2, 1fr);
}

.video-grid.participants-5,
.video-grid.participants-6 {
    grid-template-columns: repeat(3, 1fr);
}

.video-grid.participants-7,
.video-grid.participants-8 {
    grid-template-columns: repeat(4, 1fr);
}

.video-tile {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.video-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-tile .participant-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: var(--spacing-md) var(--spacing-sm);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.video-tile .participant-status {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-xs);
}

.video-tile .status-icon {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
}

.video-tile .status-icon.muted {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.8);
}

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    padding: var(--spacing-xl);
}

.video-placeholder-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.video-placeholder h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.video-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.control-btn:hover {
    transform: scale(1.1);
}

.control-btn.secondary {
    border: 2px solid var(--border-color);
}

.control-btn.secondary.active {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
}

.control-btn.secondary.muted {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.control-btn.danger {
    background: #ef4444;
    color: white;
}

.control-btn.danger:hover {
    background: #dc2626;
}

.room-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 400px;
    overflow-y: auto;
}

.room-card {
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-tertiary);
}

.room-card:hover {
    border-color: var(--accent-purple);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.2);
}

.room-card.active {
    border-color: var(--accent-purple);
    background: rgba(155, 89, 182, 0.1);
}

.room-card.full {
    opacity: 0.6;
    cursor: not-allowed;
}

.room-card.full:hover {
    transform: none;
}

.room-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.room-host-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.room-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-count {
    padding: 2px 8px;
    background: var(--accent-teal);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.room-count.full {
    background: #ef4444;
}

.room-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

@media (max-width: 1024px) {
    .video-layout {
        grid-template-columns: 250px 1fr;
    }
}

@media (max-width: 768px) {
    .video-layout {
        grid-template-columns: 1fr;
    }
    
    .video-sidebar {
        display: none;
    }
    
    .video-grid {
        grid-template-columns: 1fr !important;
    }
    
    .video-container {
        min-height: 400px;
    }
}


/* ========================================
   FORUM TOPIC PAGE
   ======================================== */

/* Topic Header */
.topic-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.topic-title {
    color: var(--text-white);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.topic-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: var(--spacing-sm);
    vertical-align: middle;
}

.topic-badge.pinned {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.topic-badge.locked {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.topic-meta {
    display: flex;
    gap: var(--spacing-md);
    color: var(--text-muted);
    font-size: 0.95rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Post Cards */
.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--spacing-lg);
    overflow: hidden;
}

.post-card.original-post {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.05) 0%, rgba(20, 184, 166, 0.05) 100%);
    border-color: var(--primary-purple);
}

.post-author {
    background: rgba(255, 255, 255, 0.02);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-sm);
}

.author-avatar {
    width: 80px !important;
    height: 80px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-purple);
    margin-bottom: var(--spacing-sm);
}

.author-name {
    color: var(--text-white);
    font-weight: 600;
    font-size: 1.1rem;
}

.author-rank {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.author-stats {
    width: 100%;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.author-stats div {
    display: flex;
    justify-content: space-between;
}

.post-content-wrapper {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

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

.post-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.post-body {
    color: var(--text-white);
    line-height: 1.8;
    font-size: 1rem;
    flex: 1;
    margin-bottom: var(--spacing-lg);
}

.post-footer {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.like-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.9rem;
}

.like-button:hover:not(:disabled) {
    background: rgba(236, 72, 153, 0.1);
    border-color: var(--primary-pink);
    color: var(--primary-pink);
}

.like-button.liked {
    background: linear-gradient(135deg, var(--primary-pink) 0%, #ec4899 100%);
    border-color: var(--primary-pink);
    color: white;
}

.like-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.like-count {
    font-weight: 600;
}

/* Reply Form */
.reply-form-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.reply-form-container h3 {
    color: var(--text-white);
    margin-bottom: var(--spacing-lg);
}

textarea.form-control {
    min-height: 200px;
    resize: vertical;
}

/* Topic Pagination */
.topic-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.topic-pagination-info {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .post-card {
        grid-template-columns: 1fr;
    }
    
    .post-author {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        gap: var(--spacing-md);
    }
    
    .author-avatar {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 0;
    }
    
    .author-stats {
        display: none;
    }
}

/* ========================================
   ENHANCED FORUM CATEGORY PAGE
   ======================================== */

/* Category Hero Section */
.category-hero {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--accent-teal) 100%);
    padding: var(--spacing-xl) var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeInDown 0.6s ease;
}

.category-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.category-hero-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    display: block;
    animation: bounce 2s infinite;
}

.category-hero-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.category-hero-description {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Category Stats Bar */
.category-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.category-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

.category-stat-card:nth-child(1) { animation-delay: 0.1s; }
.category-stat-card:nth-child(2) { animation-delay: 0.2s; }
.category-stat-card:nth-child(3) { animation-delay: 0.3s; }
.category-stat-card:nth-child(4) { animation-delay: 0.4s; }

.category-stat-card:hover {
    border-color: var(--primary-purple);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.2);
}

.category-stat-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    display: block;
}

.category-stat-value {
    color: var(--text-white);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.category-stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Topic List */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.topic-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: var(--spacing-lg);
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: slideInLeft 0.4s ease;
}

.topic-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-purple), var(--accent-teal));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.topic-item:hover {
    border-color: var(--primary-purple);
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.15);
}

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

.topic-item.pinned {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.05) 100%);
    border-color: #f59e0b;
}

.topic-item.pinned::before {
    opacity: 1;
    background: #f59e0b;
}

.topic-avatar-container {
    position: relative;
}

.topic-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-purple);
    transition: all 0.3s ease;
}

.topic-item:hover .topic-avatar {
    border-color: var(--accent-teal);
    transform: scale(1.1);
}

.topic-content {
    flex: 1;
}

.topic-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: var(--spacing-sm);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: color 0.2s ease;
}

.topic-title:hover {
    color: var(--primary-purple);
}

.topic-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.topic-badge.pinned {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.topic-badge.locked {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.topic-meta {
    display: flex;
    gap: var(--spacing-md);
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
    align-items: center;
}

.topic-meta a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.topic-meta a:hover {
    color: var(--accent-teal);
}

.topic-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(147, 51, 234, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-purple);
    transition: all 0.2s ease;
}

.topic-stat-badge:hover {
    background: rgba(147, 51, 234, 0.2);
    transform: scale(1.05);
}

.topic-stats-section {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.topic-stat {
    text-align: center;
    padding: var(--spacing-sm);
}

.topic-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-white);
}

.topic-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Empty State */
.empty-topics {
    text-align: center;
    padding: var(--spacing-xxl);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    animation: fadeIn 0.5s ease;
}

.empty-topics-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-topics-title {
    color: var(--text-white);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.empty-topics-text {
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

/* Responsive */
@media (max-width: 768px) {
    .category-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .topic-item {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }
    
    .topic-avatar-container {
        display: none;
    }
    
    .topic-stats-section {
        width: 100%;
        justify-content: space-around;
        padding-top: var(--spacing-md);
        border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 480px) {
    .category-stats-bar {
        grid-template-columns: 1fr;
    }
    
    .category-hero-title {
        font-size: 2rem;
    }
}

/* ========================================
   PROFILE PAGE
   ======================================== */

/* Profile Header */
.profile-header {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: var(--spacing-xl);
    align-items: start;
    animation: fadeInUp 0.6s ease;
}

.profile-avatar-section {
    text-align: center;
}

.profile-avatar {
    width: 150px !important;
    height: 150px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-purple);
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.3);
    transition: all 0.3s ease;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(147, 51, 234, 0.4);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.profile-name {
    color: var(--text-white);
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.profile-rank {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.profile-meta-item {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.profile-meta-item strong {
    color: var(--text-white);
}

.profile-bio {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--primary-purple);
    padding: var(--spacing-md);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: var(--spacing-md);
}

/* Profile Stats */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

.profile-stats .stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.profile-stats .stat-card:hover {
    border-color: var(--primary-purple);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.2);
}

.profile-stats .stat-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    display: block;
}

.profile-stats .stat-value {
    color: var(--text-white);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.profile-stats .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Profile Sections */
.profile-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.profile-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    animation: fadeInUp 0.6s ease;
}

.profile-section:nth-child(1) { animation-delay: 0.3s; }
.profile-section:nth-child(2) { animation-delay: 0.4s; }

.profile-section-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);
}

.profile-section-header h3 {
    color: var(--text-white);
    font-size: 1.3rem;
    margin: 0;
}

/* Recent Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.activity-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: rgba(147, 51, 234, 0.05);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(147, 51, 234, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-description {
    color: var(--text-white);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-xs);
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Recent Topics */
.recent-topics-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.topic-mini-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-decoration: none;
}

.topic-mini-card:hover {
    background: rgba(147, 51, 234, 0.05);
    transform: translateX(5px);
}

.topic-mini-card-title {
    color: var(--text-white);
    font-weight: 600;
    flex: 1;
}

.topic-mini-card-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Edit Profile Form */
.edit-profile-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-lg);
    animation: fadeInUp 0.6s ease 0.5s backwards;
}

.edit-profile-form h3 {
    color: var(--text-white);
    margin-bottom: var(--spacing-lg);
}

/* Responsive */
@media (max-width: 1024px) {
    .profile-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .profile-avatar-section {
        margin-bottom: var(--spacing-lg);
    }
    
    .profile-meta {
        justify-content: center;
    }
    
    .profile-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .profile-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-avatar {
        width: 120px !important;
        height: 120px !important;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .profile-meta {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
}

/* Rewards Banner - Rankings Page */
.rewards-banner {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    animation: slideInDown 0.5s ease, pulse-border 2s infinite;
}

.rewards-banner-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.rewards-banner-icon {
    font-size: 4rem;
    animation: bounce 2s infinite;
}

.rewards-banner-text {
    flex: 1;
    min-width: 200px;
}

.rewards-banner-title {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rewards-banner-desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.rewards-banner-points {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 193, 7, 0.1) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.rewards-banner-points .points-value {
    font-size: 2rem;
    font-weight: 700;
    color: #FFD700;
}

.rewards-banner-points .points-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.btn-rewards {
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-teal) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-rewards:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-rewards:active {
    transform: translateY(0) scale(0.98);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-border {
    0%, 100% {
        border-color: rgba(139, 92, 246, 0.3);
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }
    50% {
        border-color: rgba(139, 92, 246, 0.6);
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }
}

@media (max-width: 768px) {
    .rewards-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .rewards-banner-text {
        min-width: auto;
    }
    
    .btn-rewards {
        width: 100%;
        justify-content: center;
    }
}

/* Profile Page Improvements */
.profile-page .card {
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 0.5s ease;
}

.profile-page .card:nth-child(1) { animation-delay: 0.1s; }
.profile-page .card:nth-child(2) { animation-delay: 0.2s; }
.profile-page .card:nth-child(3) { animation-delay: 0.3s; }

.profile-page .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

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

/* Avatar Frame Styles */
.avatar-frame-preview {
    display: inline-block;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Gold Frame */
.avatar-frame-preview.gold {
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    animation: shimmer 3s ease-in-out infinite;
}

/* Silver Frame */
.avatar-frame-preview.silver {
    background: linear-gradient(45deg, #C0C0C0, #E8E8E8, #C0C0C0);
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.6);
}

/* Bronze Frame */
.avatar-frame-preview.bronze {
    background: linear-gradient(45deg, #CD7F32, #E8A862, #CD7F32);
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.6);
}

/* Diamond Frame */
.avatar-frame-preview.diamond {
    background: linear-gradient(45deg, #B9F2FF, #00BFFF, #B9F2FF);
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.8), 0 0 60px rgba(0, 191, 255, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

/* Platinum Frame */
.avatar-frame-preview.platinum {
    background: linear-gradient(45deg, #E5E4E2, #F5F5F5, #E5E4E2);
    box-shadow: 0 0 20px rgba(229, 228, 226, 0.8);
}

/* Rainbow Frame */
.avatar-frame-preview.rainbow {
    background: linear-gradient(45deg, #FF0000, #FF7F00, #FFFF00, #00FF00, #0000FF, #4B0082, #9400D3, #FF0000);
    background-size: 400% 400%;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    animation: rainbow 3s ease infinite;
}

/* Fire Frame */
.avatar-frame-preview.fire {
    background: linear-gradient(45deg, #FF4500, #FFA500, #FF4500);
    box-shadow: 0 0 30px rgba(255, 69, 0, 0.8), 0 0 60px rgba(255, 165, 0, 0.4);
    animation: fire 0.5s ease-in-out infinite alternate;
}

/* Ice Frame */
.avatar-frame-preview.ice {
    background: linear-gradient(45deg, #00BFFF, #E0FFFF, #00BFFF);
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.8), 0 0 60px rgba(224, 255, 255, 0.4);
}

/* Shadow Frame */
.avatar-frame-preview.shadow {
    background: linear-gradient(45deg, #1a1a1a, #333333, #1a1a1a);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 60px rgba(0, 0, 0, 0.4);
}

/* Avatar Frame Animations */
@keyframes shimmer {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0, 191, 255, 0.8), 0 0 60px rgba(0, 191, 255, 0.4); }
    50% { box-shadow: 0 0 40px rgba(0, 191, 255, 1), 0 0 80px rgba(0, 191, 255, 0.6); }
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fire {
    0% { box-shadow: 0 0 30px rgba(255, 69, 0, 0.8), 0 0 60px rgba(255, 165, 0, 0.4); }
    100% { box-shadow: 0 0 40px rgba(255, 69, 0, 1), 0 0 80px rgba(255, 165, 0, 0.6); }
}

/* Username Color Display */
.username-colored {
    font-weight: bold;
    transition: color 0.3s ease;
}

/* Form improvements for customization */
.form-group input[type="color"] {
    padding: 0;
    border: none;
    cursor: pointer;
    height: 40px;
}


/* Announcement Banner */
.announcement-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff;
    padding: 12px 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.announcement-icon {
    font-size: 1.5rem;
    padding: 0 20px;
    flex-shrink: 0;
    animation: bounce 2s ease-in-out infinite;
}

.announcement-marquee {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.announcement-content {
    display: flex;
    align-items: center;
    gap: 30px;
    white-space: nowrap;
    animation: scroll 30s linear infinite;
}

.announcement-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.announcement-item strong {
    font-weight: 600;
}

.announcement-separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
}

.announcement-info {
    color: #ffffff;
}

.announcement-warning {
    color: #FFF3CD;
}

.announcement-success {
    color: #D4EDDA;
}

.announcement-danger {
    color: #F8D7DA;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.announcement-banner:hover .announcement-content {
    animation-play-state: paused;
}

@media (max-width: 768px) {
    .announcement-banner {
        padding: 10px 0;
    }
    .announcement-icon {
        padding: 0 10px;
        font-size: 1.2rem;
    }
    .announcement-item {
        font-size: 0.85rem;
    }
}
/* ========================================
   CUSTOM SCROLLBAR (v1.3.3)
   ======================================== */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #9333ea 0%, #14b8a6 100%);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:active {
    background: var(--primary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-secondary);
}

/* Hide default vertical scrollbar but keep functionality */
::-webkit-scrollbar:vertical {
    display: none;
}

/* Force custom scrollbar on all scrollable elements */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-secondary);
}

/* Remove horizontal scrollbar */
::-webkit-scrollbar:horizontal {
    height: 0;
    width: 0;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Ensure no default scrollbars interfere */
body {
    overflow-x: hidden;
}

/* ============================================================================
   SCROLLBAR HIDING - CROSS-BROWSER COMPATIBLE
   Maintains scroll functionality while hiding the visual scrollbar
   IMPORTANT: Does NOT affect dropdowns or elements that need scrolling
   ============================================================================ */

/* Hide scrollbar for main scrollable elements only */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    background: transparent;
}

/* Hide scrollbar for IE, Edge and Firefox */
html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Ensure dropdowns and modals can scroll properly */
.dropdown-menu,
.modal-body,
.chat-messages,
.admin-content {
    scrollbar-width: auto !important; /* Re-enable for these elements */
    -ms-overflow-style: auto !important;
}

.dropdown-menu::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.admin-content::-webkit-scrollbar {
    width: 8px !important;
    display: block !important;
}

/* Custom scrollbar for specific elements */
.admin-content::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.topic-replies::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.dropdown-menu::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track,
select::-webkit-scrollbar-track,
table::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 8px;
}

.admin-content::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.topic-replies::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.dropdown-menu::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb,
select::-webkit-scrollbar-thumb,
table::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-purple) 0%, var(--accent-teal) 100%);
    border-radius: 8px;
    border: 1px solid var(--bg-secondary);
}

.admin-content::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.topic-replies::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.dropdown-menu::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover,
select::-webkit-scrollbar-thumb:hover,
table::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #9333ea 0%, #14b8a6 100%);
}
