﻿/* ===== متغيرات أساسية – ألوان نقية مع تأثيرات 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;
        }

        /* ===== هيدر زجاجي فائق مع تأثير سائل ===== */
        .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%;
        }

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

        .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 button:hover,
        .header-actions a:hover {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
            transform: translateY(-2px);
        }

        /* ===== شريط البحث في الهيدر (مخصص) ===== */
        .header-search {
            position: relative;
            max-width: 400px;
            width: 100%;
            margin: 0 20px;
        }

        .header-search input {
            width: 100%;
            padding: 0.8rem 1rem 0.8rem 3rem;
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-full);
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.95rem;
            transition: all 0.3s;
        }

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

        .header-search button {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: var(--accent);
            border: none;
            color: white;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s;
        }

        .header-search button:hover {
            background: var(--accent-light);
            transform: translateY(-50%) scale(1.1);
        }

        /* ===== زر القائمة المتنقلة ===== */
        .mobile-menu-btn {
            display: none;
            background: var(--card-bg);
            border: 1px solid var(--glass-border);
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.8rem;
            border-radius: 50%;
            transition: all 0.3s;
        }

        .mobile-menu-btn:hover {
            background: var(--accent);
            color: white;
        }

        /* ===== نتائج البحث – هيدر الصفحة ===== */
        .search-header {
            text-align: center;
            margin: 3rem 0 2rem;
        }

        .search-header h1 {
            font-size: 2.5rem;
            color: var(--accent);
            margin-bottom: 1rem;
        }

        .search-header .query-text {
            color: var(--text-primary);
            font-weight: 600;
            background: rgba(154, 131, 106, 0.1);
            padding: 0.2rem 1rem;
            border-radius: var(--radius-full);
            display: inline-block;
        }

        .search-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
            background: var(--card-bg);
            backdrop-filter: blur(15px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            padding: 1.5rem 2rem;
            margin: 2rem 0;
        }

        .results-count {
            color: var(--text-secondary);
            font-size: 1.1rem;
        }

        .results-count .count {
            color: var(--accent);
            font-weight: 600;
            font-size: 1.3rem;
        }

        .search-actions {
            display: flex;
            gap: 1rem;
        }

        .filter-btn, .sort-btn {
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            border: 1px solid var(--glass-border);
            color: var(--text-secondary);
            padding: 0.8rem 1.5rem;
            border-radius: var(--radius-full);
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

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

        /* ===== لوحة التحكم (فلاتر وترتيب) ===== */
        .search-controls {
            background: var(--card-bg);
            backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            padding: 2rem;
            margin-bottom: 2rem;
            display: none;
            box-shadow: var(--shadow-sm);
        }

        .search-controls.active {
            display: block;
        }

        .filters-panel, .sort-panel {
            margin-bottom: 1.5rem;
        }

        .filters-panel h4, .sort-panel h4 {
            font-size: 1.2rem;
            color: var(--accent);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .filter-options, .sort-options {
            display: flex;
            flex-wrap: wrap;
            gap: 1.5rem;
        }

        .filter-option, .sort-option {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
            color: var(--text-secondary);
            transition: color 0.3s;
        }

        .filter-option:hover, .sort-option:hover {
            color: var(--accent);
        }

        .filter-option input, .sort-option input {
            width: 18px;
            height: 18px;
            accent-color: var(--accent);
        }

        /* ===== أقسام النتائج ===== */
        .results-section {
            margin-bottom: 4rem;
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            border-bottom: 1px solid var(--border-light);
            padding-bottom: 0.8rem;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .section-title {
            font-size: 2rem;
            color: var(--accent);
            display: flex;
            align-items: center;
            gap: 0.8rem;
        }

        .results-badge {
            background: rgba(154, 131, 106, 0.1);
            color: var(--accent);
            padding: 0.2rem 1rem;
            border-radius: var(--radius-full);
            font-size: 0.9rem;
        }

        .view-all-link {
            color: var(--accent);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s;
        }

        .view-all-link:hover {
            gap: 0.8rem;
            color: var(--text-primary);
        }

        /* ===== شبكات البطاقات ===== */
        .articles-grid, .categories-grid, .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 2rem;
        }

        /* ===== بطاقة مقال ===== */
        .article-card, .category-card, .gallery-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;
        }

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

        .card-content {
            padding: 2rem;
        }

        .card-meta {
            display: flex;
            gap: 1rem;
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 0.8rem;
            flex-wrap: wrap;
        }

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

        .card-title {
            font-size: 1.4rem;
            margin-bottom: 0.5rem;
            font-weight: 600;
        }

        .card-title a {
            color: var(--text-primary);
            transition: color 0.3s;
        }

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

        .card-excerpt {
            font-size: 0.95rem;
            color: var(--text-secondary);
            margin-bottom: 1.5rem;
            line-height: 1.7;
        }

        .read-more-btn, .explore-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background: var(--accent);
            color: white;
            padding: 0.6rem 1.5rem;
            border-radius: var(--radius-full);
            font-weight: 500;
            transition: all 0.3s;
        }

        .read-more-btn:hover, .explore-btn:hover {
            background: var(--accent-light);
            gap: 0.8rem;
        }

        /* ===== بطاقة قسم ===== */
        .card-icon {
            width: 60px;
            height: 60px;
            background: rgba(154, 131, 106, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 1.5rem;
            transition: all 0.3s;
        }

        .category-card:hover .card-icon {
            background: var(--accent);
        }

        .card-icon i {
            font-size: 1.8rem;
            color: var(--accent);
            transition: all 0.3s;
        }

        .category-card:hover .card-icon i {
            color: white;
        }

        .card-description {
            color: var(--text-secondary);
            margin-bottom: 1rem;
        }

        .category-stats {
            margin-bottom: 1.5rem;
        }

        .stat {
            background: rgba(154, 131, 106, 0.1);
            color: var(--accent);
            padding: 0.3rem 1rem;
            border-radius: var(--radius-full);
            font-size: 0.85rem;
        }

        /* ===== حالة عدم وجود نتائج ===== */
        .no-results {
            text-align: center;
            padding: 4rem 2rem;
            background: var(--card-bg);
            backdrop-filter: blur(15px);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-light);
            margin: 2rem 0;
        }

        .no-results-icon {
            font-size: 4rem;
            color: var(--accent);
            margin-bottom: 1.5rem;
            opacity: 0.7;
        }

        .no-results h3 {
            font-size: 2rem;
            margin-bottom: 1rem;
            color: var(--text-primary);
        }

        .no-results p {
            color: var(--text-secondary);
            margin-bottom: 2rem;
        }

        .search-again-form {
            display: flex;
            max-width: 500px;
            margin: 0 auto;
            gap: 1rem;
            flex-wrap: wrap;
            justify-content: center;
        }

        .search-again-form input {
            flex: 1 1 250px;
            padding: 1rem 1.5rem;
            background: var(--tertiary-bg);
            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;
        }

        .search-again-form input:focus {
            outline: none;
            border-color: var(--accent);
        }

        .search-again-form button {
            padding: 1rem 2rem;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: var(--radius-full);
            cursor: pointer;
            transition: background-color 0.25s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .search-again-form button:hover {
            background: var(--accent-light);
        }

        /* ===== 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: 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;
            }
            .header-search {
                margin: 0;
                max-width: 100%;
            }
            .mobile-menu-btn {
                display: block;
            }
            .search-meta {
                flex-direction: column;
                text-align: center;
            }
            .filter-options, .sort-options {
                flex-direction: column;
                gap: 0.8rem;
            }
        }

        @media (max-width: 768px) {
            .container { padding: 0 1rem; }
            .search-header h1 {
                font-size: 2rem;
            }
            .articles-grid, .categories-grid, .gallery-grid {
                grid-template-columns: 1fr;
            }
            .footer {
                grid-template-columns: 1fr;
                text-align: center;
            }
            .social-links {
                justify-content: center;
            }
        }

        .footer {
            content-visibility: auto;
            contain-intrinsic-size: 1px 600px;
        }

        @media (max-width: 1024px), (pointer: coarse) {
            .article-card:hover, .category-card:hover, .gallery-card:hover {
                transform: none;
            }
        }

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

