/* utilities.css */

.nav-icon {
    width: 30px;
    height: 30px;
    transition: all 200ms;
}
.nav-btn .nav-icon {
    filter: none;
    opacity: 1;
}

.nav-btn-center {
    position: relative;
    z-index: 50;
    transition: all 200ms;
}
.center-nav-icon {
    width: 40px;
    height: 40px;
    filter: none;
    opacity: 1;
}

.interaction-icon {
    width: 24px;
    height: 24px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 200ms;
    margin-left: 0.5rem;
}
#share-btn .interaction-icon {
    filter: none;
    opacity: 1;
}

.like-dislike-group, .interaction-pill-btn, #share-btn-youtube {
    background-color: #f3f4f6 !important;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #1f2937;
    transition: background-color 0.2s;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}
.like-dislike-group:hover, .interaction-pill-btn:hover, #share-btn-youtube:hover {
    background-color: #f3f4f6 !important;
}
.like-dislike-group {
    padding: 0;
}
.like-dislike-group .like-btn, .like-dislike-group .dislike-btn {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
}

.interaction-pill-btn, #share-btn-youtube {
    padding: 0.5rem 1.25rem;
    gap: 0.5rem;
}

.interaction-pill-btn img, #share-btn-youtube img {
    filter: none;
    opacity: 1;
    margin: 0;
}

.like-dislike-group .interaction-icon {
    filter: none;
    opacity: 1;
    color: #4b5563;
}

.like-active {
    background-color: #e0f2f1 !important;
}

.like-active img {
    filter: invert(36%) sepia(85%) saturate(3015%) hue-rotate(198deg) brightness(98%) contrast(92%);
    opacity: 1;
}

.dislike-active {
    background-color: #e5e7eb !important;
}

.dislike-active img {
    filter: invert(33%) sepia(97%) saturate(7440%) hue-rotate(352deg) brightness(85%) contrast(100%);
    opacity: 1;
}

.like-dislike-group .like-btn span {
    font-weight: 600;
    margin-right: 0.25rem;
}
#share-btn-youtube span {
    font-weight: 600;
}

#details .favorite-active {
    background-color: #fef3c7 !important;
}
#details .favorite-active span, #details .favorite-active .interaction-icon {
    color: #b45309 !important;
}

#publisher-name-display {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-top: 0.5rem;
}

.reaction-feedback-icon {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    z-index: 1000;
    width: 100px;
    height: 100px;
    opacity: 0;
    pointer-events: none;
    animation: floating-feedback 1s ease-out forwards;
    background-color: transparent !important;
    border: none !important;
}

.like-feedback-icon {
    filter: invert(36%) sepia(85%) saturate(3015%) hue-rotate(198deg) brightness(98%) contrast(92%);
}
.dislike-feedback-icon {
    filter: invert(33%) sepia(97%) saturate(7440%) hue-rotate(352deg) brightness(85%) contrast(100%);
}

@keyframes floating-feedback {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -100%) scale(1);
    }
}

/* ================================================= */
/* ===== ✅ كود التحكم في زر تثبيت PWA ===== */
/* ================================================= */

/* 🌟 القاعدة الجديدة: الزر ظاهر دائمًا بشكل افتراضي ما لم يكن التطبيق مثبتًا بالفعل 🌟 */
.pwa-install-button {
    display: none !important; /* إخفاء الزر افتراضياً */
}

/* إظهار الزر فقط إذا كان المتصفح يدعم التثبيت (الفئة installable) */
body.installable .pwa-install-button {
    display: flex !important;
}


/* =============================================== */
/* ===== ✅ نهاية كود التحكم في زر تثبيت PWA ===== */
/* =============================================== */

/* =============================================== */
/* ===== NEW: Clear Cache Button Styles      ===== */
/* =============================================== */

.clear-cache-button {
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #ef4444;
    background-color: transparent;
    color: #ef4444;
    font-weight: bold;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.4;
    animation: fadeIn 1s ease-in-out;
}

.clear-cache-button:hover {
    background-color: #ef4444;
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================================= */
/* ===== NEW: Admin Comment Checkmark Styles (GIF) ===== */
/* ================================================= */

.admin-check-gif {
    /* 🛑 NEW: تنسيق صورة GIF 🛑 */
    width: 18px; /* حجم مناسب */
    height: 18px;
    margin-right: 0.25rem;
    position: relative;
    top: -1px;
    /* إضافة ظل خفيف لتمييزها عن الخلفية */
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.4));
}

/* 🛑 تمييز خلفية تعليق المشرف (لتعليقات الصفحة الكلاسيكية) */
.bg-blue-50.border-r-4.border-red-600 {
    background-color: #f1f8ff !important; /* لون أزرق فاتح جداً */
    border-color: #dc2626 !important; /* حدود حمراء للتمييز */
    border-radius: 0.75rem !important;
}

/* 🛑 FIX: تنسيق شارة التوثيق ملاصقة للاسم (لصفحات التفاصيل والملف الشخصي) 🛑 */
.flex-items-center-no-shrink {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
    /* 🛑 إضافة margin-left: auto; لضمان أنها تلتصق بالاسم في نهاية السطر 🛑 */
    margin-left: auto;
}
.verified-user-badge, .admin-check-gif {
    margin-right: 0;
    margin-left: 0.25rem;
    flex-shrink: 0;
}
/* ================================================= */

/* ---------------------------------------------------- */
/* ===== NEW: Home Page Carousel Styles (Google Play Style) ===== */
/* ---------------------------------------------------- */

/* 🌟 NEW: تنسيقات Carousel الفيديوهات (حجم مشابه) */
#home-videos-carousel {
    /* نفس خصائص Carousel الصور لتنسيق الدوران */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#home-videos-carousel::-webkit-scrollbar {
    display: none;
}
.video-carousel-item {
    width: 320px; /* حجم ثابت للعرض في الكاروسيل */
    height: 180px; /* نسبة 16:9 */
    scroll-snap-align: start;
    position: relative; /* لتحديد موقع زر التشغيل */
}

/* 🛑 FIX: ضمان أن عنصر الفيديو يملأ الحاوية الثابتة 🛑 */
.video-carousel-item video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* لملء المساحة المتاحة دون تشويه */
}

/* 🌟 NEW: تنسيقات Carousel الصور (حجم متجر التطبيقات) */
#screenshots-carousel {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#screenshots-carousel::-webkit-scrollbar {
    display: none;
}

/* 🛑 FIX: تعديل الحجم لصور الشاشة كما طلب لـ w-36 h-64 🛑 */
.app-store-screenshot {
     width: 9rem; /* w-36 */
     height: 16rem; /* h-64 */
     scroll-snap-align: start;
}

/* ---------------------------------------------------- */
/* ===== NEW: Image Modal Viewer (Swiping functionality) ===== */
/* ---------------------------------------------------- */
#image-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#image-carousel-viewer {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    display: flex;
    -webkit-overflow-scrolling: touch;
    overflow-y: hidden; /* منع التمرير الرأسي */
}

.viewer-image-container {
    flex-shrink: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
}

.viewer-image-container img {
    max-width: 95%;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
}

#close-viewer-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 40px;
    font-weight: 100;
    z-index: 9010;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#viewer-index-display {
    position: absolute;
    bottom: 20px;
    color: white;
    font-size: 14px;
    z-index: 9010;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 15px;
}

/* ✅ [بداية الإضافة] تنسيقات قسم تفاصيل التطبيق */
.app-details-container {
    border-top: 1px solid #e5e7eb; /* فاصل علوي */
    /* 🛑 تعديل 1: زيادة المسافة العلوية لزيادة المسافة بين قسم الصور والقسم الجديد */
    padding-top: 2.5rem; /* تم زيادته من 1.5rem */
}

/* 🛑 تعديل 4: إضافة مسافة سفلية لكل قسم لزيادة المسافة بين الأقسام */
.app-details-section {
    margin-bottom: 2rem;
}

.app-details-section .section-header {
    /* 🛑 تعديل 1: لضمان محاذاة السهم والعنوان على نفس السطر */
    display: flex;
    justify-content: space-between;
    align-items: center; /* لضمان المحاذاة الرأسية */
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.app-details-section .section-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 700;
    color: #1f2937; /* text-gray-800 */
}

.app-details-section .arrow-btn {
    /* 🛑 تعديل 2: إضافة خلفية دائرية للسهم ومحاذاته */
    display: flex; /* لمركزة السهم داخل الدائرة */
    align-items: center;
    justify-content: center;
    width: 32px; /* حجم الدائرة */
    height: 32px; /* حجم الدائرة */
    border-radius: 50%; /* لجعلها دائرية */
    background-color: #ffffff; /* خلفية بيضاء */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); /* ظل خفيف */
    color: #4b5563; /* لون السهم */
    transform: rotate(180deg); /* جعل السهم يشير لليسار في RTL */
    transition: all 0.2s;
}
/* تنسيقات الأيقونة داخل زر السهم إذا كانت صورة أو SVG */
.app-details-section .arrow-btn img,
.app-details-section .arrow-btn svg {
    width: 20px;
    height: 20px;
    filter: none; /* لإبقاء لون السهم كما هو */
}

/* 🛑 إضافة تأثير تحويم (Hover) لتحسين تجربة المستخدم */
.app-details-section .section-header:hover .arrow-btn {
    background-color: #f3f4f6;
    transform: rotate(180deg) scale(1.05);
}

.app-details-section .section-short-desc {
    font-size: 0.875rem; /* text-sm */
    color: #6b7280; /* text-gray-500 */
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.tag-item {
    background-color: #f3f4f6; /* bg-gray-100 */
    color: #374151; /* text-gray-700 */
    padding: 0.25rem 0.75rem;
    border-radius: 9999px; /* rounded-full */
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #e5e7eb; /* border-gray-200 */
    transition: background-color 0.2s;
}

.tag-item:hover {
    background-color: #e5e7eb; /* bg-gray-200 */
}

/* تنسيقات النوافذ المنبثقة مع أنيميشن */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(20px); } to { transform: translateY(0); } }
@keyframes slideDown { from { transform: translateY(0); } to { transform: translateY(20px); } }

.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
.animate-fade-out { animation: fadeOut 0.3s ease-in forwards; }
.animate-slide-up { animation: slideUp 0.3s ease-out forwards; }
.animate-slide-down { animation: slideDown 0.3s ease-in forwards; }
/* ✅ [نهاية الإضافة] */

/* ========================================================================= */
/* ===== 🛑 NEW: App Reviews Modal/Homepage Styles (Final Touches) 🛑 ===== */
/* ========================================================================= */

/* تنسيق زر القائمة المنسدلة (النقاط الثلاث) */
/* 🛑 FIX: تكبير حجم زر القائمة المنسدلة لجعله أسهل في النقر (32x32px) */
.review-menu-btn {
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem; /* تكبير النقاط الثلاث */
}

/* تنسيق القائمة المنسدلة لزر الإبلاغ */
.review-menu-dropdown {
    position: absolute;
    top: 100%; /* أسفل الزر مباشرة */
    left: 0; /* محاذاة لليسار في RTL */
    z-index: 10;
    min-width: 150px;
    border: 1px solid #e5e7eb;
}

/* تنسيق أزرار التفاعل بالإفادة (نعم/لا) */
.review-reaction-btn {
    /* تطبيق التنسيق المطلوب (نعم/لا) */
    transition: all 0.2s;
    font-size: 0.9rem;
}

/* حالة التفاعل "Helpful" النشطة */
.review-reaction-btn[data-action="helpful"].bg-blue-500 {
    background-color: #3b82f6 !important;
    color: white !important;
    border-color: #3b82f6 !important;
}

/* حالة التفاعل "Not Helpful" النشطة */
.review-reaction-btn[data-action="not_helpful"].bg-gray-200 {
    background-color: #e5e7eb !important;
    color: #4b5563 !important;
    border-color: #9ca3af !important;
}

/* 🛑 NEW: تنسيق أزرار الإفادة المصغرة للصفحة الرئيسية */
.home-review-reaction-btn {
    font-size: 0.7rem; /* أصغر قليلاً */
    padding: 4px 8px !important; /* تصغير الحشو */
}

/* 🛑 NEW: تنسيق سطر تفاعلات الصفحة الرئيسية (لحل مشكلة التمركز) */
.home-review-interactions-row {
     display: flex;
     align-items: center;
     flex-wrap: wrap; /* للسماح للعناصر بالنزول لسطر جديد في الشاشات الصغيرة */
     justify-content: flex-start; /* بدء العناصر من اليمين (في RTL) */
     gap: 0.5rem;
}

/* 🛑 NEW: تنسيق التاريخ والنجوم في الصفحة الرئيسية (لتجميعهما في سطر واحد) */
.app-reviews-container .flex.items-center.text-sm.mt-1 {
    display: flex;
    align-items: center;
    /* إزالة أي تباعد غير ضروري في هذا السطر */
    margin-top: 0 !important;
    margin-bottom: 0.25rem;
}

/* ================================================= */
/* ===== NEW: Quick Links Section Title Style ===== */
/* ================================================= */

/* لتقليل حجم عنوان الأقسام السريعة (Quick Links Title) */
#quick-links-section h2 {
    font-size: 0.9rem !important; /* تقليل حجم الخط إلى 1.25rem (بمقدار text-xl) */
    line-height: 1.2 !important;
    /* يمكنك تغيير القيمة إلى 1.15rem لتقليل أكبر */
}

/* لضمان أن زر 'عرض الكل' يظل محاذياً */
#quick-links-section .flex.justify-between.items-center {
    align-items: flex-end;
}

/* ========================================================================= */
/* ===== 🛑 NEW: Home Page Star Rating Styles (Google Play Style) 🛑 ===== */
/* ========================================================================= */

#add-review-stars {
    /* 🛑 FIX: إزالة التباعد الداخلي لترك مساحة أكبر للنجوم */
    justify-content: space-around !important; /* توزيع النجوم على عرض الحاوية */
    width: 90%; /* تقليص العرض قليلاً للتركيز */
    max-width: 300px; /* تحديد أقصى عرض للنجوم */
    margin-left: auto;
    margin-right: auto;
}

#add-review-stars span {
    /* 🛑 FIX: زيادة حجم النجمة وجعلها مرنة */
    padding: 0 5px; 
    font-size: 3rem !important; /* حجم النجمة (text-5xl في HTML) */
    line-height: 1; /* لضمان عدم وجود مسافات إضافية */
}

/* 🛑 NEW: تنسيق زر "كتابة مراجعة" (ملاحظة: هذا ليس الزر الأزرق الكبير) */
.add-review-section button.text-blue-600 {
    display: inline-block; /* لضمان أن الزر يأخذ مساحة المحتوى فقط */
    /* 🛑 تم حذف: margin-right: auto; و margin-left: auto; للسماح لـ text-align: center; بالعمل */
}