/* ==============================
   المتغيرات الأساسية (CSS Variables)
   ============================== */
:root {
    /* ألوان أساسية */
    --primary-blue: #002B5B;
    --light-blue: #1A5F9A;
    --accent-blue: #2B7DC3;
    --bg-color: #F5F6FA;
    --white: #FFFFFF;
    --gray-text: #666666;
    --light-gray: #E8E8E8;
    --success: #0D8C4B;
    --warning: #FF6B35;
    
    /* ألوان التمييز بين الأقسام */
    --downloads-color: #2B7DC3;
    --views-color: #059669;
    --downloads-light: #E3F2FD;
    --views-light: #D1FAE5;
    
    /* ألوان شارات الترتيب */
    --rank-1-color: linear-gradient(135deg, #FFD700 0%, #FFC107 25%, #FFA000 50%, #FF8F00 75%, #FF6F00 100%);
    --rank-2-color: linear-gradient(135deg, #E0E0E0 0%, #C0C0C0 25%, #A0A0A0 50%, #808080 75%, #606060 100%);
    --rank-3-color: linear-gradient(135deg, #CD7F32 0%, #B87333 25%, #A0522D 50%, #8B4513 75%, #654321 100%);
    --rank-other-color: linear-gradient(135deg, var(--accent-blue) 0%, var(--light-blue) 25%, #2B7DC3 50%, #256D85 75%, var(--primary-blue) 100%);
    
    /* ألوان الأزرار حسب نوع المحتوى */
    --btn-book: linear-gradient(135deg, #002B5B, #1A5F9A);
    --btn-book-hover: linear-gradient(135deg, #0051ad, #2175bf);
    --btn-summary: linear-gradient(135deg, #059669, #047857);
    --btn-summary-hover: linear-gradient(135deg, #047857, #059669);
    --btn-exam: linear-gradient(135deg, #9a3412, #ea580c);
    --btn-exam-hover: linear-gradient(135deg, #9a3412, #ea580c);
    
    /* ألوان البانر المتحرك */
    --banner-gold: #FFD700;
    --banner-orange: #FFA500;
    --banner-dark-blue: #0a1e3c;
    --banner-light-blue: #1e3a6b;
    --banner-red: #ef4444;
    --banner-green: #4ade80;
    
    /* متغيرات البطاقة - محسنة */
    --book-w: clamp(190px, 23vw, 250px);
    --book-h: calc(var(--book-w) * 1.5);
    
    /* تأثيرات عامة */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
    --border-radius: 18px;
    --transition: all 0.3s ease;
}

/* ==============================
   إعادة تعيين الأنماط
   ============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-color);
    color: var(--gray-text);
    font-family: 'Tajawal', 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==============================
   الأدوات المساعدة
   ============================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==============================
   قسم الهيرو (Hero Section)
   ============================== */
.home-hero {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 280px;
    overflow: hidden;
    background-color: var(--primary-blue);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0 40px 0;
    content-visibility: auto;
}

.hero-bg-single {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg-single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.overlay-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    opacity: 0.85;
    z-index: 2;
    mix-blend-mode: multiply;
}

.home-hero .overlay-gradient {
    z-index: 2;
    opacity: 0.75;
}

.home-hero .hero-content,
.home-hero .hero-search {
    z-index: 3;
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 20px;
    margin-bottom: 20px;
}

.hero-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: #fff;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.hero-icon:hover {
    transform: scale(1.05);
}

.hero-title {
    font-size: 1.7rem;
    margin-bottom: 10px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 15px;
    line-height: 1.6;
    max-width: 700px;
}

/* الإحصائيات */
.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.4rem 0;
    white-space: nowrap;
}

.hero-stats::-webkit-scrollbar {
    display: none;
}

.stat-item {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    padding: 0.4rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: var(--transition);
    flex-shrink: 0;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 0.9rem;
    font-weight: 800;
    color: #f59e0b;
    display: block;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    margin-top: 2px;
}

/* شريط البحث */
.hero-search {
    max-width: 600px;
    margin: 1rem auto 0;
    position: relative;
    z-index: 10;
    animation: fadeInUp 1.5s ease 0.6s both;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 50px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    padding: 6px;
    transition: var(--transition);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 2px 10px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease forwards 0.2s;
    opacity: 0;
}

.search-input-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%);
    border-radius: 50px;
    z-index: -1;
}

.search-input-wrapper:focus-within {
    transform: translateY(-5px);
    box-shadow:
        0 20px 50px rgba(43, 125, 195, 0.25),
        0 3px 15px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.2));
}

.search-icon {
    padding: 0 18px;
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.search-icon::after {
    content: '';
    position: absolute;
    width: 1px;
    height: 60%;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.3), transparent);
    left: 0;
    top: 20%;
}

.hero-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 15px;
    font-size: 1rem;
    color: white;
    background: transparent;
    height: 100%;
    z-index: 20;
    width: 100%;
    caret-color: #f59e0b;
    transition: all 0.3s ease;
    position: relative;
}

.hero-search-input::placeholder {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.hero-search-input:focus::placeholder {
    opacity: 0.5;
    transform: translateX(5px);
}

.hero-search-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    padding-left: 20px;
}

/* زر الفلاتر الرئيسي */
.filter-btn-main {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.95),
        rgba(255, 255, 255, 0.85));
    color: var(--primary-blue);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 130px;
    height: 50px;
    margin-left: 8px;
    box-shadow:
        0 8px 25px rgba(0, 43, 91, 0.3),
        0 2px 8px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    z-index: 1;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.filter-btn-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent);
    transition: left 0.7s ease;
    z-index: -1;
}

.filter-btn-main:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 15px 35px rgba(0, 43, 91, 0.4),
        0 3px 12px rgba(255, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 1),
        rgba(255, 255, 255, 0.95));
    border-color: rgba(255, 255, 255, 0.6);
}

.filter-btn-main:hover::before {
    left: 100%;
}

.filter-btn-main:active {
    transform: translateY(-1px);
    transition: all 0.1s ease;
}

.filter-btn-main.pulse {
    animation: pulse 2s infinite;
}

/* ==============================
   المساحات الإعلانية
   ============================== */
.ad-container-main,
.ad-container-mid,
.ad-container-bottom {
    max-width: 100%;
    margin: 0 auto;
    clear: both;
    position: relative;
}

.ad-label {
    font-size: 10px;
    color: #ccc;
    text-align: center;
    margin-bottom: 2px;
    font-family: 'Tajawal', sans-serif;
    letter-spacing: 1px;
}

.ad-header-bottom {
    min-height: 100px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.5));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(0, 43, 91, 0.1);
    margin: 8px auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.ad-header-bottom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.ad-mid-section {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--light-gray);
    box-shadow: var(--shadow);
    margin: 15px 0;
    padding: 15px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.ad-footer-top {
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 15px;
    padding: 25px 20px;
    border: 2px dashed var(--primary-blue);
    margin: 30px auto 15px;
    box-shadow: var(--shadow);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: var(--transition);
}

.ad-footer-top:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-lg);
}

ins.adsbygoogle {
    background: transparent !important;
    display: block !important;
    max-width: 100%;
}

.cta-wrapper-dual {
    display: flex;
    gap: 11px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 15px;
    width: 100%;
}
.btn-results .button-front { background: linear-gradient(135deg, #20a985, #059669) !important; }
.btn-results .button-back { background: linear-gradient(135deg, #047857, #064e3b) !important; }

/* ==============================
   أيقونة القسم (Section Icon)
   ============================== */
.section-header {
    text-align: center;
    margin-bottom: 1rem;
}

.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: linear-gradient(145deg, #1E293B, #0F172A);
    border-radius: 50%;
    margin-bottom: 1rem;
    color: #3B82F6;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(59, 130, 246, 0.4),
        0 0 12px rgba(59, 130, 246, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 6px rgba(59, 130, 246, 0.15);
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    cursor: pointer;
}

.section-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%,
        rgba(59, 130, 246, 0.1) 0%,
        transparent 50%);
    border-radius: 50%;
    animation: pulse-bg 4s ease-in-out infinite;
}

.section-icon::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 2px dashed rgba(59, 130, 246, 0.6);
    border-radius: 50%;
    z-index: -1;
    animation: rotate-dashed 25s linear infinite;
    filter: drop-shadow(0 0 3px rgba(59, 130, 246, 0.3));
}

.section-icon .inner-circle {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1.5px dotted rgba(139, 92, 246, 0.5);
    border-radius: 50%;
    z-index: 1;
    animation: rotate-dotted 18s linear infinite reverse;
    filter: drop-shadow(0 0 2px rgba(139, 92, 246, 0.2));
}

.section-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    z-index: 2;
    position: relative;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.section-icon svg path {
    stroke-dasharray: 4, 3;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    animation: dash-flow 6s linear infinite;
}

.section-icon:hover {
    color: white;
    background: linear-gradient(145deg, #3B82F6, #2563EB, #1D4ED8);
    transform: translateY(-3px) scale(1.08) rotate(5deg);
    box-shadow:
        0 8px 25px rgba(59, 130, 246, 0.4),
        0 0 0 2px rgba(59, 130, 246, 0.6),
        0 0 25px rgba(59, 130, 246, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 0 10px rgba(255, 255, 255, 0.15);
}

.section-subtitle {
    color: #6B7280;
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ==============================
   عناوين الأقسام
   ============================== */
.section-title1 {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    color: var(--primary-blue);
    padding-bottom: 20px;
}

.section-title1::after,
.section-title::after,
.series-section-title::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 50%;
    transform: translateX(50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--light-blue), var(--primary-blue), transparent);
    border-radius: 2px;
}

.section-title1::before,
.section-title::before,
.series-section-title::before {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 50%;
    transform: translateX(50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    z-index: 2;
}

.series-section-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    color: var(--primary-blue);
    padding-bottom: 20px;
}

/* ==============================
   البطاقات الرئيسية (Category Cards)
   ============================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px 12px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--light-gray);
    box-shadow: var(--shadow);
    transition: var(--transition);
    min-height: 140px;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    opacity: 0.8;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-card:nth-child(1)::before {
    background: linear-gradient(135deg, #002B5B, #256D85);
}

.category-card:nth-child(2)::before {
    background: linear-gradient(135deg, #0D8C4B, #0DA75C);
}

.category-card:nth-child(3)::before {
    background: linear-gradient(135deg, #FF6B35, #FF8B5C);
}

.category-card:nth-child(4)::before {
    background: linear-gradient(135deg, #8B3A8B, #9F4D9F);
}

.category-icon {
    width: 55px;
    height: 55px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: var(--bg-color);
    color: var(--primary-blue);
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.category-card:nth-child(1) .category-icon {
    color: #002B5B;
    background: linear-gradient(135deg, #E6F0FF, #D1E3FF);
}

.category-card:nth-child(2) .category-icon {
    color: #0D8C4B;
    background: linear-gradient(135deg, #E6F7EF, #D1F0E2);
}

.category-card:nth-child(3) .category-icon {
    color: #FF6B35;
    background: linear-gradient(135deg, #FFF2E6, #FFE8D1);
}

.category-card:nth-child(4) .category-icon {
    color: #8B3A8B;
    background: linear-gradient(135deg, #F5E6F5, #F0D1F0);
}

.category-card:hover .category-icon {
    transform: scale(1.08);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.category-title {
    font-size: 0.95rem;
    margin: 0;
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1.3;
    position: relative;
    z-index: 2;
}

.category-desc {
    margin: 0;
    color: var(--gray-text);
    font-size: 0.75rem;
    line-height: 1.3;
    position: relative;
    z-index: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f59e0b;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    z-index: 3;
}

/* ==============================
   المسار التعليمي
   ============================== */
.stage-switcher {
    background: white;
    border-radius: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #E5E7EB;
    position: sticky;
    top: 0.5rem;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.stage-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
}

.stage-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0.75rem 0.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.25rem;
    min-height: 4.5rem;
}

.stage-tab:hover {
    background: #F3F4F6;
}

.stage-tab.active {
    background: white;
    color: #3B82F6;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #E5E7EB;
}

.tab-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.tab-text {
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stages-wrapper {
    position: relative;
    min-height: auto;
}

.stage-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.stage-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.stage-info {
    margin-bottom: 1.5rem;
    text-align: center;
}

.stage-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.stage-description {
    color: #6B7280;
    font-size: 1rem;
    max-width: 100%;
    margin: 0 auto;
    line-height: 1.6;
}

.grades-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 0;
    padding-bottom: 2rem;
}

.grade-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    padding: 1.25rem 0.75rem;
    transition: all 0.2s ease;
    position: relative;
    text-align: center;
    min-height: 150px;
}

.grade-card:hover {
    border-color: #3B82F6;
    transform: translateY(-4px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.grade-number {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    color: white;
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg,
        var(--grade-color),
        color-mix(in srgb, var(--grade-color) 80%, white 20%));
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.grade-name {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.grade-subjects {
    font-size: 0.875rem;
    color: #6B7280;
    margin: 0;
    line-height: 1.4;
}

.special-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.no-content-wrapper {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    background: white;
    border-radius: 1rem;
    border: 2px dashed #D1D5DB;
}

.no-content {
    color: #6B7280;
    font-size: 1.125rem;
    margin: 0;
    font-weight: 500;
}

/* ==============================
   أقسام المحتوى الرئيسية
   ============================== */
.main-content {
    background: var(--bg-color);
    padding: 30px 15px;
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    color: var(--primary-blue);
}

.category-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 30px;
}

.category-section {
    background: transparent;
    border-radius: var(--border-radius);
    padding: 0;
    position: relative;
}

.category-section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: 10%;
    left: 10%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--light-gray) 20%,
        #cbd5e1 50%,
        var(--light-gray) 80%,
        transparent 100%);
}

.category-section-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    color: var(--primary-blue);
    padding-bottom: 15px;
}

.category-section-title::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--light-blue), var(--primary-blue), transparent);
    border-radius: 2px;
}

.category-section-title::before {
    content: '';
    position: absolute;
    bottom: 6px;
    right: 50%;
    transform: translateX(50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    z-index: 2;
}

/* ==============================
   شبكة البطاقات
   ============================== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 15px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 640px) {
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 22px;
    }
}

@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 25px;
    }
}

@media (min-width: 1200px) {
    .content-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 25px;
    }
}

/* ==============================
   بطاقات المستكشف (Explorer Cards) - مطابقة لصفحة الملخصات
   ============================== */
.explorer-card {
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0 auto;
    position: relative;
    border: none;
    box-shadow: none;
    padding: 0;
}

.explorer-card:hover {
    transform: translateY(-15px);
    z-index: 10;
}

/* رابط البطاقة */
.book-link-wrapper {
    text-decoration: none;
    display: block;
    color: inherit;
    width: 100%;
}

.book-card {
    perspective: 1800px;
    margin-bottom: 10px;
    width: 100%;
    max-width: min(100%, 250px);
    margin-left: auto;
    margin-right: auto;
}

.book-3d {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.5;
    transform-style: preserve-3d;
}

/* صفحات الكتاب - محسنة للـ RTL */
.book-pages {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to right, 
        #f5f5f5 0px 2px, 
        #eeeeee 2px 4px,
        #e8e8e8 4px 6px);
    border: 1px solid #b0bec5;
    border-radius: 15px 3px 3px 15px;
    box-shadow: inset 4px 0 8px rgba(0, 0, 0, 0.1), 0 6px 12px rgba(0, 0, 0, 0.15);
    z-index: 1;
    transform: translateZ(-2px);
}

/* غلاف الكتاب - محسن للـ RTL */
.book-cover {
    position: absolute;
    inset: 0;
    border-radius: 15px 3px 3px 15px;
    transform-origin: right center;
    transform: rotateY(0deg) translateZ(2px);
    transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.1), box-shadow 0.6s ease;
    overflow: hidden;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25), 3px 3px 8px rgba(0, 0, 0, 0.15);
}

/* تأثير لمعان خفيف */
.book-cover::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.03) 40%,
        rgba(255, 255, 255, 0) 80%);
    z-index: 4;
    pointer-events: none;
    opacity: 0.25;
    border-radius: 15px 3px 3px 15px;
}

/* حاوية الصورة */
.cover-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 15px 3px 3px 15px;
    overflow: hidden;
}

.cover-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.book-link-wrapper:hover .cover-container img {
    transform: scale(1.05);
}

/* ===== الحل الذكي: محتوى الغلاف ===== */
.cover-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding: 12px 6px;
    color: white;
    z-index: 3;
    pointer-events: none;
    /* تدرج أخف بكثير - يسمح برؤية الغلاف */
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.35) 25%,
        rgba(0, 0, 0, 0.1) 50%,
        transparent 70%);
    border-radius: 15px 3px 3px 15px;
}

/* ===== العنوان - أنيق وبسيط ===== */
.book-title {
    font-size: clamp(0.8rem, 3.2vw, 0.95rem);
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 98%;
    color: #ffffff;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.6),
        0 1px 2px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.2px;
    word-break: break-word;
    position: relative;
    z-index: 4;
}

.book-title.long-title {
    font-size: clamp(0.75rem, 2.8vw, 0.85rem);
}

/* ===== حاوية الشارات - مصغرة وذكية ===== */
.book-badges-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    width: 100%;
    flex-wrap: wrap;
}

/* ===== سنة النشر: مخفية بصرياً ولكن متاحة لـ SEO ===== */
.book-year {
    /* إخفاء بصري مع الحفاظ على البيانات لـ SEO */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    /* البيانات متاحة لقارئات الشاشة ومحركات البحث */
    clip-path: inset(50%);
}

/* ===== شارة المنهج - صغيرة وأنيقة ===== */
.curriculum-badge {
    font-size: clamp(0.55rem, 2vw, 0.65rem);
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg,
        rgba(192, 57, 43, 0.85) 0%,
        rgba(231, 76, 60, 0.85) 100%);
    padding: 2px 8px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.1px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    max-width: 90px;
    transition: all 0.3s ease;
}

.curriculum-badge span {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

.explorer-card:hover .curriculum-badge {
    background: linear-gradient(135deg,
        rgba(192, 57, 43, 1) 0%,
        rgba(231, 76, 60, 1) 100%);
    box-shadow: 0 3px 6px rgba(192, 57, 43, 0.3);
}

/* ===== الإحصائيات: ذكية - تظهر عند التحويم فقط ===== */
.book-stats-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 0.6rem;
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(30, 40, 50, 0.8) 100%);
    padding: 3px 10px;
    border-radius: 15px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    
    /* الإخفاء الذكي: شفافة جداً افتراضياً */
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* تظهر الإحصائيات عند التحويم على البطاقة */
.explorer-card:hover .book-stats-overlay {
    opacity: 1;
    transform: translateY(0);
}

.book-stats-overlay span {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    font-size: 0.6rem;
}

.book-stats-overlay i {
    font-size: 0.6rem;
    color: #fbbf24;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.book-stats-overlay span:first-child::after {
    content: '';
    display: inline-block;
    width: 1px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    margin-right: 5px;
    margin-left: 2px;
}

/* ===== تحسينات متقدمة للعنوان ===== */
.book-title-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 4px;
}

.book-title-wrapper::before {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 50%;
    transform: translateX(50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.5) 30%,
        rgba(255, 215, 0, 0.7) 70%,
        transparent 100%);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.explorer-card:hover .book-title-wrapper::before {
    opacity: 1;
}

/* العمود الفقري - تم إصلاحه للـ RTL */
.book-spine {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    width: 12px;
    background: linear-gradient(to right, 
        rgba(0, 0, 0, 0.15), 
        rgba(255, 255, 255, 0.08) 30%, 
        rgba(0, 0, 0, 0.08) 70%);
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    z-index: 5;
    box-shadow: inset 1px 0 2px rgba(0, 0, 0, 0.08);
}

/* شارة الصف الدراسي - أنيقة وغير معيقة */
.book-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    right: auto;
    padding: 3px 10px;
    background: rgba(0, 43, 91, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    font-size: clamp(0.55rem, 2vw, 0.65rem);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.2px;
    text-align: center;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(2px);
    max-width: 85%;
    transition: all 0.3s ease;
}

.book-badge i {
    font-size: 0.55rem;
    color: #fbbf24;
}

.explorer-card:hover .book-badge {
    background: rgba(0, 43, 91, 0.9);
    box-shadow: 0 6px 12px rgba(0, 43, 91, 0.3);
}

/* ===== حركة الكتاب عند التحويم - محدثة للـ RTL ===== */
.book-link-wrapper:hover .book-cover {
    transform: rotateY(22deg) translateZ(4px);
    box-shadow: -12px 18px 28px rgba(0, 0, 0, 0.28), 4px 0 12px rgba(0, 0, 0, 0.18);
}

/* حاوية زر التحميل */
.download-btn-container {
    width: 100%;
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: clamp(0.75rem, 2.5vw, 0.85rem);
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    width: 100%;
    backdrop-filter: blur(2px);
    letter-spacing: 0.2px;
}

.download-btn i {
    font-size: 0.85rem;
}

.download-btn-book {
    background: var(--btn-book);
}

.download-btn-book:hover {
    background: var(--btn-book-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.35);
}

.download-btn-summary {
    background: var(--btn-summary);
}

.download-btn-summary:hover {
    background: var(--btn-summary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(5, 150, 105, 0.35);
}

.download-btn-exam {
    background: var(--btn-exam);
}

.download-btn-exam:hover {
    background: var(--btn-exam-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(234, 88, 12, 0.35);
}

/* ==============================
   قسم الأكثر تحميلاً والأكثر مشاهدة
   ============================== */
.most-downloaded-section {
    background: var(--bg-color);
    padding: 5px 0 10px;
    position: relative;
    overflow: hidden;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

/* تخصيص الأقسام */
.most-downloaded-section .section-title::after {
    background: linear-gradient(90deg, transparent, var(--downloads-color), transparent);
}

.most-viewed-section .section-title::after {
    background: linear-gradient(90deg, transparent, var(--views-color), transparent);
}

.most-downloaded-section .progress-bar {
    background: linear-gradient(90deg, var(--downloads-color), var(--accent-blue));
}

.most-viewed-section .progress-bar {
    background: linear-gradient(90deg, var(--views-color), #10B981);
}

.most-downloaded-section .premium-btn {
    background: linear-gradient(135deg, var(--downloads-color), var(--accent-blue), #1E88E5, var(--downloads-color));
}

.most-viewed-section .premium-btn {
    background: linear-gradient(135deg, var(--views-color), #10B981, #059669, var(--views-color));
}

/* معرض الكتب */
.books-gallery-container {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 11px;
}

.books-gallery {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    cursor: grab;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 25px 10px 20px;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.books-gallery::-webkit-scrollbar {
    display: none;
}

.books-gallery.active {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
}

/* ==============================
   بطاقات المعرض بتصميم explorer-card
   ============================== */
.gallery-card {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 200px;
    scroll-snap-align: start;
}

.books-gallery .explorer-card {
    margin: 0;
    padding: 0;
}

.books-gallery .explorer-card:hover {
    transform: translateY(-12px);
}

/* شارة الترتيب للبطاقات في المعرض */
.gallery-card .rank-badge {
    position: absolute;
    top: -12px;
    right: 8px;
    left: auto;
    z-index: 20;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 255, 255, 0.3) inset;
    border: 3px solid white;
    overflow: hidden;
}

.gallery-card .rank-number {
    font-size: 1.2rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
    letter-spacing: -1px;
}

/* شارات الترتيب */
.rank-badge {
    position: absolute;
    top: -15px;
    right: 10px;
    left: auto;
    z-index: 20;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 255, 255, 0.3) inset;
    border: 3px solid white;
    overflow: hidden;
}

.badge-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
    transform: rotate(45deg);
    animation: shine 3s infinite linear;
}

.rank-glow {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.7;
    filter: blur(10px);
}

.rank-1 {
    background: var(--rank-1-color);
}

.rank-1 .rank-glow {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.9) 0%, rgba(255, 215, 0, 0) 80%);
}

.rank-2 {
    background: var(--rank-2-color);
}

.rank-2 .rank-glow {
    background: radial-gradient(circle, rgba(192, 192, 192, 0.9) 0%, rgba(192, 192, 192, 0) 80%);
}

.rank-3 {
    background: var(--rank-3-color);
}

.rank-3 .rank-glow {
    background: radial-gradient(circle, rgba(205, 127, 50, 0.9) 0%, rgba(205, 127, 50, 0) 80%);
}

/* ألوان الترتيب للقسمين */
.most-downloaded-section .rank-badge.rank-4,
.most-downloaded-section .rank-badge.rank-5,
.most-downloaded-section .rank-badge.rank-6,
.most-downloaded-section .rank-badge.rank-7,
.most-downloaded-section .rank-badge.rank-8,
.most-downloaded-section .rank-badge.rank-9,
.most-downloaded-section .rank-badge.rank-10,
.most-downloaded-section .gallery-card .rank-badge.rank-4,
.most-downloaded-section .gallery-card .rank-badge.rank-5,
.most-downloaded-section .gallery-card .rank-badge.rank-6,
.most-downloaded-section .gallery-card .rank-badge.rank-7,
.most-downloaded-section .gallery-card .rank-badge.rank-8,
.most-downloaded-section .gallery-card .rank-badge.rank-9,
.most-downloaded-section .gallery-card .rank-badge.rank-10 {
    background: linear-gradient(135deg, var(--downloads-color), #4A90E2);
}

.most-viewed-section .rank-badge.rank-4,
.most-viewed-section .rank-badge.rank-5,
.most-viewed-section .rank-badge.rank-6,
.most-viewed-section .rank-badge.rank-7,
.most-viewed-section .rank-badge.rank-8,
.most-viewed-section .rank-badge.rank-9,
.most-viewed-section .rank-badge.rank-10,
.most-viewed-section .gallery-card .rank-badge.rank-4,
.most-viewed-section .gallery-card .rank-badge.rank-5,
.most-viewed-section .gallery-card .rank-badge.rank-6,
.most-viewed-section .gallery-card .rank-badge.rank-7,
.most-viewed-section .gallery-card .rank-badge.rank-8,
.most-viewed-section .gallery-card .rank-badge.rank-9,
.most-viewed-section .gallery-card .rank-badge.rank-10 {
    background: linear-gradient(135deg, var(--views-color), #10B981);
}

.rank-number {
    font-size: 1.3rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
    letter-spacing: -1px;
}

/* شريط التقدم */
.gallery-progress {
    padding: 0 15px;
    margin-top: 5px;
}

.progress-wrapper {
    width: 100%;
    height: 3px;
    background: rgba(0, 43, 91, 0.08);
    border-radius: 1.5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 1.5px;
    transition: width 0.3s ease-out;
}

/* زر المشاهدة */
.view-all-container2 {
    text-align: center;
    margin-top: 10px;
    padding-top: 20px;
    position: relative;
}

.view-all-container2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 43, 91, 0.3), transparent);
}

.premium-btn {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    color: white;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 30px rgba(43, 125, 195, 0.3);
    background-size: 200% 100%;
    animation: gradientFlow 3s ease infinite;
    text-decoration: none;
}

.premium-btn:hover {
    transform: translateY(-5px) scale(1.05);
}

.btn-glow {
    position: absolute;
    inset: -10px;
    border-radius: 60px;
    background: rgba(43, 125, 195, 0.4);
    z-index: -1;
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.premium-btn:hover .btn-glow {
    opacity: 1;
}

.btn-text,
.btn-icon {
    position: relative;
    z-index: 2;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 5px;
}

/* حالة عدم وجود بيانات */
.no-data {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: var(--gray-text);
    font-size: 0.9rem;
}

/* ==============================
   Motion Banner
   ============================== */
.motion-banner {
    position: relative;
    margin: 8px 0 15px;
    padding: 0;
    z-index: 10;
    width: 100%;
    overflow: hidden;
    direction: rtl;
}

.banner-wrapper {
    position: relative;
    background: linear-gradient(145deg, var(--banner-dark-blue), var(--banner-light-blue));
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.float-elm {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.05);
    animation: floatAnimation 15s infinite ease-in-out;
}

.elm-1 {
    width: 200px;
    height: 200px;
    top: -30px;
    right: -30px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
}

.elm-2 {
    width: 150px;
    height: 150px;
    bottom: -30px;
    left: 5%;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.1) 0%, transparent 70%);
}

.elm-3 {
    width: 100px;
    height: 100px;
    top: 15%;
    left: 10%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.08) 0%, transparent 70%);
}

.elm-4 {
    width: 70px;
    height: 70px;
    bottom: 20%;
    right: 15%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.elm-5 {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 25%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
}

.light-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
    opacity: 0.1;
    pointer-events: none;
}

.line {
    position: absolute;
    width: 200%;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, var(--banner-gold), var(--banner-orange), transparent);
    left: -50%;
    animation: lightMove 8s infinite linear;
    content-visibility: auto;
    will-change: transform;
}

.line-1 {
    top: 20%;
    animation-duration: 10s;
}

.line-2 {
    top: 50%;
    animation-duration: 15s;
    animation-delay: 2s;
}

.line-3 {
    top: 80%;
    animation-duration: 12s;
    animation-delay: 4s;
}

.banner-content-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 10px;
    gap: 8px;
}

.banner-text-content {
    width: 100%;
    color: white;
    text-align: center;
}

.service-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 4px 12px;
    border-radius: 25px;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    font-size: 0.7rem;
}

.tag-pulse {
    width: 5px;
    height: 5px;
    background: var(--banner-green);
    border-radius: 50%;
    animation: tagPulse 1.5s infinite;
    flex-shrink: 0;
}

.tag-text {
    font-weight: 600;
    color: #fff;
}

.banner-headline {
    margin-bottom: 4px;
    line-height: 1.2;
}

.headline-big {
    display: block;
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--banner-gold), var(--banner-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.headline-small {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
}

.banner-description {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
    line-height: 1.4;
}

.highlight {
    color: var(--banner-gold);
    font-weight: 700;
}

.live-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--banner-gold);
    line-height: 1;
}

.stat-divider {
    width: 1px;
    height: 25px;
    background: rgba(255, 255, 255, 0.2);
}

.cta-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cta-3d-button {
    position: relative;
    width: 100%;
    max-width: 200px;
    height: 38px;
    text-decoration: none;
    perspective: 1000px;
}

.button-front,
.button-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 14px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.75rem;
    transition: transform 0.5s;
    backface-visibility: hidden;
    white-space: nowrap;
}

.button-front {
    background: linear-gradient(145deg, var(--banner-gold), var(--banner-orange));
    color: var(--banner-dark-blue);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: rotateX(0deg);
}

.button-back {
    background: linear-gradient(145deg, #fff, #f0f0f0);
    color: var(--banner-dark-blue);
    transform: rotateX(180deg);
}

.cta-3d-button:active .button-front {
    transform: rotateX(-180deg);
}

.cta-3d-button:active .button-back {
    transform: rotateX(0deg);
}

@media (hover: hover) {
    .cta-3d-button:hover .button-front {
        transform: rotateX(-180deg);
    }

    .cta-3d-button:hover .button-back {
        transform: rotateX(0deg);
    }
}

.urgency-pulse {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.pulse-dot {
    width: 5px;
    height: 5px;
    background: var(--banner-red);
    border-radius: 50%;
    animation: pulse-red 1.5s infinite;
    flex-shrink: 0;
}

.urgency-text {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.banner-visual-content {
    width: 100%;
    position: relative;
    height: auto;
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.id-card-3d {
    position: relative;
    width: 160px;
    height: 92px;
    transform-style: preserve-3d;
    animation: cardFloat 4s infinite ease-in-out;
    margin: 0 auto;
}

.card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, var(--banner-light-blue), var(--banner-dark-blue));
    border-radius: 10px;
    padding: 8px;
    border: 2px solid var(--banner-gold);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    backface-visibility: hidden;
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
    animation: cardGlow 5s infinite linear;
}

.card-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 215, 0, 0.1) 1px, transparent 1px);
    background-size: 10px 10px;
}

.card-content {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
}

.card-icon {
    width: 28px;
    height: 28px;
    background: var(--banner-gold);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--banner-dark-blue);
    flex-shrink: 0;
}

.card-details {
    flex: 1;
    min-width: 0;
}

.card-label {
    display: block;
    font-size: 0.45rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1px;
}

.card-number {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--banner-gold);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-name {
    display: block;
    font-size: 0.5rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-logo {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 0.6rem;
    font-weight: 900;
    color: rgba(255, 215, 0, 0.3);
}

.orbiting-elements {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    animation: orbitRotate 20s infinite linear;
    pointer-events: none;
}

.orbit-circle {
    position: absolute;
    width: 22px;
    height: 22px;
    background: rgba(255, 215, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--banner-dark-blue);
    font-size: 0.6rem;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.circle-1 {
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
}

.circle-2 {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
}

.circle-3 {
    left: 0;
    top: 50%;
    transform: translate(-50%, -50%);
}

.circle-4 {
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
}

/* ==============================
   قسم السلاسل التعليمية
   ============================== */
.series-section {
    margin: 10px auto;
    max-width: 1200px;
    padding: 0 10px;
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 5px;
}

@media (min-width: 768px) {
    .series-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
}

@media (min-width: 1024px) {
    .series-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

.series-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #E2E8F0;
    border-radius: var(--border-radius);
    padding: 0;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    flex-direction: row !important;
    align-items: stretch !important;
    overflow: visible;
    min-height: 240px;
    position: relative;
}

.series-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    z-index: 2;
}

.series-card::after {
    content: 'سلسلة';
    position: absolute;
    top: -10px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 15px;
    border-radius: 15px;
    z-index: 3;
    box-shadow: 0 3px 10px rgba(0, 43, 91, 0.3);
    letter-spacing: 1px;
}

.series-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 43, 91, 0.25) !important;
    border-color: var(--accent-blue);
}

.series-poster {
    width: 120px !important;
    height: 120px !important;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    margin: 20px !important;
    border: 4px solid var(--white);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 2;
    flex-shrink: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.series-poster::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px dashed var(--primary-blue);
    border-radius: 50%;
    opacity: 0.3;
    z-index: -1;
    animation: rotateSlow 20s linear infinite;
}

.series-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0;
    animation: fadeInImage 0.5s ease forwards;
}

.series-card:hover .series-poster img {
    transform: scale(1.1);
}

.series-card:hover .series-poster {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.series-link {
    text-decoration: none;
}

.series-info {
    padding: 20px 20px 20px 0 !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: right !important;
    position: relative;
    z-index: 1;
}

.series-name {
    font-size: 1.2rem !important;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 10px !important;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
    text-decoration: none;
}

.series-desc {
    font-size: 0.85rem !important;
    color: #4A5568;
    line-height: 1.6 !important;
    margin-bottom: 15px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.series-icon-wrapper {
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 43, 91, 0.3);
    transition: all 0.3s ease;
}

.series-card:hover .series-icon-wrapper {
    transform: scale(1.2) rotate(90deg);
}

.series-stats {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.series-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #718096;
    background: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}

.series-stat i {
    color: var(--accent-blue);
    font-size: 0.8rem;
}

.series-view-all-container {
    margin-top: 25px;
    text-align: center;
    display: flex;
    justify-content: center;
    direction: rtl;
}

/* ==============================
   أزرار عرض الكل
   ============================== */
.view-all-container {
    margin-top: 25px;
    text-align: center;
    display: flex;
    justify-content: center;
    direction: rtl;
}

.Btn-Container,
.series-Btn-Container {
    display: flex;
    width: 170px;
    height: 45px;
    background: linear-gradient(135deg,
        var(--primary-blue) 5%,
        var(--accent-blue) 25%,
        #0b5380 50%,
        var(--accent-blue) 75%,
        var(--primary-blue) 100%);
    color: white;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow:
        0 10px 30px rgba(43, 125, 195, 0.3),
        0 0 0 2px rgba(255, 255, 255, 0.1) inset;
    background-size: 200% 100%;
    animation: gradientFlow 3s ease infinite;
    letter-spacing: 0.5px;
    border-radius: 40px;
    justify-content: space-between;
    align-items: center;
    border: none;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.Btn-Container:hover,
.series-Btn-Container:hover {
    transform: translateY(-2px);
    box-shadow: 0px 8px 15px rgba(190, 190, 190, 0.4);
}

.Btn-Container:active,
.series-Btn-Container:active {
    transform: translateY(0);
}

.icon-Container,
.series-icon-Container {
    width: 45px;
    height: 45px;
    background-color: #85c2ffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 3px solid var(--primary-blue);
    flex-shrink: 0;
}

.text,
.series-text {
    width: calc(170px - 45px);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    letter-spacing: 1px;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    white-space: nowrap !important;
}

.series-icon-Container svg {
    transition-duration: 1.5s;
    fill: var(--primary-blue);
}

.series-Btn-Container:hover .series-icon-Container svg {
    transition-duration: 1.5s;
    animation: arrow 1s linear infinite;
}

.btn-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50px;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: particleFloat 3s infinite linear;
}

.particle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 1s;
}

.particle:nth-child(3) {
    top: 80%;
    left: 30%;
    animation-delay: 2s;
}

/* ==============================
   قسم SEO
   ============================== */
.seo-content-section {
    background: linear-gradient(to bottom, #f8fafc 0%, #f0f9ff 100%);
    padding: 40px 0;
    margin-top: 30px;
    position: relative;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.seo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.seo-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    color: var(--primary-blue);
    padding-bottom: 23px;
}

.seo-title::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 50%;
    transform: translateX(50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--light-blue), var(--primary-blue), transparent);
    border-radius: 2px;
}

.seo-title::before {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 50%;
    transform: translateX(50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    z-index: 2;
}

.seo-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 43, 91, 0.08);
    border: 1px solid #e2e8f0;
}

.seo-text {
    color: #4a5568;
    line-height: 1.7;
    font-size: 0.95rem;
    text-align: justify;
}

.seo-text p {
    margin-bottom: 15px;
}

.seo-text strong {
    color: var(--primary-blue);
    font-weight: 700;
}

.seo-features {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 15px;
    margin: 25px 0;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.seo-features::-webkit-scrollbar {
    display: none;
}

.seo-feature {
    flex: 0 0 auto;
    width: 140px;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
    border-radius: 10px;
    padding: 15px 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    display: block;
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    color: white;
    font-size: 1rem;
}

.feature-text h3 {
    font-size: 0.85rem;
    color: var(--primary-blue);
    font-weight: 700;
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feature-text p {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.seo-cta {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(43, 125, 195, 0.3);
}

/* ==============================
   الدرج السفلي للفلاتر (Mobile)
   ============================== */
.bottom-sheet-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70vh;
    max-height: 70vh;
    background: white;
    border-radius: 25px 25px 0 0;
    z-index: 2001;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
}

.bottom-sheet.active {
    transform: translateY(0);
}

.sheet-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--white) 0%, #f8fafc 100%);
}

.sheet-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--light-gray);
    border-radius: 2px;
}

.sheet-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sheet-title i {
    color: var(--accent-blue);
}

.close-sheet {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--gray-text);
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: var(--bg-color);
}

.close-sheet:hover {
    background: var(--primary-blue);
    color: white;
}

.sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    padding-bottom: 40px;
}

.sheet-filter-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.filter-group {
    margin-bottom: 0;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 1rem;
    padding-right: 5px;
}

.filter-group label i {
    color: var(--accent-blue);
    font-size: 0.9rem;
    width: 24px;
    text-align: center;
}

.filter-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
    cursor: pointer;
    color: var(--primary-blue);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23256D85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 16px center;
    background-size: 16px;
    padding-left: 45px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(43, 125, 195, 0.15);
    background-color: #f8fafc;
}

.advance-search-btn {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 6px 20px rgba(0, 43, 91, 0.25);
    position: relative;
    overflow: hidden;
}

.advance-search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent);
    transition: left 0.7s ease;
}

.advance-search-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 43, 91, 0.35);
}

.advance-search-btn:hover::before {
    left: 100%;
}

.advance-search-btn:active {
    transform: translateY(-1px);
}

.advance-search-btn i {
    font-size: 1.1rem;
}

/* زر الفلترة للموبايل */
.mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 43, 91, 0.35);
    transition: var(--transition);
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-filter-btn:hover {
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 43, 91, 0.45);
}

/* ==============================
   البادجات (Badges)
   ============================== */
.card-badge {
    position: absolute;
    top: 15px;
    right: 10px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    color: white;
    padding: 6px 10px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.7rem;
    z-index: 10;
    box-shadow: var(--shadow);
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.card-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 43, 91, 0.4);
}

.card-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-badge:hover::after {
    opacity: 1;
}

@supports not (backdrop-filter: blur(5px)) {
    .card-badge,
    .curriculum-badge {
        background: var(--primary-blue);
    }
}

/* ==============================
   تمييز أنواع المحتوى
   ============================== */
.content-card {
    position: relative;
    border-left: 4px solid transparent;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.content-card[data-type="book"] {
    border-left-color: #38A169;
    background: linear-gradient(to left, rgba(56, 161, 105, 0.05) 0%, rgba(56, 161, 105, 0.01) 100%);
}

.content-card[data-type="book"] .card-image::before {
    content: '📚';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.2rem;
    background: rgba(56, 161, 105, 0.9);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(56, 161, 105, 0.3);
}

.content-card[data-type="book"] .card-title {
    color: #2D3748;
}

.content-card[data-type="book"] .meta-item.book i {
    color: #38A169;
}

.content-card[data-type="summary"] {
    border-left-color: #ED8936;
    background: linear-gradient(to left, rgba(237, 137, 54, 0.05) 0%, rgba(237, 137, 54, 0.01) 100%);
}

.content-card[data-type="summary"] .card-image::before {
    content: '📝';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.2rem;
    background: rgba(237, 137, 54, 0.9);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(237, 137, 54, 0.3);
}

.content-card[data-type="summary"] .card-title {
    color: #2D3748;
}

.content-card[data-type="summary"] .meta-item.calendar i {
    color: #ED8936;
}

.content-card[data-type="exam"] {
    border-left-color: #9F7AEA;
    background: linear-gradient(to left, rgba(159, 122, 234, 0.05) 0%, rgba(159, 122, 234, 0.01) 100%);
}

.content-card[data-type="exam"] .card-image::before {
    content: '📊';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.2rem;
    background: rgba(159, 122, 234, 0.9);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(159, 122, 234, 0.3);
}

.content-card[data-type="exam"] .card-title {
    color: #2D3748;
}

.content-card[data-type="exam"] .meta-item.graduation-cap i {
    color: #9F7AEA;
}

.content-card[data-type="book"]:hover {
    transform: translateX(5px) translateY(-5px);
    box-shadow: 0 10px 30px rgba(56, 161, 105, 0.2);
    border-left-color: #2F855A;
    background: linear-gradient(to left, rgba(56, 161, 105, 0.1) 0%, rgba(56, 161, 105, 0.02) 100%);
}

.content-card[data-type="summary"]:hover {
    transform: translateX(5px) translateY(-5px);
    box-shadow: 0 10px 30px rgba(237, 137, 54, 0.2);
    border-left-color: #DD6B20;
    background: linear-gradient(to left, rgba(237, 137, 54, 0.1) 0%, rgba(237, 137, 54, 0.02) 100%);
}

.content-card[data-type="exam"]:hover {
    transform: translateX(5px) translateY(-5px);
    box-shadow: 0 10px 30px rgba(159, 122, 234, 0.2);
    border-left-color: #805AD5;
    background: linear-gradient(to left, rgba(159, 122, 234, 0.1) 0%, rgba(159, 122, 234, 0.02) 100%);
}

.content-card::after {
    content: attr(data-type-label);
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--white);
    color: var(--gray-text);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.content-card[data-type="book"]::after {
    background: #38A169;
    color: white;
}

.content-card[data-type="summary"]::after {
    background: #ED8936;
    color: white;
}

.content-card[data-type="exam"]::after {
    background: #9F7AEA;
    color: white;
}

/* ==============================
   قسم الإعلانات (Ad Section)
   ============================== */
.ad-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    margin: 30px 0;
    border: 1px solid var(--light-gray);
    box-shadow: var(--shadow);
}

.ad-text {
    color: var(--gray-text);
    font-size: 0.9rem;
}

/* ==============================
   تأثيرات الحركة (Animations)
   ============================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInImage {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse-bg {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes rotate-dashed {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: rotate(180deg) scale(1.02);
        opacity: 0.9;
    }
    100% {
        transform: rotate(360deg) scale(1);
        opacity: 0.8;
    }
}

@keyframes rotate-dotted {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: rotate(-180deg) scale(0.98);
        opacity: 0.8;
    }
    100% {
        transform: rotate(-360deg) scale(1);
        opacity: 0.6;
    }
}

@keyframes dash-flow {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: 21;
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes arrow {
    0% {
        opacity: 0;
        margin-left: 0px;
    }
    100% {
        opacity: 1;
        margin-left: 10px;
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20px) translateX(20px);
        opacity: 0;
    }
}

@keyframes floatAnimation {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(10px, -10px) scale(1.02);
    }
    50% {
        transform: translate(-5px, 10px) scale(0.98);
    }
    75% {
        transform: translate(-10px, -5px) scale(1.03);
    }
}

@keyframes lightMove {
    0% {
        transform: translateX(0) rotate(-45deg);
    }
    100% {
        transform: translateX(50%) rotate(-45deg);
    }
}

@keyframes tagPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0) rotateY(0deg) rotateX(0deg);
    }
    50% {
        transform: translateY(-3px) rotateY(3deg) rotateX(1deg);
    }
}

@keyframes cardGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes orbitRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes rotateSlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ==============================
   ترتيب طبقات Z-index
   ============================== */
.card-cover {
    position: relative;
    z-index: 1;
}

.card-badge {
    z-index: 10;
}

.curriculum-badge {
    z-index: 9;
}

.content-type-badge {
    z-index: 8;
}

.books-gallery img,
.books-gallery a {
    -webkit-user-drag: none;
    user-drag: none;
}

/* ==============================
   تحسينات الأداء
   ============================== */
#sidebarLinks i,
#sidebarLinks a,
#sidebarLinks li {
    will-change: transform, color;
    transform: translateZ(0);
}

/* دعم scrollbar-color لمتصفح فايرفوكس */
@supports (scrollbar-color: auto) {
    #sidebarLinks,
    .books-gallery,
    .seo-features,
    .hero-stats,
    .sheet-content {
        scrollbar-color: var(--primary-blue) var(--light-gray);
        scrollbar-width: thin;
    }
}

/* أنماط الـ scrollbar لمتصفحات WebKit */
#sidebarLinks::-webkit-scrollbar,
.books-gallery::-webkit-scrollbar,
.seo-features::-webkit-scrollbar,
.hero-stats::-webkit-scrollbar,
.sheet-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#sidebarLinks::-webkit-scrollbar-track,
.books-gallery::-webkit-scrollbar-track,
.seo-features::-webkit-scrollbar-track,
.hero-stats::-webkit-scrollbar-track,
.sheet-content::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 10px;
}

#sidebarLinks::-webkit-scrollbar-thumb,
.books-gallery::-webkit-scrollbar-thumb,
.seo-features::-webkit-scrollbar-thumb,
.hero-stats::-webkit-scrollbar-thumb,
.sheet-content::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 10px;
}

#sidebarLinks::-webkit-scrollbar-thumb:hover,
.books-gallery::-webkit-scrollbar-thumb:hover,
.seo-features::-webkit-scrollbar-thumb:hover,
.hero-stats::-webkit-scrollbar-thumb:hover,
.sheet-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* ==============================
   تحسينات للهواتف (Media Queries)
   ============================== */

/* للأجهزة الكبيرة */
@media (min-width: 1024px) {
    .section-icon {
        width: 3.25rem;
        height: 3.25rem;
    }

    .section-icon svg {
        width: 1.75rem;
        height: 1.75rem;
    }

    .grades-grid {
        gap: 1.25rem;
    }

    .grade-card {
        padding: 1.75rem 1rem;
        min-height: 170px;
    }

    .grade-number {
        width: 4rem;
        height: 4rem;
        font-size: 1.75rem;
    }
}

@media (min-width: 1280px) {
    .grades-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 769px) {
    .seo-features {
        flex-wrap: wrap;
        justify-content: center;
        overflow-x: visible;
    }

    .seo-feature {
        flex: 0 0 auto;
        width: 180px;
    }
}

/* للأجهزة المتوسطة */
@media (min-width: 641px) and (max-width: 768px) {
    .grades-grid {
        gap: 1rem;
    }

    .grade-card {
        padding: 1.5rem 0.875rem;
        min-height: 160px;
    }
}

/* للموبايل */
@media (max-width: 768px) {
    .home-hero {
        min-height: 220px;
        padding: 50px 12px 20px;
        margin-bottom: 15px;
    }

    .hero-title {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }

    .hero-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        margin-bottom: 10px;
    }

    .hero-stats {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .stat-item {
        padding: 0.3rem 0.4rem;
        min-width: 60px;
        border-radius: 7px;
    }

    .stat-number {
        font-size: 0.8rem;
    }

    .stat-label {
        font-size: 0.55rem;
    }

    .filter-btn-main {
        padding: 8px 14px;
        font-size: 0.85rem;
        min-width: 110px;
        height: 42px;
        margin-left: 5px;
        gap: 5px;
    }

    .series-grid,
    .categories-grid,
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .ad-header-bottom {
        min-height: 80px;
        border-radius: 12px;
        margin: 1px auto;
    }

    .ad-mid-section {
        margin: 20px 0;
        padding: 15px;
        min-height: 100px;
    }

    .ad-footer-top {
        margin: 30px auto 15px;
        padding: 20px 15px;
        min-height: 120px;
    }

    .bottom-sheet {
        height: 75vh;
        max-height: 75vh;
    }

    .mobile-filter-btn {
        display: flex;
        padding: 12px 20px;
        font-size: 0.9rem;
        gap: 8px;
    }

    .content-card {
        border-left-width: 3px;
    }

    .content-card[data-type] .card-image::before {
        width: 30px;
        height: 30px;
        font-size: 1rem;
        top: 8px;
        left: 8px;
    }

    .content-card::after {
        top: 10px;
        right: 10px;
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .download-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .series-card {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        padding: 0 !important;
        min-height: auto !important;
    }

    .series-poster {
        width: 100px !important;
        height: 100px !important;
        margin: 20px auto 15px !important;
    }

    .series-info {
        padding: 0 20px 20px !important;
        text-align: center !important;
    }

    .series-card::after {
        right: 50%;
        transform: translateX(50%);
    }

    .series-icon-wrapper {
        position: relative;
        bottom: auto;
        left: auto;
        margin: 15px auto;
    }

    .series-stats {
        justify-content: center;
    }

    .section-icon {
        width: 2.75rem;
        height: 2.75rem;
        margin-bottom: 0.875rem;
    }

    .section-icon svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .section-icon::after {
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        border-width: 1.5px;
    }

    .section-icon .inner-circle {
        top: 4px;
        left: 4px;
        right: 4px;
        bottom: 4px;
        border-width: 1px;
    }

    .seo-content-section {
        padding: 30px 15px;
        margin-top: 25px;
    }

    .seo-container {
        padding: 0 15px;
    }

    .seo-title {
        font-size: 1.3rem;
        margin-bottom: 23px;
        padding-bottom: 18px;
    }

    .seo-title::after {
        width: 80px;
    }

    .seo-title::before {
        width: 10px;
        height: 10px;
    }

    .seo-content {
        padding: 20px;
        border-radius: 10px;
    }

    .seo-text {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .seo-features {
        gap: 12px;
        margin: 20px 0;
    }

    .seo-feature {
        width: 130px;
        padding: 12px 10px;
    }

    .feature-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .feature-text h3 {
        font-size: 0.8rem;
    }

    .feature-text p {
        font-size: 0.7rem;
    }

    .seo-cta {
        margin-top: 15px;
        padding-top: 15px;
    }

    .cta-button {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .books-gallery {
        gap: 15px;
        padding: 22px 8px 18px;
    }

    .gallery-card {
        min-width: 160px;
        max-width: 175px;
    }

    .gallery-card .rank-badge {
        width: 36px;
        height: 36px;
        top: -10px;
        right: 6px;
    }

    .gallery-card .rank-number {
        font-size: 1rem;
    }

    .rank-badge {
        width: 38px;
        height: 38px;
        top: -13px;
        right: 8px;
        border-width: 2.5px;
    }

    .rank-number {
        font-size: 1.1rem;
    }

    .premium-btn {
        padding: 14px 30px;
        font-size: 1rem;
    }

    .Btn-Container,
    .series-Btn-Container {
        width: 155px !important;
        height: 42px !important;
        animation: none;
    }

    .icon-Container,
    .series-icon-Container {
        width: 42px !important;
        height: 42px !important;
    }

    .text,
    .series-text {
        width: calc(155px - 42px) !important;
        font-size: 0.9rem !important;
    }

    .elm-1 {
        width: 150px;
        height: 150px;
    }

    .elm-2 {
        width: 100px;
        height: 100px;
    }

    .elm-3 {
        width: 70px;
        height: 70px;
    }

    .elm-4,
    .elm-5 {
        display: none;
    }

    .headline-big {
        font-size: 1.9rem;
    }

    .headline-small {
        font-size: 0.95rem;
    }

    .banner-description {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .live-stats {
        gap: 12px;
        margin-bottom: 10px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .service-tag {
        padding: 5px 14px;
        font-size: 0.75rem;
        margin-bottom: 8px;
    }

    .cta-3d-button {
        max-width: 220px;
        height: 42px;
    }

    .button-front,
    .button-back {
        padding: 0 16px;
        font-size: 0.8rem;
        gap: 6px;
    }

    .urgency-text {
        font-size: 0.7rem;
    }

    .banner-content-wrapper {
        padding: 15px 15px;
        gap: 10px;
    }

    .id-card-3d {
        width: 180px;
        height: 104px;
    }

    .card-front {
        border-radius: 12px;
        padding: 10px;
    }

    .card-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .card-number {
        font-size: 0.7rem;
    }

    .card-name {
        font-size: 0.55rem;
    }

    .orbiting-elements {
        width: 200px;
        height: 200px;
    }

    .orbit-circle {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }
    
    /* على الهواتف: الإحصائيات تظهر دائماً */
    .book-stats-overlay {
        opacity: 0.85;
        transform: translateY(0);
        padding: 2px 8px;
        font-size: 0.55rem;
    }

    .book-stats-overlay span {
        font-size: 0.55rem;
    }

    .book-stats-overlay i {
        font-size: 0.55rem;
    }

    .book-card {
        max-width: min(100%, 180px);
    }

    .content-grid {
        gap: 15px;
    }

    .cover-content {
        padding: 10px 5px;
    }

    .book-title {
        font-size: clamp(0.7rem, 2.8vw, 0.8rem);
    }

    .curriculum-badge {
        font-size: clamp(0.5rem, 1.8vw, 0.6rem);
        padding: 2px 6px;
        max-width: 80px;
    }

    .curriculum-badge span {
        max-width: 60px;
    }

    .book-badge {
        top: 6px;
        left: 6px;
        padding: 4px 10px;
        font-size: 0.6rem;
    }

    .download-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

/* للهواتف الصغيرة */
@media (max-width: 480px) {
    .home-hero {
        min-height: 200px;
        padding: 45px 10px 15px;
    }

    .hero-title {
        font-size: 1.2rem;
        margin-bottom: 6px;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }

    .hero-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .filter-btn-main {
        padding: 7px 10px;
        font-size: 0.8rem;
        min-width: 90px;
        height: 38px;
        gap: 4px;
    }

    .filter-btn-main span {
        font-size: 0.75rem;
    }

    .hero-search-input {
        padding: 14px 12px;
        font-size: 0.9rem;
    }

    .hero-search-input::placeholder {
        font-size: 0.85rem;
    }

    .stat-item {
        padding: 0.25rem 0.35rem;
        min-width: 55px;
        border-radius: 6px;
    }

    .stat-number {
        font-size: 0.75rem;
    }

    .stat-label {
        font-size: 0.5rem;
    }

    .download-btn {
        padding: 7px 12px;
        font-size: 0.75rem;
    }

    .download-btn i {
        font-size: 0.8rem;
    }

    .bottom-sheet {
        height: 80vh;
        max-height: 80vh;
    }

    .sheet-content {
        padding: 20px;
        padding-bottom: 35px;
    }

    .advance-search-btn {
        padding: 14px 20px;
        font-size: 0.9rem;
    }

    .mobile-filter-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .seo-content-section {
        padding: 25px 12px;
    }

    .seo-title {
        font-size: 1.2rem;
        padding-bottom: 18px;
    }

    .seo-title::after {
        width: 70px;
    }

    .seo-text {
        font-size: 0.85rem;
    }

    .seo-text p {
        margin-bottom: 12px;
    }

    .seo-features {
        gap: 10px;
    }

    .seo-feature {
        width: 120px;
        padding: 10px 8px;
    }

    .feature-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .feature-text h3 {
        font-size: 0.75rem;
    }

    .books-gallery {
        gap: 12px;
        padding: 20px 6px 15px;
    }

    .gallery-card {
        min-width: 145px;
        max-width: 160px;
    }

    .gallery-card .rank-badge {
        width: 32px;
        height: 32px;
        top: -8px;
        right: 5px;
        border-width: 2px;
    }

    .gallery-card .rank-number {
        font-size: 0.9rem;
    }

    .rank-badge {
        width: 34px;
        height: 34px;
        top: -11px;
        right: 6px;
        border-width: 2px;
    }

    .rank-number {
        font-size: 1rem;
    }

    .premium-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .btn-icon {
        width: 20px;
        height: 20px;
    }

    .Btn-Container,
    .series-Btn-Container {
        width: 145px !important;
        height: 40px !important;
        animation: none;
    }

    .icon-Container,
    .series-icon-Container {
        width: 40px !important;
        height: 40px !important;
    }

    .text,
    .series-text {
        width: calc(145px - 40px) !important;
        font-size: 0.85rem !important;
    }

    .icon-Container svg,
    .series-icon-Container svg {
        width: 14px !important;
        height: 16px !important;
    }

    .headline-big {
        font-size: 2.2rem;
    }

    .headline-small {
        font-size: 1.1rem;
    }

    .cta-3d-button {
        max-width: 210px;
        height: 40px;
    }

    .banner-visual-content {
        min-height: 110px;
    }

    .id-card-3d {
        width: 170px;
        height: 98px;
    }

    .content-card[data-type] .card-image::before {
        width: 26px;
        height: 26px;
        font-size: 0.9rem;
    }

    .content-card::after {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .series-poster {
        width: 90px !important;
        height: 90px !important;
    }

    .series-name {
        font-size: 1.1rem !important;
    }

    .card-badge {
        top: 8px;
        right: 6px;
        padding: 4px 6px;
        font-size: 0.6rem;
        max-width: 60%;
        border-radius: 5px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    }

    :root {
        --book-w: clamp(150px, 42vw, 180px);
    }

    .content-grid {
        gap: 12px;
    }

    .book-3d {
        aspect-ratio: 1 / 1.48;
    }

    .cover-content {
        padding: 8px 4px;
    }

    .book-title {
        font-size: 0.8rem;
    }

    .book-year {
        font-size: 0.6rem;
        padding: 2px 8px;
    }

    .book-year,
    .curriculum-badge {
        padding: 2px 6px;
        font-size: clamp(0.55rem, 2vw, 0.65rem);
        border-radius: 15px;
    }

    .curriculum-badge span {
        max-width: 60px;
    }

    .book-stats-overlay {
        gap: 4px;
        padding: 2px 8px;
        font-size: 0.6rem;
    }

    .book-stats-overlay span {
        font-size: 0.55rem;
        gap: 2px;
    }

    .book-stats-overlay i {
        font-size: 0.55rem;
    }

    .book-stats-overlay span:first-child::after {
        height: 6px;
        margin-right: 3px;
        margin-left: 1px;
    }

    .book-badge {
        padding: 3px 8px;
        font-size: 0.55rem;
        gap: 4px;
    }

    .download-btn {
        padding: 7px 12px;
        font-size: 0.75rem;
    }

    .download-btn i {
        font-size: 0.8rem;
    }
}

/* للهواتف الصغيرة جداً */
@media (max-width: 400px) {
    .container {
        padding: 0 0.75rem;
    }

    .grades-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .grade-card {
        padding: 1rem 0.5rem;
        min-height: 140px;
    }

    .grade-number {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }

    .stage-tab {
        padding: 0.5rem 0.125rem;
        min-height: 4rem;
    }

    .tab-text {
        font-size: 0.625rem;
    }
}

@media (max-width: 360px) {
    .series-grid,
    .categories-grid,
    .content-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .filter-btn-main {
        padding: 6px 8px;
        min-width: 70px;
        height: 36px;
        gap: 3px;
    }

    .filter-btn-main span {
        display: none;
    }

    .filter-btn-main i {
        font-size: 0.9rem;
        margin: 0;
    }

    .mobile-filter-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        gap: 5px;
    }

    .mobile-filter-btn span {
        font-size: 0.75rem;
    }

    .download-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .advance-search-btn {
        padding: 12px 16px;
        font-size: 0.85rem;
        gap: 8px;
    }

    .card-badge {
        top: 7px;
        right: 5px;
        padding: 3px 5px;
        font-size: 0.55rem;
        max-width: 55%;
        border-radius: 4px;
    }

    .curriculum-badge span {
        max-width: 50px;
    }

    .book-badges-container {
        flex-direction: column;
        gap: 2px;
    }

    .headline-big {
        font-size: 1.4rem;
    }

    .headline-small {
        font-size: 0.75rem;
    }

    .banner-description {
        font-size: 0.7rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.55rem;
    }

    .cta-3d-button {
        max-width: 180px;
        height: 36px;
    }

    .button-front,
    .button-back {
        font-size: 0.7rem;
        padding: 0 12px;
    }

    .id-card-3d {
        width: 140px;
        height: 80px;
    }

    .card-icon {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }

    .card-number {
        font-size: 0.6rem;
    }

    .card-name {
        font-size: 0.45rem;
    }

    .orbit-circle {
        width: 20px;
        height: 20px;
        font-size: 0.55rem;
    }

    .books-gallery {
        gap: 10px;
        padding: 18px 5px 12px;
    }

    .gallery-card {
        min-width: 130px;
        max-width: 145px;
    }

    .gallery-card .rank-badge {
        width: 28px;
        height: 28px;
        top: -7px;
        right: 4px;
    }

    .gallery-card .rank-number {
        font-size: 0.8rem;
    }

    .rank-badge {
        width: 30px;
        height: 30px;
        top: -10px;
        right: 5px;
        border-width: 2px;
    }

    .rank-number {
        font-size: 0.9rem;
    }

    :root {
        --book-w: clamp(140px, 40vw, 160px);
    }

    .content-grid {
        gap: 10px;
    }

    .book-title {
        font-size: 0.75rem;
    }

    .download-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
}

/* للأجهزة التي لا تدعم hover */
@media (hover: none) and (pointer: coarse) {
    .grade-card:active,
    .stage-tab:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .grade-card:hover {
        transform: none;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .cta-button:active {
        transform: scale(0.98);
    }
}

/* لتقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    .grade-card,
    .stage-tab,
    .stage-content,
    .section-icon,
    .section-icon::before,
    .section-icon::after,
    .section-icon .inner-circle,
    .section-icon svg path,
    .rank-badge,
    .badge-shine,
    .series-card,
    .book-cover,
    .explorer-card,
    .gallery-card,
    .float-elm,
    .line,
    .id-card-3d,
    .card-glow,
    .orbiting-elements,
    .tag-pulse,
    .pulse-dot,
    .button-front,
    .button-back {
        animation: none !important;
        transition: none !important;
    }

    .section-icon:hover {
        transform: none;
    }

    .id-card-3d {
        transform: translateY(0) !important;
    }
}
