/* ═══════════════════════════════════════════════════
   ASTRO AXES — المحاور الفلكية
   الإصدار: 2.0 (Unified)
   ───────────────────────────────────────────────────
   • موحّد بالكامل مع بطاقات الإنسايتس
   • border-radius: 15px في كل مكان
   • رأس البطاقة: شفاف عند الإغلاق، #21175a عند الفتح
   • الجوال والديسكتوب يستخدمان نفس التصميم
   ═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   1) Wrapper — الواجهة الخارجية
   ═══════════════════════════════════════════════════ */
.ac-axes-wrapper {
    margin: 0 4px 24px;
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════
   2) التابات الفرعية (ديسكتوب)
   ═══════════════════════════════════════════════════ */
.ac-axes-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-bottom: 16px;
    cursor: grab;
}
.ac-axes-tabs::-webkit-scrollbar { display: none; }
.ac-axes-tabs.dragging { cursor: grabbing; }
.ac-axes-tabs.dragging * { pointer-events: none; }

.ac-axis-tab {
    background: var(--ac-glass);
    border: 1px solid var(--ac-border);
    border-radius: 50px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 13px;
    color:#ffffffbf;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ac-axis-tab i {
    font-size: 14px;
    line-height: 1;
}
.ac-axis-tab:hover {
    border-color: var(--ac-purple);
    color: var(--ac-text);
}
.ac-axis-tab.active {
	
	  /* ✅ انحناءات جديدة عند النشاط */
    border-top-right-radius: 0px;
    border-bottom-left-radius: 0px;
    border-top-left-radius: 20px;
    border-bottom-right-radius: 20px;
	
    background: #d9c088;
    border-color: transparent;
    color: #4a1a78;
    box-shadow: 0 4px 20px rgba(164,53,254,0.4);
}
.ac-axis-tab:focus-visible {
    outline: 2px solid var(--ac-gold);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════
   3) حاوية اللوحات
   ═══════════════════════════════════════════════════ */
.ac-axes-panels {
    display: block;
}

/* ═══════════════════════════════════════════════════
   4) بطاقة المحور — موحّدة مع الإنسايتس
   ═══════════════════════════════════════════════════ */
.ac-axis-panel {
    background: var(--ac-glass);
    border: 1px solid var(--ac-border);
    border-radius: 15px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
    position: relative;
    /* ✅ إزاحة عند scrollIntoView — تحترم شريط التاب الرئيسي */
    scroll-margin-top: calc(var(--ac-main-tabs-h, 60px) + 8px);
}
.ac-axis-panel:hover {
    border-color: rgba(164,53,254,0.45);
}


/* ═══════════════════════════════════════════════════
   5) رأس البطاقة — موحّد (مغلق / مفتوح)
   ═══════════════════════════════════════════════════ */
.ac-axis-panel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    min-height: 64px;
    user-select: none;
    position: relative;
    z-index: 1;
    /* ✅ الحالة الافتراضية (مغلقة): شفاف */
    background: transparent;
    border-radius: 15px;
    transition: background 0.2s;
}



/* ═══════════════════════════════════════════════════
   6) عناوين الرأس
   ═══════════════════════════════════════════════════ */
.ac-axis-titles {
    flex: 1;
    min-width: 0;
}

.ac-axis-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--ac-gold);
    margin: 0 0 3px;
    letter-spacing: 0;
    line-height: 1.5;
}

.ac-axis-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--ac-text2);
    display: block;
    line-height: 1.5;
}

/* ✅ سهم مطابق تماماً لبطاقات الإنسايتس */
.ac-axis-arrow {
    display: none;
    width: 9px;
    height: 9px;
    flex: none;
    font-size: 0;
    color: transparent;
    border-right: 2px solid var(--ac-text2);
    border-bottom: 2px solid var(--ac-text2);
    transform: rotate(45deg);
    margin: -4px 0 0;
    transition: transform .3s ease, margin .3s ease;
}

/* ═══════════════════════════════════════════════════
   7) جسم البطاقة
   ═══════════════════════════════════════════════════ */
.ac-axis-body {
    padding: 18px 16px 0;
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════
   8) السطر المختصر (Surface)
   ═══════════════════════════════════════════════════ */
.ac-axis-surface {
    font-size: 14px;
    color: var(--ac-gold);
    margin: 0 0 18px;
    padding: 10px 14px;
    background: rgba(217,192,136,0.06);
    border-right: 3px solid var(--ac-gold);
    border-radius: 8px;
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════
   9) عناصر المحور
   ═══════════════════════════════════════════════════ */
.ac-axis-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ac-axis-item {
    background: var(--ac-glass2);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--ac-radius2);
    padding: 14px 16px;
    transition: border-color 0.2s;
}
.ac-axis-item:hover {
    border-color: rgba(164,53,254,0.3);
}

.ac-axis-item-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--ac-gold);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.ac-axis-item-text {
    font-size: 14px;
    color: var(--ac-text);
    line-height: 1.8;
    margin: 0;
}

/* ═══════════════════════════════════════════════════
   10) الفقرات السردية
   ═══════════════════════════════════════════════════ */
.ac-axis-narrative {
    font-size: 15px;
    line-height: 2;
    color: var(--ac-text);
    margin: 0 0 16px;
    padding: 18px 22px;
    border-radius: 12px;
    text-align: justify;
    direction: rtl;
    position: relative;
}

.ac-axis-narrative-core {
    background: linear-gradient(135deg, rgba(217,192,136,0.06), rgba(217,192,136,0.02));
    border-right: 3px solid var(--ac-purple);
}

.ac-axis-narrative-aspects {
    background: linear-gradient(135deg, rgba(217,192,136,0.06), rgba(217,192,136,0.02));
    border-right: 3px solid var(--ac-gold);
}

/* ═══════════════════════════════════════════════════
   11) قسم الأدلة التفصيلية
   ═══════════════════════════════════════════════════ */
.ac-axis-details {
    margin-top: 20px;
    border-top: 1px solid var(--ac-border);
    padding-top: 14px;
}

.ac-axis-details summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 14px;
    background: var(--ac-glass);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius2);
    color: var(--ac-gold);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ac-axis-details summary::-webkit-details-marker { display: none; }

.ac-axis-details summary::before {
    content: '◈';
    color: var(--ac-purple);
    font-size: 14px;
}

.ac-axis-details summary::after {
    content: '▾';
    margin-right: auto;
    color: var(--ac-purple);
    font-size: 11px;
    transition: transform 0.25s;
}
.ac-axis-details[open] summary::after {
    transform: rotate(180deg);
}
.ac-axis-details summary:hover {
    background: var(--ac-glass2);
    border-color: var(--ac-purple);
}

.ac-axis-details-body {
    margin-top: 14px;
    animation: ac-fadeUp 0.3s ease;
}

.ac-axis-details-group-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--ac-gold);
    margin: 14px 0 8px;
    padding-right: 10px;
    border-right: 2px solid var(--ac-purple);
    letter-spacing: 0.5px;
}
.ac-axis-details-group-title:first-child {
    margin-top: 0;
}

/* ═══════════════════════════════════════════════════
   12) مجموعات الاتصالات
   ═══════════════════════════════════════════════════ */
.ac-axis-aspect-groups {
    margin-top: 16px;
}

.ac-axis-aspect-transition {
    font-size: 13px;
    color: var(--ac-text2);
    font-style: italic;
    text-align: center;
    margin: 16px 0 12px;
    padding: 8px 12px;
    border-top: 1px dashed rgba(217,192,136,0.2);
    border-bottom: 1px dashed rgba(217,192,136,0.2);
    line-height: 1.7;
}

.ac-axis-narrative-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ac-gold);
    margin-bottom: 8px;
    padding-right: 10px;
    border-right: 3px solid var(--ac-purple);
    letter-spacing: 0.5px;
}

.ac-axis-narrative-aspects .ac-axis-narrative-text {
    font-size: 14.5px;
    line-height: 2;
    color: var(--ac-text);
    margin: 0;
    text-align: justify;
}

/* ═══════════════════════════════════════════════════
   13) الفقرات داخل السرد
   ═══════════════════════════════════════════════════ */
.ac-axis-para {
    margin: 0 0 14px;
    line-height: 1.9;
    color: var(--ac-text);
    text-align: justify;
    direction: rtl;
}
.ac-axis-para:last-child {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════
   14) التاب الرئيسي (نفسية / عملية) — pill
   ═══════════════════════════════════════════════════ */
.ac-main-tabs-wrap {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--ac-bg);
    padding: 10px 10px 12px;
    margin: 0 -10px 16px;
}

.ac-main-tabs {
    display: flex;
    position: relative;
    gap: 0;
    padding: 4px;
    background-image: linear-gradient(to right, #25145c 5%, #a435fe 130%);
    border: 1px solid #5b2fb766;
    border-radius: 20px 0 20px 0;
    max-width: 360px;
    margin: 0 auto;

}

.ac-main-pill {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0px;
    width: 0;
    /* ✅ تدرج ذهبي (فاتح فوق، داكن تحت) */
    background: linear-gradient(180deg, #e0c88e 0%, var(--ac-gold) 40%, #b89c5a 100%);
    border-radius: 20px 0 20px 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                width   0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    /* ✅ ظلال أنيقة — بلا توهج */
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.25),
      inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

.ac-main-tab {
    flex: 1;
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: 0;
    background: transparent;
    color: #d9c088;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    border-radius: 50px;
    transition: color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}
.ac-main-tab:focus-visible {
    outline: 2px solid var(--ac-gold);
    outline-offset: 2px;
}
.ac-main-tab.active {
    color: #4a1a78;
    font-weight: 700;
}

.ac-main-tab-icon {
    font-size: 15px;
    line-height: 1;
}

/* ═══════════════════════════════════════════════════
   15) محتوى المجموعة
   ═══════════════════════════════════════════════════ */
.ac-group-content {
    display: none;
}
.ac-group-content.active {
    display: block;
    animation: ac-fadeUp 0.35s ease;
}

/* ═══════════════════════════════════════════════════
   16) زر إغلاق المحور (يظهر على الجوال فقط عند الفتح)
   ═══════════════════════════════════════════════════ */
.ac-axis-close {
    display: none;
    width: 100%;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 0;
    border-top: 1px solid rgba(91,47,176,0.6);
    background: transparent;
    color: var(--ac-gold);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 0 15px 15px;
    transition: background 0.2s;
}
.ac-axis-close:hover {
    background: rgba(217, 192, 136, 0.06);
}
.ac-axis-close:focus-visible {
    outline: 2px solid var(--ac-gold);
    outline-offset: -2px;
}

/* ═══════════════════════════════════════════════════
   17) سطح المكتب
   ═══════════════════════════════════════════════════ */
@media (min-width: 769px) {
	
	.ac-axes-wrapper .ac-axis-panel.active {
        border-color: rgba(164,53,254,0.55);
    }
	
	    /* رأس اللوحة النشطة */
    .ac-axes-wrapper .ac-axis-panel.active .ac-axis-panel-header {
        background: #21175a;
        border-bottom: 1px solid rgba(91,47,176,0.6);
        border-radius: 15px 15px 0 0;
    }
	
    .ac-axes-wrapper .ac-axis-panel {
        display: none;
        overflow: hidden;
    }
    .ac-axes-wrapper .ac-axis-panel.active {
        display: block;
        animation: ac-fadeUp 0.3s ease;
    }
    .ac-axes-wrapper .ac-axis-body {
        padding-top: 18px;
    }

    /* التابات الفرعية sticky */
    .ac-axes-tabs {
        position: sticky;
        top: var(--ac-main-tabs-h, 60px);
        z-index: 20;
        background: var(--ac-bg);
        padding: 12px 0;
        margin: 0 0 16px;
		 justify-content: center;   /* ✅ جديد — توسيط أفقي */
    }

    /* زر الإغلاق لا يظهر على سطح المكتب */
    .ac-axis-close {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════
   18) الجوال — أكورديون
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
	
	    .ac-axis-panel.open {
        border-color: rgba(164,53,254,0.55);
    }
	
	    .ac-axis-panel.open .ac-axis-panel-header {
        position: sticky;
        top: var(--ac-main-tabs-h, 60px);
        z-index: 20;
        background: #21175a;
        border-bottom: 1px solid rgba(91,47,176,0.6);
        border-radius: 15px 15px 0 0;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    }
	
    /* التابات الفرعية تُخفى */
    .ac-axes-tabs {
        display: none;
    }

    /* كل اللوحات تظهر كأكورديون */
    .ac-axis-panel {
        display: block !important;
        overflow: visible;
        margin-bottom: 12px;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--ac-glass);
    }

    /* الرأس: قابل للنقر (أكورديون) */
    .ac-axis-panel-header {
        display: flex;
        cursor: pointer;
        padding: 12px 14px;
        min-height: 56px;
        gap: 10px;
        border-radius: 15px;
        transition: background 0.2s;
    }

    /* hover فقط عند الإغلاق */
    .ac-axis-panel:not(.open) .ac-axis-panel-header:hover,
    .ac-axis-panel:not(.open) .ac-axis-panel-header:active {
        background: var(--ac-glass2);
    }

    .ac-axis-panel-header:focus-visible {
        outline: 2px solid var(--ac-gold);
        outline-offset: -2px;
    }

    /* أحجام مصغّرة تطابق الإنسايتس */
    .ac-axis-panel-header .ac-card-summary-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .ac-axis-title {
        font-size: 15px;
    }
    .ac-axis-subtitle {
        font-size: 13px;
    }
    .ac-axis-close {
        font-size: 14px;
        min-height: 50px;
    }

    /* السهم */
    .ac-axis-arrow {
        display: inline-block;
    }
       .ac-axis-panel.open .ac-axis-arrow {
        margin: 4px 0 0;
        transform: rotate(-135deg);
    }

    /* الجسم: مخفي حتى الفتح */
    .ac-axis-body {
        display: none;
    }
    .ac-axis-panel.open .ac-axis-body {
        display: block;
        animation: ac-fadeUp 0.3s ease;
    }

    /* sticky header عند الفتح */
    .ac-axis-panel.open .ac-axis-panel-header {
        position: sticky;
        top: var(--ac-main-tabs-h, 60px);
        z-index: 20;
        background: #21175a;
        border-bottom: 1px solid rgba(91,47,176,0.6);
        border-radius: 15px 15px 0 0;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    }

    /* زر الإغلاق يظهر عند الفتح فقط */
    .ac-axis-panel.open .ac-axis-close {
        display: flex;
    }
}

/* ═══════════════════════════════════════════════════
   19) إصلاح sticky على الجوال (تجاوز l-canvas)
   ═══════════════════════════════════════════════════ */
body:has(.ac-axes-wrapper) .l-canvas {
    overflow: visible;
    overflow-x: clip;
}

/* ═══════════════════════════════════════════════════
   20) المصادر الرئيسية (95%+)
   ═══════════════════════════════════════════════════ */
.ac-axis-primary-sources {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.ac-axis-primary-item {
    background: linear-gradient(135deg, rgba(164,53,254,0.06), rgba(164,53,254,0.02));
    border-right: 3px solid var(--ac-purple);
    border-radius: 12px;
    padding: 16px 20px;
}

.ac-axis-primary-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ac-gold);
    margin-bottom: 8px;
    padding-right: 8px;
    border-right: 2px solid var(--ac-gold);
    letter-spacing: 0.3px;
}

.ac-axis-primary-text {
    font-size: 14.5px;
    line-height: 1.9;
    color: var(--ac-text);
    margin: 0;
    text-align: justify;
}

/* ═══════════════════════════════════════════════════
   21) النجوم الثابتة
   ═══════════════════════════════════════════════════ */
.ac-axis-fixed-stars {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed rgba(217, 192, 136, 0.25);
}

.ac-axis-fixed-stars-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ac-gold);
    margin-bottom: 12px;
    padding-right: 10px;
    border-right: 3px solid var(--ac-gold);
    line-height: 1.7;
}

.ac-axis-fixed-star-item {
    margin-bottom: 14px;
    padding-right: 12px;
}
.ac-axis-fixed-star-item:last-child {
    margin-bottom: 0;
}

.ac-axis-fixed-star-head {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ac-text);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════
   22) تعديلات أحجام الجوال للنصوص الطويلة
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .ac-axis-narrative {
        font-size: 14px;
        line-height: 1.9;
        padding: 14px 16px;
    }
    .ac-axis-narrative-aspects .ac-axis-narrative-text {
        font-size: 13.5px;
        line-height: 1.9;
    }
    .ac-axis-narrative-label {
        font-size: 11.5px;
    }
    .ac-axis-aspect-transition {
        font-size: 12px;
    }
    .ac-axis-para {
        line-height: 1.85;
        margin-bottom: 12px;
    }
    .ac-axis-primary-item {
        padding: 12px 16px;
    }
    .ac-axis-primary-title {
        font-size: 12px;
    }
    .ac-axis-primary-text {
        font-size: 14px;
        line-height: 1.85;
    }
    .ac-axis-fixed-stars-title {
        font-size: 12px;
    }
    .ac-axis-fixed-star-head {
        font-size: 13px;
    }
    .ac-main-tabs-wrap {
        padding: 8px 6px 10px;
        margin: 0 -6px 12px;
    }
    .ac-main-tabs {
        max-width: 100%;
    }
    .ac-main-tab {
        padding: 8px 12px;
        font-size: 12.5px;
    }
    .ac-main-tab-icon {
        font-size: 14px;
    }
}