body {
    font-family: 'Tajawal', sans-serif;
    background-color: #f9f7f0;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
    

/* عنوان الصفحة */
.section-title {
    font-size: 2rem;
    color: #8c4a21ca;
    font-weight: 600;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

/* مربع البحث */
.search-box {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    margin-bottom: 0.5rem;
}

.search-box input {
    border-radius: 10px;
    padding: 12px 20px;
    border: 1px solid #ccc;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    display: block;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #8c4a21ca;
    box-shadow: 0 0 0 2px rgba(140, 74, 33, 0.1);
}

/* بطاقة المدون */
.blogger-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    min-height: 160px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    color: inherit;
}

.blogger-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.95);
}

/* المحافظة على لون النص عند الضغط على البطاقة */
a .blogger-card {
    color: inherit;
}

a:hover .blogger-card {
    color: inherit;
}

/* اسم الكاتب */
.blogger-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.8rem;
}

/* تعريف الكاتب */
.blogger-bio {
    color: #666;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* عدد المقالات */
.articles-count {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #8c4a21ca;
    color: #fff;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 0.9rem;
}

/* تصنيفات المدونات */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: #e7e5e5;
    border-radius: 11px;
    font-size: 0.87rem;
    color: #666;
    font-weight: 500;
}

/* أزرار تصفية التصنيفات */
.categories-filter {
    margin: 2rem 0 1.5rem;
}

.categories-filter .btn-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.categories-filter .btn {  /* زر التصنيفات */
    border-radius: 20px !important;
    padding: 6px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.categories-filter .btn.active { /* زر نشط */
    background-color: #8c4a21ca;
    color: #fdfdfd;
    border: none;
}

/* زر إظهار/إخفاء التصنيفات */
.categories-toggle {
    display: none;
}

/* حاوية التصنيفات */
.categories-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    cursor: pointer;
}

/* عنوان التصنيفات */
.categories-header {
    display: none;
}

/* أزرار تصفية التصنيفات للشاشات المتوسطة والكبيرة */
@media (min-width: 768px) {
    .categories-filter .btn-group {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .blogs-section {
        padding: 0.5rem 0.8rem;
        margin-top: 0.3rem;
    }

    /* تحسين مربع البحث */
    .search-box {
        padding: 0 0.5rem;
        margin-bottom: 1.5rem;
        width: 100%;
    }

    /* تحسين مربع البحث في وضع الموبايل */
    .search-box input { 
        padding: 10px 15px;
        font-size: 0.95rem;
        border-radius: 8px;
        width: 100%;
        max-width: none;
    }

    /* زر التصنيفات في وضع الموبايل */
    .categories-toggle {
        display: block;
        background-color: #8c4a21ca;
        color: white;
        font-size: 1rem;
        text-align: center;
    }

    /* تحسين بطاقات المدونين */
    .blogger-card {
        margin: 0.5rem 0;
        padding: 1.2rem;
        border-radius: 12px;
    }

    /* تحسين التصنيفات */
    .categories-filter {
        display: none;
        transition: all 0.3s ease;
    }

    .categories-filter.show {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0.5rem;
        background-color: #ffffff;
        padding: 6px 8px;
        border-radius: 0 0 15px 15px;
    }

    /* حاوية التصنيفات في وضع الموبايل */
    .categories-container {
        max-width: 95%;
        margin: 0 auto 0.8rem;
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(140, 74, 33, 0.15);
    }

    .categories-container:hover {
        background-color: #f9f7f0;
    }

    /* عنوان التصنيفات */
    .categories-header {
        display: flex;
        width: 100%;
        justify-content: center;
        align-items: center;
        padding: 8px 12px;
        background-color: #8c4a21ca;
        color: #ffffff;
        font-size: 0.9rem;
        text-align: center;
        font-weight: 500;
        transition: all 0.3s ease;
        position: relative;
    }
    
    
    /* تحسينات أزرار التصنيفات في الموبايل */
    .categories-filter .btn-group {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 3px;
        margin: 0;
    }
    
    .categories-filter .btn {
        border-radius: 12px !important;
        padding: 5px 12px;
        font-size: 0.8rem;
        font-weight: 500;
        transition: all 0.3s ease;
        background-color: #f5f1e8;
        color: #666;
        border: none;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        margin: 2px;
    }
    
    .categories-filter .btn:hover {
        background-color: #ece6d8;
        transform: translateY(-2px);
    }
    
    .categories-filter .btn.active {
        background-color: #8c4a21ca;
        color: #ffffff;
        box-shadow: 0 3px 6px rgba(140, 74, 33, 0.25);
    }
    
    /* تقليل المساحة بين عنوان الصفحة ومربع البحث */
    .section-title {
        margin-bottom: 0.7rem;
    }
    
    /* تقليل الهامش السفلي لمربع البحث */
    .search-box.mx-auto.mb-4 {
        margin-bottom: 1rem !important;
    }
    
    /* تقليل الهامش السفلي للقسم الرئيسي */
    .text-center.mb-5 {
        margin-bottom: 1.5rem !important;
    }
    
    /* إضافة تأثير انزلاق للقائمة */
    @keyframes slideDown {
        0% {
            opacity: 0;
            transform: translateY(-10px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* تحسينات إضافية للهواتف الصغيرة */
@media (max-width: 480px) {
    .blogs-section {
        padding: 0.5rem 0.5rem;
    }

    .blogger-card {
        padding: 1rem;
        margin: 0;
    }

    .row.g-4 {
        row-gap: 0.5rem !important; /* تقليل المسافة أكثر في الهواتف */
    }
}

/* Tablet Specific Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .blogs-section {
        padding: 0.8rem 1.5rem;
    }

    .blogger-card {
        margin: 1rem;
    }

    .categories-filter .btn-group {
        justify-content: center;
    }

    .categories-filter .btn {
        flex: 0 0 auto;
    }
}

/* iPad Portrait Mode */
@media screen and (max-width: 820px) and (orientation: portrait) {
    .blogs-section {
        padding: 0.5rem 0;
    }

    .row.g-4 {
        margin: 0;
        row-gap: 0.8rem !important; /* تقليل المسافة بين البطاقات */
    }

    .col-md-6, .col-lg-4 {
        width: 100%;
        padding: 0 0.8rem;
    }

    .blogger-card {
        margin: 0;
        padding: 1.5rem;
    }
}

/* iPad Landscape Mode */
@media screen and (min-width: 821px) and (max-width: 1180px) and (orientation: landscape) {
    .blogs-section {
        padding: 1rem 1rem;
    }

    .row.g-4 {
        margin: 0 -1rem;
    }

    .col-md-6, .col-lg-4 {
        width: 33.333%;
        padding: 0 1rem;
    }

    .blogger-card {
        margin: 0 0 2rem 0;
        height: 100%;
    }

    /* تعديل خاص بأزرار التصنيفات في وضع الآيباد الأفقي */
    .categories-container {
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: center;
        margin: 0 auto;
    }
    
    .categories-filter {
        width: 80%;
        margin: 0 auto;
        text-align: center;
    }
    
    .categories-filter .btn-group {
        justify-content: center;
        margin: 0 auto;
        width: 100%;
        display: flex;
    }
}

