/* D:\CVS GAMES\Django\cvsgames_site\pc_apps_app\static\pc_apps_app\css\pc_apps_style.css */

@import url("components/_pc_app_ratings_style.css");

.pc-app-list-main-content h2 {
    color: #00bcd4;
}

.game-details .favorite-button {
    background-color: #bb86fc;
    margin-right: 0;
    margin-left: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.game-details .favorite-button:hover {
    background-color: #a072d8;
    transform: translateY(-2px) scale(1.03);
}

body.light-theme .game-details .favorite-button {
    background-color: #6200EE;
    color: white;
}

body.light-theme .game-details .favorite-button:hover {
    background-color: #3700B3;
}

:root {
    --pc-app-glow-color: #00bcd4;
    --pc-app-glow-rgb: 0, 188, 212;
}

/* === تعديل سلايدر الأيقونات لإظهار الاسم كاملاً === */
.icon-slide-item {
    flex: 0 0 auto;
    width: 120px;
    margin: 0 7px;
    background-color: transparent;
    border-radius: 12px;
    overflow: hidden; /* قد تحتاج لتغيير هذا إذا كان النص يخرج عن حدود العنصر */
    text-align: right;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    scroll-snap-align: start;
    direction: rtl;
    height: auto; /* السماح للعنصر بالتمدد طولياً */
    min-height: 160px; /* ضمان حد أدنى للارتفاع للحفاظ على التنسيق */
    vertical-align: top;
}

.icon-slide-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 22px;
    margin-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.icon-slide-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 0px 20px rgb(255, 0, 0);
}

.icon-slide-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.icon-slide-item h3 {
    color: #f0f0f0;
    font-size: 0.9em;
    padding: 0 3px;
    white-space: normal; /* تم التعديل: السماح بالتفاف النص */
    overflow: visible;   /* تم التعديل: إظهار النص الكامل */
    text-overflow: clip; /* تم التعديل: إزالة النقاط (...) */
    margin: 0 0 4px 0;
    text-align: center;
    height: auto;        /* تم التعديل: السماح بالتمدد */
    line-height: 1.2;    /* تحسين المسافة بين الأسطر للنصوص الطويلة */
}

.icon-slide-item span {
    font-size: 0.8em;
    color: #a0a0a0;
    display: block;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.light-theme .icon-slide-item h3 {
    color: #333;
}
body.light-theme .icon-slide-item span {
    color: #777;
}

.pc-apps-grid .grid-container,
.pc-app-category-grid .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 10px !important;
    padding-bottom: 30px !important;
    align-items: start; /* محاذاة العناصر للأعلى لتجنب مشاكل التمدد */
}

.pc-apps-grid .game-item,
.pc-app-category-grid .game-item {
    padding: 5px !important;
    min-width: 90px !important;
    margin-bottom: 0px !important; /* تم تعديله من -20px لتجنب تداخل النصوص الطويلة */
    position: relative;
    z-index: 1;
    height: auto !important; /* السماح بالتمدد */
    display: flex;
    flex-direction: column;
}

.pc-apps-grid .game-item:hover,
.pc-app-category-grid .game-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(var(--pc-app-glow-rgb), 0.3);
    z-index: 2;
}

.pc-apps-grid .game-item img,
.pc-app-category-grid .game-item img {
    width: 100% !important;
    height: 90px !important;
    object-fit: cover !important;
    border-radius: 16px !important;
    margin-bottom: 5px !important;
    margin-left: 0 !important;
    flex-shrink: 0; /* منع الصورة من الانكماش */
}

/* === تعديل الشبكة الرئيسية لإظهار الاسم كاملاً === */
.pc-apps-grid .game-item h3,
.pc-app-category-grid .game-item h3 {
    font-size: 0.8em !important;
    padding: 0 2px !important;
    white-space: normal !important; /* السماح بالتفاف النص */
    overflow: visible !important;   /* إظهار كامل النص */
    text-overflow: clip !important; /* إزالة النقاط */
    text-align: center !important;  /* توسيط النص */
    height: auto !important;        /* السماح بالتمدد */
    line-height: 1.2 !important;    /* تحسين القراءة */
}

.pc-app-search-results-grid .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    gap: 10px !important;
    padding-bottom: 30px !important;
    align-items: start;
}

.pc-app-search-results-grid .game-item {
    padding: 5px !important;
    min-width: 120px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, z-index 0s 0.1s ease;
    margin-bottom: 0px !important; /* تم تعديله لتجنب التداخل */
    position: relative;
    z-index: 1;
    height: auto !important;
    display: flex;
    flex-direction: column;
}

.pc-app-search-results-grid .game-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(var(--pc-app-glow-rgb), 0.3);
    z-index: 2;
}

.pc-app-search-results-grid .game-item img {
    width: 100% !important;
    height: 120px !important;
    object-fit: cover !important;
    border-radius: 22px !important;
    margin-bottom: 8px !important;
    margin-left: 0 !important;
    flex-shrink: 0;
}

/* === تعديل شبكة نتائج البحث لإظهار الاسم كاملاً === */
.pc-app-search-results-grid .game-item h3 {
    font-size: 0.9em !important;
    padding: 0 3px !important;
    text-align: center !important;
    white-space: normal !important; /* السماح بالتفاف النص */
    overflow: visible !important;   /* إظهار كامل النص */
    text-overflow: clip !important; /* إزالة النقاط */
    height: auto !important;        /* السماح بالتمدد */
    line-height: 1.2 !important;
}

.pc-apps-grid .load-more-button,
.pc-app-category-grid .load-more-button,
.pc-app-search-results-grid .load-more-button {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: bold;
    color: #f0f0f0;
    background-color: rgba(var(--pc-app-glow-rgb), 0.2);
    border: 1px solid rgba(var(--pc-app-glow-rgb), 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 40px !important;
    margin-bottom: 20px !important;
}

.pc-apps-grid .load-more-button:hover,
.pc-app-category-grid .load-more-button:hover,
.pc-app-search-results-grid .load-more-button:hover {
    background-color: rgba(var(--pc-app-glow-rgb), 0.4);
    border-color: rgba(var(--pc-app-glow-rgb), 0.8);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(var(--pc-app-glow-rgb), 0.2);
}

body.light-theme .pc-apps-grid .load-more-button,
body.light-theme .pc-app-category-grid .load-more-button,
body.light-theme .pc-app-search-results-grid .load-more-button {
    background-color: #f0f2f5;
    border-color: #d0d0d0;
    color: #333;
}

body.light-theme .pc-apps-grid .load-more-button:hover,
body.light-theme .pc-app-category-grid .load-more-button:hover,
body.light-theme .pc-app-search-results-grid .load-more-button:hover {
    background-color: #e4e6eb;
    border-color: #b0b0b0;
    color: #111;
}

.game-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.title-with-icon {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.header-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.game-header h2 {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: none;
}

.game-header .favorite-button {
    flex-shrink: 0;
    margin-left: 15px;
    margin-right: 0;
}
/* ========================================================
   تنسيقات زر "إرسال تحديث" وحاوية الأزرار (مطابقة للأندرويد)
   ======================================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px; 
}

.action-button.update-btn {
    background-color: #2196F3;
    color: white;
    border: 1px solid #1E88E5;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.action-button.update-btn:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4);
}

.update-btn i {
    font-size: 1.1em;
}

/* دعم الوضع المضيء */
body.light-theme .action-button.update-btn {
    background-color: #007bff;
    border-color: #0069d9;
}
body.light-theme .action-button.update-btn:hover {
    background-color: #0056b3;
}

/* ====================================================================
   📱 إصلاحات الجوال الشاملة (للقوائم + صفحة التفاصيل)
   (Compact & Clean Mode: يطبق على القوائم والتفاصيل معاً)
   ==================================================================== */

@media (max-width: 768px) {

    /* --- 1. تصفير الحاويات الكبيرة وإزالة الخلفيات (للقوائم والتفاصيل) --- */
    .pc-app-list-main-content .game-slider-section,
    .game-details .game-slider-section {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        /* الهامش السالب للتقريب */
        margin-bottom: -35px !important; 
        margin-top: 0 !important;
        overflow: visible !important;
    }

    /* استثناء السلايدر الأول في القوائم (Hero) من الهامش السالب */
    .pc-app-list-main-content .game-slider-section.first-of-type {
        margin-bottom: 10px !important;
    }

    /* --- 2. تنسيق العنوان (مشترك) --- */
    .pc-app-list-main-content .game-slider-section h2,
    .game-details .game-slider-section h2 {
        margin-bottom: 5px !important;
        margin-top: 5px !important;
        padding-right: 10px !important;
        font-size: 1em !important;
        color: #eee !important;
        position: relative;
        z-index: 5;
    }

    /* --- 3. السلايدر الأول (Hero Slider): صورتين عريضتين (خاص بالقوائم) --- */
    .pc-app-list-main-content .game-slider-section.first-of-type .icon-slide-item {
        width: calc(50% - 10px) !important;
        min-width: calc(50% - 10px) !important;
        margin: 0 5px !important;
        display: block !important;
        background: transparent !important;
    }

    .pc-app-list-main-content .game-slider-section.first-of-type .icon-slide-item img {
        width: 100% !important;
        height: 150px !important;
        aspect-ratio: auto !important;
        object-fit: cover !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.4) !important;
    }

    /* --- 4. سلايدرات الأيقونات (Similar Apps / Icons): 4 أيقونات متلاصقة --- */
    /* نطبق هذا على كل السلايدرات في صفحة التفاصيل + سلايدرات الأيقونات في القوائم */
    .game-details .game-slider-section .icon-slide-item,
    .pc-app-list-main-content .game-slider-section:not(.first-of-type) .icon-slide-item {
        width: calc(25% - 8px) !important; /* ربع العرض */
        min-width: calc(25% - 8px) !important;
        margin: 0 4px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        background: transparent !important;
    }

    /* الصورة (مربعة وكاملة) */
    .game-details .game-slider-section .icon-slide-item img,
    .pc-app-list-main-content .game-slider-section:not(.first-of-type) .icon-slide-item img {
        width: 100% !important;
        aspect-ratio: 1 / 1 !important; /* مربع */
        height: auto !important;
        border-radius: 18px !important;
        margin-bottom: 2px !important;
        object-fit: fill !important; /* ✅ منع التقريب */
        box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
    }

    /* العنوان (صغير) */
    .game-details .game-slider-section .icon-slide-item h3,
    .pc-app-list-main-content .game-slider-section:not(.first-of-type) .icon-slide-item h3 {
        font-size: 0.7em !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        width: 100% !important;
        text-align: center !important;
        margin: 0 !important;
        line-height: 1.2 !important;
    }

    /* إخفاء التصنيف */
    .game-details .game-slider-section .icon-slide-item span,
    .pc-app-list-main-content .game-slider-section:not(.first-of-type) .icon-slide-item span {
        display: none !important;
    }

    /* --- 5. تحسينات عامة لصفحة التفاصيل (Header & Rating) --- */
    .game-details .game-header {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    .game-details .header-icon {
        width: 80px !important;
        height: 80px !important;
    }
    
    .game-details .header-actions {
        width: 100% !important;
        justify-content: space-between !important;
        margin-top: 10px !important;
    }
    
    .game-details .download-button {
        width: 100% !important;
        margin-top: 10px !important;
    }

    /* ضبط الحاويات الداخلية للسلايدرات */
    .slider-container, .slider-wrapper {
        padding: 0 5px !important;
        gap: 0 !important;
    }
    
    /* إخفاء أزرار التنقل */
    .slider-prev-btn, .slider-next-btn {
        display: none !important;
    }

    /* --- 6. الشبكة السفلية (Grid Style) --- */
    .pc-apps-grid .game-item,
    .pc-app-category-grid .game-item {
        width: calc(33.33% - 10px) !important;
        margin-bottom: 15px !important;
    }

    .pc-apps-grid .game-item img,
    .pc-app-category-grid .game-item img {
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        object-fit: cover !important;
        border-radius: 18px !important;
    }
}