
        :root {
            /* Light theme variables */
            --color-background: #ffffff;
            --color-surface: #f8fafc;
            --color-text: #1e293b;
            --color-text-secondary: #64748b;
            --color-border: #e2e8f0;
            --color-primary: #3b82f6;
            --color-primary-dark: #1d4ed8;
            --color-success: #10b981;
            --color-warning: #f59e0b;
            --color-danger: #ef4444;
            --color-info: #8b5cf6;
            
            /* Trending specific */
            --color-trending-hot: #ef4444;
            --color-trending-viral: #10b981;
            --color-trending-rising: #8b5cf6;
            --color-trending-bg: linear-gradient(135deg, #fef2f2 0%, #eff6ff 100%);
            
            /* Shadows */
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            --shadow-trending: 0 10px 25px -5px rgba(239, 68, 68, 0.2);
            
            /* Border radius */
            --radius-sm: 0.375rem;
            --radius-md: 0.5rem;
            --radius-lg: 0.75rem;
            --radius-xl: 1rem;
            --radius-2xl: 1.5rem;
            --radius-full: 9999px;
            
            /* Transitions */
            --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
            --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
            --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
            
            /* Z-index */
            --z-dropdown: 1000;
            --z-sticky: 1020;
            --z-fixed: 1030;
            --z-modal: 1050;
            --z-popover: 1060;
            --z-tooltip: 1070;
        }
        
        .dark {
            /* Dark theme variables */
            --color-background: #0f172a;
            --color-surface: #1e293b;
            --color-text: #f1f5f9;
            --color-text-secondary: #94a3b8;
            --color-border: #334155;
            --color-primary: #60a5fa;
            --color-primary-dark: #3b82f6;
            --color-success: #34d399;
            --color-warning: #fbbf24;
            --color-danger: #f87171;
            --color-info: #a78bfa;
            
            /* Trending specific */
            --color-trending-hot: #fca5a5;
            --color-trending-viral: #34d399;
            --color-trending-rising: #a78bfa;
            --color-trending-bg: linear-gradient(135deg, #1c1917 0%, #1e3a8a 100%);
            
            /* Shadows */
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
            --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
            --shadow-trending: 0 10px 25px -5px rgba(252, 165, 165, 0.3);
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            transition: background-color var(--transition-base), 
                        border-color var(--transition-base),
                        color var(--transition-base);
        }
        
        html {
            scroll-behavior: smooth;
            scroll-padding-top: 80px;
        }
        
        body {
            font-family: var(--font-sans, 'Inter', sans-serif);
            background-color: var(--color-background);
            color: var(--color-text);
            min-height: 100vh;
            line-height: 1.6;
        }
        
        [dir="rtl"] body {
            font-family: var(--font-arabic, 'Noto Sans Arabic', sans-serif);
            text-align: right;
        }
        
        /* Container */
        .container {
            width: 100%;
            margin-right: auto;
            margin-left: auto;
            padding-right: 1rem;
            padding-left: 1rem;
        }
        
        @media (min-width: 640px) {
            .container {
                max-width: 640px;
            }
        }
        
        @media (min-width: 768px) {
            .container {
                max-width: 768px;
            }
        }
        
        @media (min-width: 1024px) {
            .container {
                max-width: 1024px;
            }
        }
        
        @media (min-width: 1280px) {
            .container {
                max-width: 1280px;
            }
        }
        
        /* Typography */
        h1, h2, h3, h4, h5, h6 {
            font-weight: 700;
            line-height: 1.2;
            color: var(--color-text);
        }
        
        a {
            color: var(--color-primary);
            text-decoration: none;
            transition: color var(--transition-fast);
        }
        
        a:hover {
            color: var(--color-primary-dark);
        }
        
        /* Accessibility */
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }
        
        .focus-visible:focus {
            outline: 2px solid var(--color-primary);
            outline-offset: 2px;
        }
        
        .focus-visible:focus:not(:focus-visible) {
            outline: none;
        }
        
        /* Theme toggle */
        .theme-toggle {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            width: 3.5rem;
            height: 3.5rem;
            background: var(--color-surface);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-full);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: var(--z-fixed);
            box-shadow: var(--shadow-lg);
            transition: all var(--transition-base);
        }
        
        [dir="rtl"] .theme-toggle {
            right: auto;
            left: 2rem;
        }
        
        .theme-toggle:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-xl);
        }
        
        /* Trending badges */
        .trending-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            padding: 0.375rem 0.75rem;
            border-radius: var(--radius-full);
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.025em;
            animation: pulse 2s infinite;
        }
        
        .badge-hot {
            background: linear-gradient(135deg, var(--color-trending-hot), #dc2626);
            color: white;
        }
        
        .badge-viral {
            background: linear-gradient(135deg, var(--color-trending-viral), #059669);
            color: white;
        }
        
        .badge-rising {
            background: linear-gradient(135deg, var(--color-trending-rising), #7c3aed);
            color: white;
        }
        
        .badge-top {
            background: linear-gradient(135deg, var(--color-trending-top), #d97706);
            color: white;
        }
        
        /* Article cards */
        .article-card {
            background: var(--color-surface);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-xl);
            overflow: hidden;
            transition: all var(--transition-base);
            position: relative;
            height: 100%;
        }
        
        .article-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--shadow-xl);
            border-color: var(--color-primary);
        }
        
        .article-card.featured::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, 
                var(--color-trending-hot), 
                var(--color-trending-viral),
                var(--color-trending-rising));
            z-index: 1;
        }
        
        .rank-badge {
            position: absolute;
            top: 1rem;
            left: 1rem;
            width: 2.5rem;
            height: 2.5rem;
            background: linear-gradient(135deg, 
                var(--color-trending-hot), 
                var(--color-trending-top));
            color: white;
            border-radius: var(--radius-full);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 1rem;
            box-shadow: var(--shadow-lg);
            z-index: 2;
        }
        
        [dir="rtl"] .rank-badge {
            left: auto;
            right: 1rem;
        }
        
        /* Loading skeleton */
        .skeleton {
            background: linear-gradient(90deg, 
                var(--color-border) 25%, 
                var(--color-surface) 50%, 
                var(--color-border) 75%);
            background-size: 200% 100%;
            animation: shimmer 2s infinite linear;
        }
        
        /* Progress bars */
        .progress-bar {
            height: 0.5rem;
            background: var(--color-border);
            border-radius: var(--radius-full);
            overflow: hidden;
        }
        
        .progress-fill {
            height: 100%;
            border-radius: var(--radius-full);
            transition: width var(--transition-slow);
        }
        
        /* Custom scrollbar */
        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }
        
        ::-webkit-scrollbar-track {
            background: var(--color-surface);
        }
        
        ::-webkit-scrollbar-thumb {
            background: var(--color-border);
            border-radius: var(--radius-full);
        }
        
        ::-webkit-scrollbar-thumb:hover {
            background: var(--color-text-secondary);
        }
        
        /* Print styles */
        @media print {
            .no-print {
                display: none !important;
            }
            
            body {
                color: #000;
                background: #fff;
            }
            
            .article-card {
                break-inside: avoid;
                border: 1px solid #ddd;
                box-shadow: none;
            }
        }
        
        /* Reduced motion */
        @media (prefers-reduced-motion: reduce) {
            * {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }
        
        /* High contrast */
        @media (prefers-contrast: high) {
            :root, .dark {
                --color-primary: #0000ff;
                --color-trending-hot: #ff0000;
                --color-border: #000000;
            }
        }
        
        /* Mobile optimizations */
        @media (max-width: 640px) {
            .container {
                padding-right: 0.75rem;
                padding-left: 0.75rem;
            }
            
            .theme-toggle {
                bottom: 1rem;
                right: 1rem;
                width: 3rem;
                height: 3rem;
            }
            
            [dir="rtl"] .theme-toggle {
                left: 1rem;
            }
        }
        
        /* Custom utility classes */
        .line-clamp-1 {
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }
        
        .line-clamp-2 {
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }
        
        .line-clamp-3 {
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
        }
        
        .gradient-text {
            background-clip: text;
            -webkit-background-clip: text;
            color: transparent;
        }
        
        .glass-effect {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        
        .dark .glass-effect {
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

/* ============================================ */
/* SIDEBAR ULTIMATE STYLING - GLASSMORPHISM EDITION */
/* ============================================ */

/* Base sidebar card - glassmorphism */
.sidebar-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    padding: 1.75rem 1.5rem;
    box-shadow: 
        0 10px 30px -5px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.sidebar-card:hover {
    box-shadow: 
        0 25px 40px -12px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    transform: translateY(-3px);
}

/* Premium card special effects */
.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.7s ease;
}

.premium-card:hover::before {
    left: 100%;
}

/* Trending icon wrapper */
.trending-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 10px 20px -8px rgba(0, 0, 0, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.trending-icon-wrapper:hover {
    transform: rotate(0deg) scale(1.05);
}

/* Ranking items */
.ranking-item {
    display: block;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background: white;
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.08);
}

/* Rank badge */
.rank-badge {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
}

.rank-badge.number {
    background: linear-gradient(145deg, #f3f4f6, #e5e7eb);
    color: #374151;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.05);
}

.rank-badge.medal {
    background: linear-gradient(145deg, #fef3c7, #fde68a);
    color: #92400e;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px -2px rgba(245, 158, 11, 0.3);
}

/* Metric badges */
.metric-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 30px;
    font-size: 0.7rem;
    color: #4b5563;
}

.metric-badge.views i { color: #3b82f6; }
.metric-badge.likes i { color: #f43f5e; }

/* Topic cloud */
.topic-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.topic-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 100px;
    font-size: calc(var(--topic-size, 0.9) * 0.9rem);
    opacity: var(--topic-opacity, 0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #4c1d95;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(139, 92, 246, 0.05);
}

.topic-tag:hover {
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
    color: white;
    border-color: transparent;
    transform: scale(1.05);
    box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.4);
}

.topic-tag.hot {
    background: linear-gradient(145deg, #f43f5e, #e11d48);
    color: white;
    border-color: transparent;
    animation: pulse-glow 2s infinite;
}

.topic-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.15rem 0.6rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
}

.topic-tag:hover .topic-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Viral card special */
.viral-card {
    background: linear-gradient(135deg, #fff1f2, #fff5f5);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.viral-item {
    display: block;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    border: 1px solid rgba(244, 63, 94, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.viral-item:hover {
    background: white;
    border-color: rgba(244, 63, 94, 0.3);
    transform: scale(1.02);
    box-shadow: 0 15px 30px -12px rgba(244, 63, 94, 0.25);
}

.viral-intensity-indicator {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(145deg, #f43f5e, #e11d48);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(244, 63, 94, calc(var(--intensity-scale, 1) * 0.5));
    animation: pulse-intense calc(2s / var(--intensity-scale, 1)) infinite;
}

/* Velocity sparkline */
.velocity-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    margin-top: 0.5rem;
    height: 30px;
}

.spark-bar {
    width: 4px;
    background: linear-gradient(to top, #f43f5e, #fb7185);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    animation: spark-pulse 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.1s);
}

/* Category grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.category-card {
    position: relative;
    padding: 1.2rem 1rem;
    background: linear-gradient(145deg, #ffffff, #fafafa);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px -10px rgba(16, 185, 129, 0.2);
}

.category-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover .category-bg {
    opacity: 1;
}

.category-icon-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(145deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.icon-ring {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 17px;
    animation: spin-slow 3s linear infinite;
}

.category-progress {
    display: inline-block;
    width: 50px;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    margin-left: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Animations */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px -5px rgba(244, 63, 94, 0.4); }
    50% { box-shadow: 0 0 30px -3px rgba(244, 63, 94, 0.7); }
}

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

@keyframes spark-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

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

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* RTL Support */
[dir="rtl"] .ranking-item .flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .metric-badge i {
    margin-left: 0.35rem;
    margin-right: 0;
}

[dir="rtl"] .fa-arrow-right {
    transform: rotate(180deg);
}

[dir="rtl"] .group-hover/link .fa-arrow-right {
    transform: translateX(-4px) rotate(180deg);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sidebar-card {
        background: rgba(17, 24, 39, 0.8);
        backdrop-filter: blur(20px);
        border-color: rgba(255, 255, 255, 0.05);
    }
    
    .ranking-item {
        background: rgba(31, 41, 55, 0.5);
    }
    
    .ranking-item:hover {
        background: #1f2937;
    }
    
    .topic-tag {
        background: rgba(31, 41, 55, 0.8);
        color: #e0e7ff;
        border-color: rgba(167, 139, 250, 0.2);
    }
    
    .viral-item {
        background: rgba(31, 41, 55, 0.6);
    }
    
    .viral-item:hover {
        background: #1f2937;
    }
}

/* Mobile optimizations */
@media (max-width: 1024px) {
    .sidebar-card {
        padding: 1.5rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
}

/* Print styles */
@media print {
    .sidebar-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}
