/* ============================================
   news-share.css
   أنماط أزرار مشاركة الأخبار
   متوافق مع: RTL, التصميم الحالي للموقع
   الألوان الأساسية: primary #8CC63F
   ============================================ */

/* ---- ألوان المنصات ---- */
:root {
    --share-whatsapp: #25D366;
    --share-whatsapp-hover: #1EBE5A;
    --share-facebook: #1877F2;
    --share-facebook-hover: #0D65D9;
    --share-instagram-gradient: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    --share-instagram-hover: linear-gradient(45deg, #e08529, #d95d34, #d0213b, #bf1e5c, #ab1579);
    --share-telegram: #0088CC;
    --share-telegram-hover: #0077B5;
    --share-copy: #6B7280;
    --share-copy-hover: #4B5563;

    /* أحجام */
    --share-btn-size: 44px;
    --share-btn-size-sm: 38px;
    --share-icon-size: 18px;
    --share-icon-size-sm: 15px;
}

/* ============================================
   1. شريط المشاركة (داخل المودال وصفحة الخبر)
   ============================================ */

.share-bar {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.share-bar-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1.25rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #6B7280;
}

.share-bar-title::before,
.share-bar-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    max-width: 80px;
}

.share-bar-title i {
    color: #8CC63F;
    font-size: 1rem;
}

.share-buttons-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* ============================================
   2. زر المشاركة الأساسي
   ============================================ */

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--share-btn-size);
    height: var(--share-btn-size);
    border-radius: 50%;
    border: 2px solid transparent;
    background: #f3f4f6;
    color: #6B7280;
    font-size: var(--share-icon-size);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 1;
}

/* تأثير الخلفية المتحركة */
.share-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.share-btn:hover::before {
    transform: scale(1);
}

.share-btn:hover {
    color: white;
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: transparent;
}

.share-btn:active {
    transform: translateY(-2px) scale(1.05);
}

/* تأثير التموج (ripple) عند الضغط */
.share-btn .share-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: shareRipple 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes shareRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   3. ألوان كل منصة
   ============================================ */

/* واتساب */
.share-btn--whatsapp::before {
    background: var(--share-whatsapp);
}

.share-btn--whatsapp:hover {
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.35);
}

/* فيسبوك */
.share-btn--facebook::before {
    background: var(--share-facebook);
}

.share-btn--facebook:hover {
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.35);
}

/* إنستقرام */
.share-btn--instagram::before {
    background: var(--share-instagram-gradient);
}

.share-btn--instagram:hover {
    box-shadow: 0 8px 25px rgba(225, 48, 108, 0.35);
}

/* تلقرام */
.share-btn--telegram::before {
    background: var(--share-telegram);
}

.share-btn--telegram:hover {
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.35);
}

/* نسخ الرابط */
.share-btn--copy::before {
    background: #8CC63F;
}

.share-btn--copy:hover {
    box-shadow: 0 8px 25px rgba(140, 198, 63, 0.35);
}

/* حالة "تم النسخ" */
.share-btn--copy.copied {
    background: #8CC63F;
    color: white;
    border-color: transparent;
}

.share-btn--copy.copied::before {
    transform: scale(1);
}

/* ============================================
   4. أنيميشن ظهور الأزرار (stagger)
   ============================================ */

.share-buttons-row .share-btn {
    opacity: 0;
    transform: translateY(12px) scale(0.8);
    animation: shareButtonAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.share-buttons-row .share-btn:nth-child(1) { animation-delay: 0.05s; }
.share-buttons-row .share-btn:nth-child(2) { animation-delay: 0.1s; }
.share-buttons-row .share-btn:nth-child(3) { animation-delay: 0.15s; }
.share-buttons-row .share-btn:nth-child(4) { animation-delay: 0.2s; }
.share-buttons-row .share-btn:nth-child(5) { animation-delay: 0.25s; }

@keyframes shareButtonAppear {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   5. Tooltip (تسمية المنصة)
   ============================================ */

.share-btn[data-tooltip] {
    position: relative;
}

.share-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1a1a1a;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    padding: 5px 12px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* سهم الـ tooltip */
.share-btn[data-tooltip]::after {
    --arrow-size: 5px;
}

.share-btn:hover[data-tooltip]::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   6. رسالة Toast (تم النسخ)
   ============================================ */

.share-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(140, 198, 63, 0.3);
}

.share-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.share-toast i {
    color: #8CC63F;
    font-size: 1.1rem;
}

.share-toast--instagram {
    border-color: rgba(225, 48, 108, 0.3);
}

.share-toast--instagram i {
    background: var(--share-instagram-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   7. قائمة المشاركة المنبثقة (في بطاقات الأخبار)
   ============================================ */

.share-dropdown-wrapper {
    position: relative;
    display: inline-flex;
}

/* زر المشاركة الصغير في البطاقة */
.share-trigger-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(140, 198, 63, 0.08);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8CC63F;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.share-trigger-btn:hover {
    background: rgba(140, 198, 63, 0.18);
    transform: rotate(5deg) scale(1.08);
}

.share-trigger-btn:active {
    transform: scale(0.95);
}

/* القائمة المنبثقة */
.share-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(8px) scale(0.9);
    background: white;
    border-radius: 16px;
    padding: 10px;
    display: flex;
    gap: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 50;
    white-space: nowrap;
}

/* سهم القائمة */
.share-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: white;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.05));
}

.share-dropdown.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* أزرار داخل القائمة المنبثقة */
.share-dropdown .share-btn {
    width: var(--share-btn-size-sm);
    height: var(--share-btn-size-sm);
    font-size: var(--share-icon-size-sm);
}

/* أنيميشن الأزرار داخل القائمة */
.share-dropdown.open .share-btn {
    opacity: 0;
    animation: dropdownBtnAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.share-dropdown.open .share-btn:nth-child(1) { animation-delay: 0.05s; }
.share-dropdown.open .share-btn:nth-child(2) { animation-delay: 0.1s; }
.share-dropdown.open .share-btn:nth-child(3) { animation-delay: 0.15s; }
.share-dropdown.open .share-btn:nth-child(4) { animation-delay: 0.2s; }
.share-dropdown.open .share-btn:nth-child(5) { animation-delay: 0.25s; }

@keyframes dropdownBtnAppear {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* محاذاة القائمة المنبثقة داخل بطاقات الأخبار */
.card-footer .share-dropdown {
    left: 0;
    right: auto;
    transform: translateY(8px) scale(0.9);
    transform-origin: bottom left;
}

.card-footer .share-dropdown.open {
    transform: translateY(0) scale(1);
}

.card-footer .share-dropdown::after {
    left: 18px;
    transform: none;
}

/* ============================================
   8. أزرار وتنسيقات صفحة الخبر المستقلة
   ============================================ */

.share-section {
    background: linear-gradient(135deg, rgba(140, 198, 63, 0.05) 0%, rgba(140, 198, 63, 0.02) 100%);
    border: 1px solid rgba(140, 198, 63, 0.15);
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.share-section .share-bar {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.share-section .share-bar-title {
    margin-bottom: 1rem;
    color: #4a5568;
    font-size: 0.95rem;
}

.share-section .share-bar-title::before,
.share-section .share-bar-title::after {
    background: linear-gradient(90deg, transparent, rgba(140, 198, 63, 0.25), transparent);
}

/* تنسيق متوازن لصورة الخبر البارزة */
.news-featured-image-wrapper {
    position: relative;
    max-height: 420px;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.news-featured-image-wrapper img {
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

/* تنسيق نصوص ومحتوى المقال */
.news-content-body {
    line-height: 2.2;
    color: #2d3748;
    font-size: 1.05rem;
}

.news-content-body p {
    margin-bottom: 1.5rem;
}

.news-content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 1.5rem auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.news-content-body h2,
.news-content-body h3,
.news-content-body h4 {
    color: #1a202c;
    font-weight: 800;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-family: 'Cairo', sans-serif;
}

/* بطاقات الأخبار المقترحة ذات الصلة */
.related-news-card {
    background: white;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.related-news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(140, 198, 63, 0.15);
    border-color: rgba(140, 198, 63, 0.3);
}

/* ============================================
   9. تصميم متجاوب (Responsive)
   ============================================ */

/* شاشات صغيرة */
@media (max-width: 640px) {
    :root {
        --share-btn-size: 40px;
        --share-btn-size-sm: 34px;
        --share-icon-size: 16px;
        --share-icon-size-sm: 14px;
    }

    .share-buttons-row {
        gap: 10px;
    }

    .share-bar-title {
        font-size: 0.8rem;
    }

    .share-dropdown {
        padding: 8px;
        gap: 6px;
        border-radius: 14px;
    }

    .share-toast {
        font-size: 0.78rem;
        padding: 10px 22px;
        bottom: 20px;
    }

    .share-section {
        padding: 1.25rem;
    }
}

/* شاشات متوسطة */
@media (max-width: 768px) {
    .share-bar-title::before,
    .share-bar-title::after {
        max-width: 50px;
    }
}

/* ============================================
   10. RTL Support (دعم الاتجاه من اليمين لليسار)
   ============================================ */

[dir="rtl"] .share-buttons-row {
    direction: rtl;
}

[dir="rtl"] .share-toast {
    direction: rtl;
}

/* ============================================
   11. إمكانية الوصول (Accessibility)
   ============================================ */

.share-btn:focus-visible {
    outline: 3px solid #8CC63F;
    outline-offset: 3px;
}

.share-trigger-btn:focus-visible {
    outline: 3px solid #8CC63F;
    outline-offset: 2px;
}

/* تقليل الحركة لمن يفضّل ذلك */
@media (prefers-reduced-motion: reduce) {
    .share-btn,
    .share-btn::before,
    .share-dropdown,
    .share-toast,
    .share-buttons-row .share-btn,
    .share-dropdown.open .share-btn {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   12. الوضع الداكن (اختياري — لاستخدام مستقبلي)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .share-btn {
        background: rgba(255, 255, 255, 0.08);
        color: #9CA3AF;
    }

    .share-dropdown {
        background: #1f2937;
        border-color: rgba(255, 255, 255, 0.08);
    }

    .share-dropdown::after {
        border-top-color: #1f2937;
    }

    .share-section {
        background: rgba(140, 198, 63, 0.06);
        border-color: rgba(140, 198, 63, 0.15);
    }
}

/* ============================================
   13. Hero Section لصفحة الخبر المستقلة
   ============================================ */

.single-news-hero {
    background: linear-gradient(135deg, #13240e 0%, #1c3811 50%, #0c1808 100%);
    position: relative;
    overflow: hidden;
    padding-top: 130px;
    padding-bottom: 95px;
}

@media (min-width: 768px) {
    .single-news-hero {
        padding-top: 155px;
        padding-bottom: 120px;
    }
}

.single-news-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 70%, rgba(140, 198, 63, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 75% 25%, rgba(237, 28, 36, 0.08) 0%, transparent 35%);
    pointer-events: none;
}

.single-news-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(140, 198, 63, 0.3);
    color: #8CC63F;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.single-news-hero-title {
    color: #ffffff;
    font-family: 'Cairo', sans-serif;
    font-weight: 900;
    line-height: 1.35;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.single-news-hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-family: 'Cairo', sans-serif;
}

.single-news-hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.single-news-hero-meta-item i {
    color: #8CC63F;
}

/* بطاقة الصورة المتداخلة مع الهيرو */
.single-news-image-overlap {
    position: relative;
    z-index: 20;
    margin-top: -65px;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .single-news-image-overlap {
        margin-top: -90px;
    }
}

.single-news-image-frame {
    max-width: 880px;
    margin: 0 auto;
    border-radius: 1.5rem;
    overflow: hidden;
    background: #ffffff;
    padding: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 4px 20px rgba(140, 198, 63, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.single-news-image-frame img {
    width: 100%;
    height: auto;
    max-height: 430px;
    object-fit: cover;
    border-radius: 1.15rem;
    display: block;
}

