/**
 * Categories Section Styles - أنماط قسم الفئات
 * تصميم احترافي للفئات الدائرية مع قوائم منسدلة
 */

/* ========================================
   Categories Section
======================================== */
.categories-section {
    padding: 4rem 0;
    background: transparent;
    position: relative;
    z-index: 10;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: fadeInDown 0.8s ease-out;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* ========================================
   Categories Grid
======================================== */
.categories-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
}

/* ========================================
   Category Item (الفئة الدائرية)
======================================== */
.category-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    animation: scaleIn 0.6s ease-out backwards;
}

.category-item:nth-child(1) { animation-delay: 0.1s; }
.category-item:nth-child(2) { animation-delay: 0.15s; }
.category-item:nth-child(3) { animation-delay: 0.2s; }
.category-item:nth-child(4) { animation-delay: 0.25s; }
.category-item:nth-child(5) { animation-delay: 0.3s; }
.category-item:nth-child(6) { animation-delay: 0.35s; }
.category-item:nth-child(7) { animation-delay: 0.4s; }
.category-item:nth-child(8) { animation-delay: 0.45s; }

/* ========================================
   Category Circle (الدائرة الرئيسية)
======================================== */
.category-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

/* الخلفية المتدرجة */
.category-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--cat-color, var(--primary-color)), var(--cat-color-dark, var(--secondary-color)));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 1;
    transition: all 0.4s ease;
}

/* الخلفية الداخلية */
.category-circle::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    z-index: 0;
    transition: all 0.4s ease;
}

[data-theme="light"] .category-circle::after {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
}

/* الأيقونة أو الصورة */
.category-icon {
    position: relative;
    z-index: 1;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--cat-color, var(--primary-color));
    transition: all 0.4s ease;
}

/* عندما تكون هناك صورة - تملأ الدائرة بالكامل مع الحفاظ على الإطار */
.category-icon.has-image {
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border-radius: 50%;
    overflow: hidden;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* إخفاء الخلفية البيضاء عند وجود صورة */
.category-circle.has-image::after {
    display: none;
}

.category-icon i {
    filter: drop-shadow(0 0 10px var(--cat-color, var(--primary-color)));
}

/* اسم الفئة */
.category-name {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    max-width: 130px;
    transition: all 0.3s ease;
}

/* عدد الفئات الفرعية */
.category-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* ========================================
   Hover Effects
======================================== */
.category-item:hover .category-circle {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 
        0 20px 40px rgba(var(--cat-color-rgb, 99, 102, 241), 0.3),
        0 0 60px rgba(var(--cat-color-rgb, 99, 102, 241), 0.2);
}

.category-item:hover .category-circle::before {
    animation: borderRotate 3s linear infinite;
}

.category-item:hover .category-circle::after {
    background: linear-gradient(135deg, 
        rgba(var(--cat-color-rgb, 99, 102, 241), 0.15), 
        rgba(var(--cat-color-rgb, 99, 102, 241), 0.05));
}

[data-theme="light"] .category-item:hover .category-circle::after {
    background: linear-gradient(135deg, 
        rgba(var(--cat-color-rgb, 99, 102, 241), 0.1), 
        rgba(255, 255, 255, 0.95));
}

.category-item:hover .category-icon {
    transform: scale(1.1);
}

.category-item:hover .category-icon i {
    filter: drop-shadow(0 0 20px var(--cat-color, var(--primary-color)));
}

.category-item:hover .category-name {
    color: var(--cat-color, var(--primary-color));
}

/* Active state */
.category-item.active .category-circle {
    transform: scale(1.05);
}

.category-item.active .category-circle::after {
    background: linear-gradient(135deg, 
        rgba(var(--cat-color-rgb, 99, 102, 241), 0.2), 
        rgba(var(--cat-color-rgb, 99, 102, 241), 0.1));
}

/* ========================================
   Subcategories Dropdown
======================================== */
.subcategories-dropdown {
    position: absolute;
    top: calc(100% + 1rem);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 280px;
    max-width: 350px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1100;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .subcategories-dropdown {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .subcategories-dropdown .dropdown-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .subcategories-dropdown .dropdown-header span,
[data-theme="light"] .subcategories-dropdown .subcategory-name {
    color: #f8fafc;
}

[data-theme="light"] .subcategories-dropdown .subcategory-ads-count {
    color: #94a3b8;
}

/* السهم العلوي */
.subcategories-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .subcategories-dropdown::before {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

/* عرض القائمة */
.category-item.active .subcategories-dropdown,
.category-item:hover .subcategories-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* عنوان القائمة */
.dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .dropdown-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-header i {
    font-size: 1.25rem;
    color: var(--cat-color, var(--primary-color));
}

.dropdown-header span {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

/* قائمة الفئات الفرعية */
.subcategories-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* تخصيص scrollbar */
.subcategories-list::-webkit-scrollbar {
    width: 4px;
}

.subcategories-list::-webkit-scrollbar-track {
    background: transparent;
}

.subcategories-list::-webkit-scrollbar-thumb {
    background: var(--cat-color, var(--primary-color));
    border-radius: 2px;
}

/* عنصر الفئة الفرعية */
.subcategory-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.subcategory-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, 
        rgba(var(--cat-color-rgb, 99, 102, 241), 0.1), 
        transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.subcategory-item:hover::before {
    opacity: 1;
}

.subcategory-item:hover {
    transform: translateX(-5px);
}

.subcategory-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        rgba(var(--cat-color-rgb, 99, 102, 241), 0.2), 
        rgba(var(--cat-color-rgb, 99, 102, 241), 0.1));
    color: var(--cat-color, var(--primary-color));
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.subcategory-item:hover .subcategory-icon {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(var(--cat-color-rgb, 99, 102, 241), 0.4);
}

.subcategory-info {
    flex: 1;
    min-width: 0;
}

.subcategory-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
    transition: color 0.3s ease;
}

.subcategory-item:hover .subcategory-name {
    color: var(--cat-color, var(--primary-color));
}

.subcategory-ads-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.subcategory-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: all 0.3s ease;
    opacity: 0;
}

.subcategory-item:hover .subcategory-arrow {
    opacity: 1;
    transform: translateX(-5px);
}

/* رسالة لا توجد فئات فرعية */
.no-subcategories {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.no-subcategories i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.no-subcategories p {
    font-size: 0.9rem;
}

/* ========================================
   Pulse Animation Ring
======================================== */
.pulse-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--cat-color, var(--primary-color));
    opacity: 0;
    animation: pulseRing 2s ease-out infinite;
}

.category-item:hover .pulse-ring {
    animation-play-state: running;
}

/* ========================================
   Animations
======================================== */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes borderRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* ========================================
   Loading State
======================================== */
.categories-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(var(--primary-color-rgb, 99, 102, 241), 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 1200px) {
    .categories-grid {
        gap: 1.5rem;
    }
    
    .category-circle {
        width: 110px;
        height: 110px;
    }
    
    .category-icon {
        font-size: 2.2rem;
    }
}

@media (max-width: 992px) {
    .section-title {
        font-size: 2rem;
    }
    
    .categories-grid {
        gap: 1.25rem;
    }
    
    .category-circle {
        width: 100px;
        height: 100px;
    }
    
    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .category-name {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .categories-section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .categories-grid {
        gap: 1rem;
    }
    
    .category-circle {
        width: 85px;
        height: 85px;
    }
    
    .category-icon {
        width: 45px;
        height: 45px;
        font-size: 1.75rem;
    }
    
    .category-name {
        font-size: 0.85rem;
        max-width: 100px;
    }
    
    .subcategories-dropdown {
        min-width: 250px;
        max-width: 300px;
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(0.95) !important;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 1050 !important;
    }
    
    .category-item.active .subcategories-dropdown,
    .category-item:hover .subcategories-dropdown {
        transform: translate(-50%, -50%) scale(1) !important;
    }
    
    .subcategories-dropdown::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .categories-section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
    }
    
    .categories-grid {
        gap: 0.75rem;
    }
    
    .category-circle {
        width: 70px;
        height: 70px;
    }
    
    .category-icon {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    .category-name {
        font-size: 0.75rem;
        max-width: 80px;
        margin-top: 0.5rem;
    }
    
    .category-count {
        font-size: 0.7rem;
    }
}

/* ========================================
   Overlay for Mobile
======================================== */
.dropdown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Close button for mobile */
.dropdown-close {
    display: none;
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropdown-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .dropdown-close {
        display: flex;
    }
}

/* ========================================
   Ad Pages Panel (القائمة الثالثة - الصفحات الإعلانية)
======================================== */
.subcategories-container {
    display: flex;
    gap: 0;
    position: relative;
    z-index: 1000;
}

.subcategories-list {
    flex: 1;
    min-width: 250px;
}

.subcategory-item-wrapper {
    position: relative;
}

.subcategory-item.has-pages .subcategory-arrow {
    opacity: 1;
    color: var(--primary-color);
}

.ad-pages-panel {
    display: none;
    min-width: 250px;
    max-width: 280px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    border-right: 2px solid rgba(16, 185, 129, 0.4);
    border-radius: 12px;
    padding: 0;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(16, 185, 129, 0.1);
    backdrop-filter: blur(10px);
    z-index: 1001;
}

.ad-pages-panel.active {
    display: block;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* تمييز الفئة الفرعية المحددة */
.subcategory-item-wrapper.active .subcategory-item {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
}

.subcategory-item-wrapper.active .subcategory-item::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1));
}

/* رأس قائمة الصفحات */
.ad-pages-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.2));
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px 12px 0 0;
}

/* صورة الفئة الفرعية في رأس القائمة */
.ad-pages-header-image {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    object-fit: cover;
    border-radius: 50% !important;
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.5) !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0;
}

.ad-pages-header-image:hover {
    transform: scale(1.1);
    border-color: #8b5cf6 !important;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.5) !important;
}

/* أيقونة الفئة الفرعية في رأس القائمة (عند عدم وجود صورة) */
.ad-pages-header-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.1));
    border-radius: 50%;
    border: 2px solid #3b82f6;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ad-pages-header-icon:hover {
    transform: scale(1.1);
    border-color: #8b5cf6;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.ad-pages-header-icon i {
    font-size: 1rem;
    background: none !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
}

.ad-pages-header i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
}

.ad-pages-header span {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* عدد الصفحات في رأس القائمة */
.ad-pages-count {
    margin-right: auto;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.7) !important;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

/* قائمة الصفحات */
.ad-pages-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.ad-pages-list::-webkit-scrollbar {
    width: 4px;
}

.ad-pages-list::-webkit-scrollbar-track {
    background: transparent;
}

.ad-pages-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 2px;
}

/* عنصر الصفحة الإعلانية */
.ad-page-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-weight: 500;
}

.ad-page-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ad-page-item:hover::before {
    opacity: 1;
}

.ad-page-item:hover {
    color: #ffffff;
    transform: translateX(-3px);
}

.ad-page-item i {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 6px;
    color: #10b981;
    font-size: 0.8rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.ad-page-item:hover i {
    background: #10b981;
    color: white;
    transform: scale(1.1);
}

/* صورة الصفحة الإعلانية - تصميم دائري مميز */
.ad-page-item .ad-page-image {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.5) !important;
}

.ad-page-item:hover .ad-page-image {
    transform: scale(1.15);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.6) !important;
    border-color: #8b5cf6 !important;
}

.ad-page-item span {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}

/* أيقونات صفحات الإعلانات - التصميم الدائري المميز */
.ad-page-icon-wrapper {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3) !important;
}

.ad-page-icon-wrapper i {
    font-size: 0.95rem;
}

.ad-page-item:hover .ad-page-icon-wrapper {
    transform: scale(1.15);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.5) !important;
    border-color: #8b5cf6 !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.25));
}

/* صور الفئات الفرعية - التصميم الدائري المميز */
.subcategory-icon.circular-style {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4) !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

.subcategory-icon.circular-style .subcategory-image {
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}

.subcategory-icon.circular-style i {
    font-size: 1rem;
}

.subcategory-item:hover .subcategory-icon.circular-style {
    transform: scale(1.15);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.6) !important;
    border-color: #8b5cf6 !important;
}

/* زر عرض الكل */
.ad-pages-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.15));
    border-top: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 0 0 12px 12px;
    color: #10b981;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.ad-pages-view-all:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.ad-pages-view-all i {
    font-size: 0.85rem;
}

/* تعديل للشاشات الصغيرة */
@media (max-width: 768px) {
    .subcategories-container {
        flex-direction: column;
    }
    
    .ad-pages-panel {
        max-width: 100%;
        border-right: none;
        border-top: 1px solid rgba(16, 185, 129, 0.2);
    }
}
