/* ═══════════════════════════════════════════════════════ */
/*  ARABIC EXPLANATION SLIDE PANEL — Premium Glassmorphism */
/* ═══════════════════════════════════════════════════════ */

#ar-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 999998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#ar-panel-overlay.open {
    opacity: 1;
    pointer-events: all;
}

#ar-panel {
    position: fixed;
    top: 0;
    right: -520px;
    width: 500px;
    max-width: 92vw;
    height: 100vh;
    background: rgba(5, 5, 15, 0.98);
    backdrop-filter: blur(40px) saturate(150%);
    border-left: 1px solid rgba(6, 182, 212, 0.15);
    z-index: 999999;
    transition: right 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    overflow-y: auto;
    overflow-x: hidden;
    direction: rtl;
    box-shadow: -30px 0 80px rgba(0, 0, 0, 0.9);
}

#ar-panel.open {
    right: 0;
}

#ar-panel::-webkit-scrollbar {
    display: none;
}

/* Sticky Header */
.ar-close {
    position: sticky;
    top: 0;
    padding: 20px 30px;
    background: rgba(5, 5, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(6, 182, 212, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.ar-close-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    transition: all 0.3s;
    direction: ltr;
}

.ar-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #EF4444;
    color: #EF4444;
    transform: rotate(90deg);
}

/* Content Area */
.ar-panel-content {
    padding: 30px 35px 80px;
}

.ar-ch-num {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.ar-ch-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 25px;
    line-height: 1.4;
}

.ar-body {
    font-family: 'Segoe UI', 'Dubai', Tahoma, sans-serif;
    font-size: 15px;
    line-height: 2.2;
    color: rgba(255, 255, 255, 0.8);
    overflow-x: auto; /* Handle long formulas */
}

.ar-body strong {
    color: #06B6D4;
    font-weight: 600;
}

.ar-body p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    font-weight: 400;
}

.ar-info-box {
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 14px;
    padding: 18px 22px;
    margin: 18px 0;
    line-height: 2;
}

.ar-info-box.warn {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

.ar-info-box.success {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}

.ar-info-box.gold {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
}

.ar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.2), transparent);
    margin: 25px 0;
}

/* Chapter Title Click Style */
.story-content h2[onclick] {
    cursor: pointer !important;
    transition: filter 0.3s ease;
}

.story-content h2[onclick]:hover {
    filter: brightness(1.3);
}

/* Section header h2 with onclick */
.section-header h2[onclick],
.reveal h2[onclick] {
    cursor: pointer !important;
}

@media (max-width: 768px) {
    #ar-panel {
        width: 100vw;
        max-width: 100vw;
        right: -100vw;
    }

    .ar-panel-content {
        padding: 20px 20px 60px;
    }

    .ar-ch-title {
        font-size: 1.4rem;
    }

    .ar-body {
        font-size: 14px;
        line-height: 2;
    }
}

/* Arabic Help Icon on Cards */
.ar-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 50%;
    color: var(--cyan);
    font-family: 'Space Mono', monospace;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    z-index: 100 !important;
    transition: all 0.3s ease;
    pointer-events: all;
}

.ar-icon:hover {
    background: var(--cyan);
    color: #000;
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--cyan);
}