﻿        /* متغيرات أساسية – ألوان نقية مع تأثيرات Vision Pro */
        :root {
            --bg-primary: #ffffff;
            --bg-secondary: #f2f2f5;
            --text-primary: #1d1d1f;
            --text-secondary: #4a4a4e;
            --text-muted: #86868b;
            --accent: #9a836a;        /* لون ترابي هادئ */
            --accent-light: #d6c6b6;
            --accent-glow: rgba(154, 131, 106, 0.3);
            --border-light: rgba(0, 0, 0, 0.05);
            --card-bg: rgba(255, 255, 255, 0.6);
            --glass-bg: rgba(255, 255, 255, 0.3);
            --glass-border: rgba(255, 255, 255, 0.4);
            --shadow-sm: 0 20px 40px -20px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
            --shadow-hover: 0 40px 60px -20px rgba(0, 0, 0, 0.25), 0 0 0 2px var(--accent-light) inset, 0 0 30px var(--accent-glow);
            --transition-liquid: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            --content-width: min(1400px, 90vw);
            --header-height: 85px;
            --radius-sm: 30px;
            --radius-md: 45px;
            --radius-lg: 60px;
            --radius-xl: 80px;
            --radius-full: 1000px;
        }

        [data-theme="dark"] {
            --bg-primary: #0c0c0e;
            --bg-secondary: #1a1a1e;
            --text-primary: #f5f5f7;
            --text-secondary: #d1d1d6;
            --text-muted: #8e8e93;
            --accent: #cbb8a4;
            --accent-light: #9a836a;
            --accent-glow: rgba(203, 184, 164, 0.3);
            --border-light: rgba(255, 255, 255, 0.1);
            --card-bg: rgba(30, 30, 35, 0.6);
            --glass-bg: rgba(20, 20, 25, 0.3);
            --glass-border: rgba(255, 255, 255, 0.1);
            --shadow-sm: 0 20px 40px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
            --shadow-hover: 0 40px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 2px var(--accent-light) inset, 0 0 40px var(--accent-glow);
        }

        /* تحسين الأداء وإعادة الضبط */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            background-color: var(--bg-primary);
            color: var(--text-primary);
            font-family: 'Inter', 'Tajawal', sans-serif;
            font-weight: 300;
            line-height: 1.6;
            direction: rtl;
            -webkit-font-smoothing: antialiased;
            position: relative;
            overflow-x: hidden;
        }

        /* خلفية متحركة سائلة (فقاعات خفيفة) */
        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background: radial-gradient(circle at 30% 30%, var(--accent-glow) 0%, transparent 30%),
                        radial-gradient(circle at 80% 70%, rgba(154, 131, 106, 0.1) 0%, transparent 35%),
                        repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 2px, transparent 2px, transparent 6px);
            pointer-events: none;
            z-index: -1;
            opacity: 0.8;
            animation: none;
        }

        .container {
            max-width: var(--content-width);
            margin: 0 auto;
            padding: 0 2rem;
            position: relative;
            z-index: 2;
        }

        /* الخطوط */
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Amiri', serif;
            font-weight: 500;
            line-height: 1.2;
            color: var(--text-primary);
        }

        p, .text-secondary {
            font-family: 'Inter', 'Tajawal', sans-serif;
            color: var(--text-secondary);
        }

        /* روابط وأزرار سائلة */
        a {
            text-decoration: none;
            color: inherit;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.7rem;
            padding: 1rem 2.5rem;
            background: var(--accent);
            color: white;
            border-radius: var(--radius-full);
            font-weight: 600;
            font-size: 1rem;
            border: none;
            cursor: pointer;
            transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
            box-shadow: 0 4px 20px var(--accent-glow);
            backdrop-filter: blur(15px);
            position: relative;
            overflow: hidden;
        }

        .btn::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(120deg, transparent 10%, rgba(255,255,255,0.45) 46%, transparent 82%);
            opacity: 0;
            transform: translateX(-36%);
            transition: transform 340ms ease, opacity 300ms ease;
        }

        .btn:hover::before {
            opacity: 1;
            transform: translateX(48%);
        }

        .btn:hover {
            background: var(--accent-light);
            transform: translateY(-2px);
            box-shadow: 0 12px 32px var(--accent-glow);
        }

        .btn-outline {
            background: rgba(255,255,255,0.12);
            border: 1px solid rgba(255,255,255,0.4);
            color: white;
            backdrop-filter: blur(18px);
        }

        .btn-outline:hover {
            background: rgba(255,255,255,0.22);
            border-color: rgba(255,255,255,0.65);
            color: white;
        }

        .btn-sm {
            padding: 0.5rem 1.5rem;
            font-size: 0.95rem;
            background: var(--accent);
            color: white;
            border-radius: var(--radius-full);
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s;
        }

        .btn-sm:hover {
            background: var(--accent-light);
            gap: 0.8rem;
        }

        /* أزرار تسجيل مميزة */
        .btn-register {
            background: linear-gradient(135deg, var(--accent), var(--accent-light));
            border: 1px solid rgba(255,255,255,0.3);
            font-size: 1.1rem;
            padding: 0.9rem 2.2rem;
            box-shadow: 0 10px 30px rgba(154, 131, 106, 0.5);
        }

        @keyframes pulse {
            0% { box-shadow: 0 0 0 0 rgba(154, 131, 106, 0.7); }
            70% { box-shadow: 0 0 0 10px rgba(154, 131, 106, 0); }
            100% { box-shadow: 0 0 0 0 rgba(154, 131, 106, 0); }
        }

        .btn-register:hover {
            animation: none;
            transform: translateY(-2px);
        }

        .btn-login {
            background: transparent;
            border: 2px solid var(--accent);
            color: var(--accent);
            box-shadow: none;
        }

        .btn-login:hover {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
        }

        /* هيدر زجاجي فائق */
        .header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.8rem 2rem;
            background: var(--glass-bg);
            backdrop-filter: blur(30px);
            -webkit-backdrop-filter: blur(30px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-full);
            margin: 1.5rem 0 2rem;
            box-shadow: var(--shadow-sm);
            position: sticky;
            top: 1.5rem;
            z-index: 100;
            height: var(--header-height);
            transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
        }

        .header.scrolled {
            background: var(--card-bg);
            backdrop-filter: blur(36px);
            box-shadow: 0 15px 40px -15px rgba(0,0,0,0.2);
        }

        .logo {
            font-family: 'Amiri', serif;
            font-size: 2.2rem;
            font-weight: 600;
            background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            transition: all 0.3s;
        }

        .nav-links {
            display: flex;
            gap: 3rem;
        }

        .nav-links a {
            font-size: 1rem;
            color: var(--text-secondary);
            position: relative;
            padding-bottom: 0.25rem;
            transition: color 0.3s;
        }

        .nav-links a::after {
            content: '';
            position: absolute;
            bottom: 0;
            right: 0;
            width: 0;
            height: 2px;
            background: var(--accent);
            transition: width 0.4s cubic-bezier(0.65, 0, 0.35, 1);
        }

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

        .nav-links a:hover::after {
            width: 100%;
        }

        .nav-links a.active {
            color: var(--accent);
        }

        .nav-links a.active::after {
            width: 100%;
        }

        .header-actions {
            display: flex;
            gap: 0.8rem;
            align-items: center;
        }

        .header-actions button,
        .header-actions a {
            background: var(--card-bg);
            border: 1px solid var(--glass-border);
            color: var(--text-secondary);
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
            backdrop-filter: blur(10px);
            cursor: pointer;
            font-size: 1.2rem;
        }

        .header-actions .btn-login,
        .header-actions .btn-register {
            width: auto;
            padding: 0 1.5rem;
            border-radius: var(--radius-full);
            font-size: 0.95rem;
        }

        .header-actions button:hover,
        .header-actions a:hover {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
            transform: translateY(-2px);
        }

        .header-actions .btn-login:hover,
        .header-actions .btn-register:hover {
            transform: translateY(-2px);
        }

        /* هيرو المقال */
        .article-hero {
            margin: 2rem 0 4rem;
            border-radius: var(--radius-xl);
            overflow: hidden;
            position: relative;
            min-height: 500px;
            display: flex;
            align-items: center;
            background-size: cover;
            background-position: center;
            box-shadow: var(--shadow-sm);
            transition: box-shadow 0.4s ease;
        }

        .article-hero:hover {
            box-shadow: var(--shadow-hover);
        }

        .article-hero::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.3) 0%, rgba(0,0,0,0.4) 100%);
            z-index: 1;
            mix-blend-mode: overlay;
        }

        .hero-content {
            padding: 4rem;
            color: white;
            max-width: 700px;
            position: relative;
            z-index: 2;
            text-shadow: 0 4px 30px rgba(0,0,0,0.5);
            backdrop-filter: blur(10px);
            background: rgba(0,0,0,0.1);
            border-radius: var(--radius-lg);
            margin: 3rem;
            border: 1px solid rgba(255,255,255,0.2);
        }

        .hero-content h1 {
            font-size: clamp(2.5rem, 6vw, 3.5rem);
            font-weight: 600;
            line-height: 1.2;
            margin-bottom: 0.5em;
            color: white;
        }

        .article-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 1.5rem;
            color: rgba(255,255,255,0.9);
            font-size: 1.1rem;
        }

        .article-meta i {
            color: var(--accent-light);
        }

        .reading-status {
            background: rgba(154, 131, 106, 0.16);
            border-radius: var(--radius-full);
            padding: 0.35rem 0.8rem;
            font-size: 0.92rem;
        }

        .category-badge {
            display: inline-block;
            background: var(--accent);
            color: white;
            padding: 0.3rem 1.5rem;
            border-radius: var(--radius-full);
            font-size: 0.9rem;
            margin-bottom: 1rem;
        }

        /* Breadcrumbs */
        .breadcrumbs {
            padding: 1.5rem 0;
            margin: 1rem 0 2rem;
            border-bottom: 1px solid var(--border-light);
        }

        .breadcrumbs ol {
            display: flex;
            align-items: center;
            list-style: none;
            flex-wrap: wrap;
            gap: 0.8rem;
        }

        .breadcrumbs li {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            color: var(--text-secondary);
        }

        .breadcrumbs a {
            color: var(--text-secondary);
            transition: color 0.3s;
        }

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

        .breadcrumbs .separator {
            color: var(--border-light);
            font-size: 0.8rem;
        }

        .breadcrumbs .current {
            color: var(--accent);
            font-weight: 600;
            background: rgba(193, 154, 107, 0.1);
            padding: 0.4rem 1rem;
            border-radius: var(--radius-full);
        }

        /* تخطيط المقال */
        .article-layout {
            display: grid;
            grid-template-columns: 1fr 340px;
            gap: 2.5rem;
            margin-top: 2rem;
        }

        .article-container {
            background: var(--card-bg);
            backdrop-filter: blur(15px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            padding: 2.5rem;
            box-shadow: var(--shadow-sm);
            transition: box-shadow 0.4s;
            will-change: box-shadow;
        }

        .article-container:hover {
            box-shadow: var(--shadow-hover);
        }

        /* ===== فهرس المقال (TOC) ===== */
        .article-toc {
            background: var(--card-bg);
            backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-sm);
            padding: 1.5rem 2rem;
            margin-bottom: 2rem;
            box-shadow: var(--shadow-sm);
        }

        .toc-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            user-select: none;
        }

        .toc-header h3 {
            margin: 0;
            font-size: 1.15rem;
            color: var(--accent);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .toc-collapse-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 0.9rem;
            transition: transform 0.3s;
            padding: 0.3rem;
        }

        .toc-collapse-btn.collapsed {
            transform: rotate(180deg);
        }

        .toc-list {
            list-style: none;
            padding: 0;
            margin: 1rem 0 0;
            counter-reset: toc-counter;
        }

        .toc-list li {
            counter-increment: toc-counter;
            margin-bottom: 0.3rem;
        }

        .toc-list li a {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 0.8rem;
            border-radius: 12px;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.95rem;
            transition: all 0.25s;
            border-right: 3px solid transparent;
        }

        .toc-list li a::before {
            content: counter(toc-counter);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 24px;
            height: 24px;
            border-radius: 50%;
            background: rgba(154, 131, 106, 0.1);
            color: var(--accent);
            font-size: 0.75rem;
            font-weight: 600;
        }

        .toc-list li a:hover,
        .toc-list li a.active {
            background: rgba(154, 131, 106, 0.08);
            color: var(--accent);
            border-right-color: var(--accent);
        }

        .toc-list li a.active::before {
            background: var(--accent);
            color: #fff;
        }

        .toc-list li.toc-h3 a {
            padding-right: 2.2rem;
            font-size: 0.88rem;
        }

        .toc-list.hidden {
            display: none;
        }

        /* ===== Word Count Badge ===== */
        .word-count-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            background: rgba(154, 131, 106, 0.1);
            color: var(--accent);
            padding: 0.25rem 0.7rem;
            border-radius: var(--radius-full);
            font-size: 0.8rem;
            font-weight: 500;
        }

        .article-body {
            font-size: 1.1rem;
            line-height: 1.8;
            color: var(--text-primary);
        }

        .article-body {
            overflow-wrap: anywhere;
        }

        .article-body img,
        .article-body video,
        .article-body iframe {
            max-width: 100%;
            height: auto;
            border-radius: var(--radius-md);
        }

        .article-body table {
            display: block;
            width: 100%;
            max-width: 100%;
            overflow-x: auto;
            white-space: nowrap;
        }

        .article-body h2 {
            color: var(--accent);
            margin: 2.5rem 0 1rem;
            font-size: 2rem;
            border-right: 4px solid var(--accent);
            padding-right: 1rem;
        }

        .article-body h3 {
            color: var(--text-primary);
            margin: 2rem 0 1rem;
            font-size: 1.6rem;
        }

        .article-body p {
            margin-bottom: 1.5rem;
        }

        .article-body blockquote {
            border-right: 4px solid var(--accent);
            padding: 1.5rem;
            margin: 2rem 0;
            background: rgba(154, 131, 106, 0.05);
            border-radius: 0 var(--radius-md) var(--radius-md) 0;
            font-style: italic;
            color: var(--text-secondary);
            position: relative;
        }

        .article-body img {
            max-width: 100%;
            height: auto;
            border-radius: var(--radius-md);
            margin: 2rem 0;
            box-shadow: var(--shadow-sm);
        }

        .author-trust-box {
            margin-top: 2rem;
            padding: 1.4rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-sm);
        }

        .author-trust-box h3 {
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
            color: var(--text-primary);
        }

        .author-trust-box p {
            margin-bottom: 0;
            color: var(--text-secondary);
            font-size: 0.95rem;
        }

        .inline-ad-slot {
            margin: 1.8rem 0;
            border: 1px dashed var(--accent-light);
            border-radius: var(--radius-sm);
            background: linear-gradient(135deg, rgba(154, 131, 106, 0.08), rgba(154, 131, 106, 0.02));
            padding: 1rem;
            text-align: center;
            color: var(--text-secondary);
        }

        .inline-ad-slot .ad-slot-label {
            margin-bottom: 0.5rem;
        }

        /* إجراءات المقال */
        .article-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 2rem 0;
            border-top: 1px solid var(--border-light);
            border-bottom: 1px solid var(--border-light);
            margin: 2.5rem 0;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .social-share {
            display: flex;
            gap: 1rem;
        }

        .share-btn {
            width: 45px;
            height: 45px;
            background: var(--card-bg);
            border: 1px solid var(--glass-border);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
            backdrop-filter: blur(10px);
        }

        .share-btn:hover {
            background: var(--accent);
            color: white;
            transform: translateY(-3px);
        }

        .user-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.6rem;
            align-items: center;
        }

        .action-toggle {
            border: 1px solid var(--glass-border);
            background: var(--card-bg);
            color: var(--text-secondary);
            border-radius: var(--radius-full);
            padding: 0.45rem 0.9rem;
            font-size: 0.85rem;
            cursor: pointer;
            transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
        }

        .action-toggle:hover,
        .action-toggle.active {
            background: var(--accent);
            border-color: var(--accent);
            color: white;
        }

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

        .tts-speed {
            border: 1px solid var(--glass-border);
            background: var(--card-bg);
            color: var(--text-primary);
            border-radius: var(--radius-full);
            padding: 0.35rem 0.7rem;
            font-size: 0.85rem;
        }

        /* التعليقات */
        .comments-section {
            margin-top: 2rem;
            border-top: 1px solid var(--border-light);
            padding-top: 2rem;
        }

        .feedback-card {
            margin-top: 2rem;
            padding: 1.4rem;
            border: 1px solid var(--border-light);
            border-radius: var(--radius-sm);
            background: var(--bg-secondary);
        }

        .feedback-note {
            color: var(--text-secondary);
            margin-bottom: 0.8rem;
        }

        .feedback-buttons {
            display: flex;
            gap: 0.6rem;
            flex-wrap: wrap;
            margin-bottom: 0.8rem;
        }

        .feedback-btn {
            border: 1px solid var(--glass-border);
            background: var(--card-bg);
            color: var(--text-secondary);
            border-radius: var(--radius-full);
            padding: 0.45rem 0.9rem;
            cursor: pointer;
        }

        .feedback-btn.active {
            background: var(--accent);
            border-color: var(--accent);
            color: #fff;
        }

        .feedback-form textarea {
            width: 100%;
            min-height: 90px;
            border: 1px solid var(--border-light);
            border-radius: 1rem;
            padding: 0.8rem 1rem;
            margin-bottom: 0.8rem;
            background: var(--bg-primary);
            color: var(--text-primary);
            resize: vertical;
        }

        .feedback-stats {
            margin-top: 0.6rem;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .comment-form textarea {
            width: 100%;
            min-height: 120px;
            border-radius: var(--radius-md);
            border: 1px solid var(--glass-border);
            background: var(--bg-secondary);
            color: var(--text-primary);
            padding: 1rem;
            resize: vertical;
            margin-bottom: 0.8rem;
            font-family: inherit;
        }

        .comment-form textarea:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        .comment-item {
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            padding: 1rem;
            margin-bottom: 0.8rem;
        }

        .comment-meta {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.5rem;
            color: var(--text-muted);
            font-size: 0.85rem;
        }

        .comment-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.8rem;
            flex-wrap: wrap;
            margin-bottom: 0.8rem;
        }

        .comment-sort-form {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        .comment-sort-form select {
            border: 1px solid var(--border-light);
            background: var(--bg-secondary);
            color: var(--text-primary);
            border-radius: var(--radius-full);
            padding: 0.35rem 0.8rem;
        }

        .pinned-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.75rem;
            color: #fff;
            background: var(--accent);
            border-radius: var(--radius-full);
            padding: 0.25rem 0.65rem;
        }

        .comment-replies {
            margin-top: 0.8rem;
            padding-right: 1rem;
            border-right: 2px solid var(--border-light);
        }

        .reply-btn {
            border: none;
            background: transparent;
            color: var(--accent);
            cursor: pointer;
            font-size: 0.85rem;
            padding: 0;
        }

        .comment-actions {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            margin-top: 0.5rem;
        }

        .comment-like-btn {
            border: none;
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 0.85rem;
            padding: 0;
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
        }

        .comment-like-btn.active {
            color: var(--accent);
            font-weight: 600;
        }

        /* مقالات مشابهة */
        .related-articles {
            margin-top: 3rem;
        }

        .faq-section {
            margin-top: 2.2rem;
        }

        .faq-list {
            display: grid;
            gap: 0.8rem;
        }

        .faq-item {
            border: 1px solid var(--border-light);
            border-radius: 1rem;
            background: var(--bg-secondary);
            padding: 0.8rem 1rem;
        }

        .faq-item summary {
            cursor: pointer;
            font-weight: 600;
            color: var(--text-primary);
        }

        .faq-answer {
            margin-top: 0.6rem;
            color: var(--text-secondary);
            line-height: 1.7;
        }

        .section-title {
            font-size: 2rem;
            color: var(--accent);
            margin-bottom: 1.5rem;
        }

        .related-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 2rem;
        }

        .related-card {
            background: var(--card-bg);
            backdrop-filter: blur(15px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
            box-shadow: var(--shadow-sm);
            contain: layout paint;
        }

        .related-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-hover);
            border-color: rgba(154, 131, 106, 0.3);
        }

        .related-thumb {
            position: relative;
            height: 180px;
            overflow: hidden;
        }

        .related-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        .related-card:hover .related-thumb img {
            transform: scale(1.04);
        }

        .related-badge {
            position: absolute;
            top: 1rem;
            right: 1rem;
            background: var(--accent);
            color: white;
            padding: 0.2rem 1rem;
            border-radius: var(--radius-full);
            font-size: 0.8rem;
            z-index: 2;
        }

        .related-content {
            padding: 1.5rem;
        }

        .related-content h3 {
            font-size: 1.2rem;
            margin-bottom: 0.5rem;
        }

        .related-meta {
            display: flex;
            gap: 1rem;
            font-size: 0.85rem;
            color: var(--text-muted);
        }

        /* ===== الشريط الجانبي ===== */
        .article-sidebar {
            position: sticky;
            top: 120px;
            align-self: start;
        }

        .sidebar-widget {
            background: var(--card-bg);
            backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            padding: 1.8rem;
            margin-bottom: 2rem;
            box-shadow: var(--shadow-sm);
            transition: box-shadow 0.35s ease;
        }

        .sidebar-widget:hover {
            box-shadow: var(--shadow-hover);
        }

        .ad-slot {
            border: 1px dashed var(--accent-light);
            border-radius: var(--radius-sm);
            background: linear-gradient(135deg, rgba(154, 131, 106, 0.08), rgba(154, 131, 106, 0.03));
            padding: 1rem;
            text-align: center;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .ad-slot-label {
            display: inline-block;
            margin-bottom: 0.4rem;
            padding: 0.2rem 0.6rem;
            border-radius: var(--radius-full);
            background: rgba(154, 131, 106, 0.16);
            color: var(--accent);
            font-size: 0.75rem;
            font-weight: 700;
            letter-spacing: 0.03em;
        }

        .widget-title {
            font-size: 1.4rem;
            color: var(--accent);
            margin-bottom: 1.2rem;
            font-family: 'Amiri', serif;
            position: relative;
            padding-bottom: 0.5rem;
        }

        .widget-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            right: 0;
            width: 50px;
            height: 2px;
            background: var(--accent);
        }

        .popular-articles {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .popular-item {
            display: flex;
            gap: 1rem;
            padding: 0.8rem;
            border-radius: var(--radius-md);
            transition: background-color 0.25s ease, border-color 0.25s ease;
            border: 1px solid transparent;
            background: var(--bg-secondary);
            text-decoration: none;
            color: inherit;
        }

        .popular-item:hover {
            background: rgba(154, 131, 106, 0.05);
            border-color: var(--border-light);
        }

        .popular-thumb {
            width: 70px;
            height: 70px;
            border-radius: var(--radius-sm);
            overflow: hidden;
            flex-shrink: 0;
        }

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

        .popular-content h4 {
            font-size: 0.95rem;
            margin-bottom: 0.3rem;
            font-weight: 600;
        }

        .popular-meta {
            display: flex;
            gap: 0.8rem;
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .categories-list {
            display: flex;
            flex-direction: column;
            gap: 0.8rem;
        }

        .category-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.8rem 1rem;
            background: var(--bg-secondary);
            border-radius: var(--radius-md);
            transition: background-color 0.25s ease, border-color 0.25s ease;
            border: 1px solid transparent;
        }

        .category-item:hover {
            background: rgba(154, 131, 106, 0.1);
            border-color: var(--accent-light);
        }

        .category-name {
            font-weight: 500;
        }

        .category-count {
            background: var(--accent);
            color: white;
            padding: 0.2rem 0.8rem;
            border-radius: var(--radius-full);
            font-size: 0.75rem;
        }

        .newsletter-widget .newsletter-form {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .newsletter-widget input {
            width: 100%;
            padding: 1rem 1.5rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-full);
            color: var(--text-primary);
            font-family: inherit;
            transition: border-color 0.25s ease, box-shadow 0.25s ease;
        }

        .newsletter-widget input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        /* ===== Scroll Progress ===== */
        .scroll-progress {
            position: fixed;
            top: 0;
            right: 0;
            width: 0%;
            height: 3px;
            background: linear-gradient(to left, var(--accent), var(--accent-light));
            z-index: 1001;
            transition: width 0.1s ease;
        }

        /* ===== Loading Screen ===== */
        .loading-screen {
            position: fixed;
            inset: 0;
            background: var(--bg-primary);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            transition: opacity 0.5s ease, visibility 0.5s ease;
        }

        .loading-screen.hidden {
            opacity: 0;
            visibility: hidden;
        }

        .loader {
            width: 50px;
            height: 50px;
            border: 3px solid var(--border-light);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 1rem;
        }

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

        /* ===== Back to Top ===== */
        .back-to-top {
            position: fixed;
            bottom: 30px;
            left: 30px;
            width: 50px;
            height: 50px;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            opacity: 0;
            visibility: hidden;
            transform: translateY(20px);
            transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
            z-index: 999;
            box-shadow: 0 5px 20px var(--accent-glow);
        }

        .back-to-top.visible {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .back-to-top:hover {
            background: var(--accent-light);
            transform: translateY(-3px);
            box-shadow: 0 8px 30px var(--accent-glow);
        }

        /* ===== Footer متطور ===== */
        .footer {
            margin-top: 5rem;
            padding: 4rem 0 2rem;
            border-top: 1px solid var(--border-light);
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 2.5rem;
        }

        .footer-col h4 {
            font-size: 1.5rem;
            margin-bottom: 1.2rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .footer-col p, .footer-col a {
            color: var(--text-muted);
            line-height: 2;
            display: block;
            transition: color 0.25s ease;
        }

        .footer-col a:hover {
            color: var(--accent);
        }

        .social-links {
            display: flex;
            gap: 1.2rem;
            margin-top: 1.5rem;
        }

        .social-links a {
            background: var(--card-bg);
            border: 1px solid var(--glass-border);
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.3rem;
            color: var(--text-muted);
            transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
        }

        .social-links a:hover {
            background: var(--accent);
            color: white;
            transform: translateY(-3px);
            border-color: var(--accent);
        }

        .copyright {
            grid-column: 1 / -1;
            text-align: center;
            padding-top: 2rem;
            margin-top: 2rem;
            border-top: 1px solid var(--border-light);
            color: var(--text-muted);
            font-size: 0.95rem;
        }

        /* ===== تحسينات للشاشات الصغيرة ===== */
        @media (max-width: 1200px) {
            .article-layout {
                grid-template-columns: 1fr;
            }
            .article-sidebar {
                position: static;
            }
        }

        @media (max-width: 992px) {
            .header {
                flex-wrap: wrap;
                height: auto;
                padding: 0.8rem 1rem;
                border-radius: 50px;
            }
            .nav-links {
                order: 3;
                width: 100%;
                justify-content: center;
                margin-top: 1rem;
                gap: 1.2rem;
            }
            .hero-content {
                padding: 2rem;
                margin: 1.5rem;
            }
        }

        @media (max-width: 768px) {
            .container { padding: 0 1rem; }
            .article-hero {
                min-height: 400px;
            }
            .hero-content h1 {
                font-size: 2rem;
            }
            .article-meta {
                font-size: 0.9rem;
                gap: 1rem;
            }
            .article-container {
                padding: 1.5rem;
            }
            .related-grid {
                grid-template-columns: 1fr;
            }
            .footer {
                grid-template-columns: 1fr;
                text-align: center;
            }
            .social-links {
                justify-content: center;
            }
        }

        .article-sidebar,
        .related-articles,
        .comments-section,
        .footer {
            content-visibility: auto;
            contain-intrinsic-size: 1px 600px;
        }

        @media (max-width: 1024px), (pointer: coarse) {
            .related-card:hover {
                transform: none;
            }
            .related-card:hover .related-thumb img {
                transform: none;
            }
            .share-btn:hover {
                transform: none;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            * {
                animation-duration: 0.01ms !important;
                transition-duration: 0.01ms !important;
            }
        }
    

