/*
 Theme Name: Astra Child
 Theme URI: https://wpastra.com/
 Template: astra
 Author: Web Developer
 Description: Custom Child Theme for Astra
 Version: 1.0.1
*/


/* ==========================================================================
   إعدادات أزرار وتفاصيل الفيديو (متوافقة مع Astra)
   ========================================================================== */

/* تثبيت القائمة العلوية في قالب أسترا للكمبيوتر والجوال */
.site-header {
    position: sticky !important;
    top: 0;
    z-index: 99999;
    width: 100%;
}



.sandid-video-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    padding: 12px;
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid #2d2d2d;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    gap: 10px;
}

.action-item {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #999;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none !important;
    padding: 8px 5px;
    border-radius: 10px;
    transition: all .3s ease;
    background: 0 0;
    border: none;
    cursor: pointer;
}

.action-item svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: .2s;
    margin: 0;
}

.action-item:hover {
    background: rgba(255,255,255,.05);
    color: #fff;
}

.views-item { color: #00d2ff; cursor: default; }
.views-item svg { stroke: #00d2ff; }
.comments-count-item { color: #ffcc00; }
.comments-count-item svg { stroke: #ffcc00; }
.add-comment-btn { color: #2ed573; border: 1px solid rgba(46,213,115,.2); }
.download-btn { color: #ffa502; border: 1px solid rgba(255,165,2,.2); }
.desc-btn { color: #fff; border: 1px solid rgba(255,255,255,.1); }

/* تفاصيل الوصف */
.sandid-desc-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s cubic-bezier(0,1,.5,1), padding .4s;
    background-color: #1a1a1a;
    border-radius: 12px;
    margin-bottom: 20px;
}

.sandid-desc-wrapper.active {
    max-height: 3000px; /* تم زيادة الطول الأقصى قليلاً */
    overflow-y: auto; /* إضافة شريط تمرير داخلي إذا تجاوز النص الطول الأقصى */
    padding: 15px;
    border: 1px solid #2d2d2d;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    margin-top: 10px;
}

.sandid-desc-inner {
    display: block;
    color: #ddd;
    line-height: 1.8;
    font-size: 15px;
    padding: 10px 0;
    /* إجبار النص الطويل على النزول لسطر جديد وعدم الخروج عن المربع */
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* تأمين الصور أو النوافذ (Iframes) لكي لا تخرج عن إطار الهاتف */
.sandid-desc-inner img,
.sandid-desc-inner iframe {
    max-width: 100%;
    height: auto;
}

.sandid-desc-inner .aiovg-views,
.sandid-desc-inner .aiovg-comments,
.sandid-desc-inner .aiovg-count {
    display: none !important;
}

.sandid-desc-inner .aiovg-author,
.sandid-desc-inner .aiovg-date,
.sandid-desc-inner .aiovg-categories,
.sandid-desc-inner .aiovg-tags {
    display: inline-flex !important;
    align-items: center;
    background: rgba(255,255,255,.07);
    color: #eee !important;
    padding: 4px 12px;
    margin: 5px 3px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.1);
    font-size: 12px;
    font-weight: 500;
}

.sandid-desc-inner .aiovg-author a,
.sandid-desc-inner .aiovg-categories a,
.sandid-desc-inner .aiovg-tags a {
    color: #00d2ff !important;
    text-decoration: none !important;
    margin: 0 2px;
}

.sandid-desc-inner .aiovg-author:hover,
.sandid-desc-inner .aiovg-categories:hover,
.sandid-desc-inner .aiovg-tags:hover {
    background: #703030;
    border-color: #703030;
}

.sandid-desc-inner .aiovg-author a:hover,
.sandid-desc-inner .aiovg-categories a:hover,
.sandid-desc-inner .aiovg-tags a:hover { color: #fff !important; }
.sandid-desc-inner p { margin-bottom: 15px; }

/* ❌ تم إزالة السطر الذي كان يجبر أوسمة div و span على وضع inline-block مما كان يكسر التجاوب ❌ */

.sandid-desc-inner a {
    display: inline-block;
    margin: 4px 6px 4px 0;
    padding: 4px 12px;
    color: #00d2ff;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none !important;
    transition: all .3s ease;
}

/* ==========================================================================
   عناوين المقالات، الفيديوهات، والصفحات (تم التحديث لـ Astra)
   ========================================================================== */

.ast-single-post .entry-title,
.page .entry-title,
.single-aiovg_videos .entry-title,
[class*="aiovg"] .aiovg-video-title {
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    border-right: 5px solid #e60000 !important;
    padding: 5px 15px 5px 0 !important;
    color: inherit !important;
    font-size: 18px !important;
    line-height: 1.5 !important;
    font-weight: 800 !important;
    display: block !important;
    margin: 20px 0 !important;
    text-align: right !important;
}

/* التجاوب مع شاشات الموبايل للعناوين */
@media (max-width: 768px) {
    .ast-single-post .entry-title,
    .page .entry-title,
    .single-aiovg_videos .entry-title,
    [class*="aiovg"] .aiovg-video-title {
        font-size: 14px !important;
        line-height: 1.4 !important;
        border-right-width: 4px !important;
        padding: 12px 15px !important;
        margin: 10px 0 !important;
    }
}
/* ==========================================================================
   التعليقات والمربعات الإضافية
   ========================================================================== */

a { color: #000; text-decoration: none; }
.jscroll-to-top_link { display: none !important; }
textarea#comment { height: 70px !important; min-height: 70px !important; max-height: 400px !important; }

/* نافذة التنبيهات للتعليقات */
.comment-alert-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center;
    z-index: 9999; opacity: 0; visibility: hidden; transition: all .3s ease;
}
.comment-alert-overlay.active { opacity: 1; visibility: visible; }
.comment-alert-box {
    background: #50485b; padding: 30px; border-radius: 15px;
    max-width: 400px; width: 90%; text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,.2); transform: translateY(20px); transition: all .3s ease;
}
.comment-alert-overlay.active .comment-alert-box { transform: translateY(0); }
.comment-alert-box i { font-size: 50px; color: #ef4444; margin-bottom: 15px; display: block; }
.comment-alert-box h3 { margin: 0 0 10px; font-size: 18px; color: #333; }
.comment-alert-box p { margin: 0 0 20px; color: #666; font-size: 14px; line-height: 1.6; }
.comment-alert-box button {
    background: #3b82f6; color: #fff; border: none; padding: 10px 25px;
    border-radius: 8px; cursor: pointer; font-weight: 700; transition: background .2s;
}
.comment-alert-box button:hover { background: #2563eb; }

/* زر الإرسال */
#respond #commentform #submit {
    background-color: #d30c22 !important; color: #fff !important; border: none;
    padding: 5px 50px; font-weight: 700; border-radius: 4px; cursor: pointer; transition: background .3s ease;
}
#respond #commentform #submit:hover { background-color: #b10a1c !important; }
#respond #commentform #submit:focus { outline: 3px solid #000; outline-offset: 2px; }

/* صناديق المميزات (Feature & Toggle Boxes) */
.sandid-feature-box {
    display: flex; align-items: center; background-color: #1e1e1e;
    border-right: 4px solid #e74c3c; padding: 20px 25px; border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,.2); margin: 25px 0; gap: 20px;
    transition: all .3s ease; direction: rtl;
}
.sandid-feature-box:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(231,76,60,.15); }
.sandid-feature-box .feature-title {
    margin: 0; color: #fff; font-size: 1.3rem; font-weight: 700;
    white-space: nowrap; padding-left: 20px; border-left: 1px solid #444;
}
.sandid-feature-box .feature-text { margin: 0; color: #d1d1d1; font-size: 1rem; line-height: 1.7; }

.sandid-toggle-box {
    background-color: #1e1e1e; border-right: 4px solid #e74c3c; border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,.2); margin: 25px 0; direction: rtl; overflow: hidden; transition: all .3s ease;
}
.sandid-toggle-box summary::-webkit-details-marker { display: none; }
.sandid-toggle-box summary { list-style: none; }
.sandid-toggle-box .toggle-title {
    display: flex; align-items: center; justify-content: space-between; padding: 20px 25px;
    cursor: pointer; user-select: none; background-color: transparent; transition: background-color .3s ease;
}
.sandid-toggle-box .toggle-title:hover { background-color: rgba(255,255,255,.02); }
.sandid-toggle-box .toggle-title h3 { margin: 0; color: #fff; font-size: 1.3rem; font-weight: 700; }
.sandid-toggle-box .toggle-title::after { content: "\25BC"; color: #e74c3c; font-size: 1.1rem; transition: transform .3s ease; }
.sandid-toggle-box[open] .toggle-title::after { transform: rotate(180deg); }
.sandid-toggle-box[open] .toggle-title { border-bottom: 1px solid #333; }
.sandid-toggle-box .toggle-content { padding: 20px 25px; color: #d1d1d1; font-size: 1rem; line-height: 1.7; animation: slideDownFade .4s ease-in-out; }
.sandid-toggle-box .toggle-content p { margin: 0; }

@keyframes slideDownFade { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* إخفاء الميتا */
.entry-meta { display: none; }

/* إخفاء حقل البريد الإلكتروني والموقع وحفظ البيانات في نموذج التعليقات */
.comment-form-email, 
.comment-form-url, 
.comment-form-cookies-consent {
    display: none !important;
}
/* ==========================================================================
   التجاوب مع الشاشات الصغيرة (الموبايل)
   ========================================================================== */
@media (max-width: 768px) {
    .sandid-video-actions {
        display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 4px; padding: 8px 4px;
    }
    .action-item {
        flex: 1; flex-direction: column; padding: 6px 2px; font-size: 11px; gap: 5px; border-radius: 6px;
    }
    .action-item svg { width: 20px; height: 20px; margin: 0; }
    .action-item span { display: block; text-align: center; line-height: 1; white-space: nowrap; }
    
    .ast-single-post .entry-title,
    .single-aiovg_videos .entry-title,
    [class*="aiovg"] .aiovg-video-title {
        font-size: 14px !important;
        line-height: 1.4 !important;
        border-right-width: 4px !important;
        padding: 12px 15px !important;
        margin: 10px 0 !important;
    }
    
    .sandid-feature-box { flex-direction: column; align-items: flex-start; }
    .sandid-feature-box .feature-title {
        border-left: none; border-bottom: 1px solid #444; padding-left: 0; padding-bottom: 10px; white-space: normal; width: 100%;
    }
}


/* استهداف الصور المضافة يدوياً داخل الفقرات والأشكال في المحتوى فقط */
.entry-content p img,
.post-content p img,
.entry-content figure img,
.post-content figure img,
.gallery-icon img {
    max-width: 100% !important;
    height: auto !important;
    max-height: 70vh !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}




/* تحسين تباين ألوان ترقيم صفحات الفيديو - All-in-One Video Gallery */
body .aiovg-pagination-info.aiovg-text-muted,
body .aiovg-text-muted {
    color: #4a4a4a !important; 
}

/* إضافة العلامة المائية لمشغل الفيديو بأمان */
body .aiovg-player-container .video-js::after {
    content: 'x6x.live';
    position: absolute;
    bottom: 45px;
    right: 15px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 20px;
    font-weight: bold;
    font-family: Tahoma, Arial, sans-serif;
    z-index: 2147483647;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 12px;
    border-radius: 4px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
    transition: all 0.3s ease;
}

/* تكبير وتعديل مكان العلامة المائية عند الانتقال للشاشة الكاملة */
body .aiovg-player-container .video-js.vjs-fullscreen::after {
    bottom: 75px; 
    right: 25px;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.7);
}









/* تنسيقات مشغل الفيديو الخاصة بك تظل كما هي دون تغيير */
.vjs-click-catcher {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 50px); 
    z-index: 10;
    cursor: pointer;
}
.vjs-action-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    font-size: 40px;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
}
.vjs-action-icon.pop-anim {
    animation: popIconAnim 0.6s ease-out forwards;
}
@keyframes popIconAnim {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
