/* 1. Design Tokens & Variables */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&family=Inter:wght@400;600;800&display=swap');
:root {
    --bg-dark: #05070a;
    --bg-card: rgba(13, 17, 23, 0.8);
    --primary-neon: #00f2ff;
    --primary-glow: rgba(0, 242, 255, 0.3);
    --secondary-neon: #7000ff;
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    
    /* Effects */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
    --transition-smooth: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-neon: 0 0 20px var(--primary-glow);
}

/* 2. Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', 'Cairo', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(112, 0, 255, 0.1), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(0, 242, 255, 0.05), transparent 40%);
    z-index: -1;
}

/* 3. Typography Systems */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to bottom right, #fff, #8b949e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 4. Navigation Glassmorphism */
.glass-nav {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 1200px;
    height: 70px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 5. Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--secondary-neon), var(--primary-neon));
    border-radius: 10px;
}

/* 6. Hero Section */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero {
    padding-top: 180px;
    padding-bottom: 60px; /* تم تعديل المسافة هنا */
    text-align: center;
    animation: fadeInUp 1s ease forwards;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 7. Filter & Search Section */
.filter-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding-bottom: 40px;
    z-index: 100;
    position: relative;
}

.search-wrapper {
    width: 100%;
    max-width: 700px;
    display: flex;
    align-items: center;
    padding: 15px 25px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
}

.search-wrapper:focus-within {
    border-color: var(--primary-neon);
    box-shadow: 0 0 25px var(--primary-glow);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--primary-neon);
    margin-left: 15px; /* الهامش لليمين لأن الموقع RTL */
    font-size: 1.2rem;
}

.search-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    width: 100%;
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
}

.filter-pills {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.pill {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

.pill:hover {
    color: #fff;
    border-color: var(--primary-neon);
    transform: scale(1.05);
}

.pill.active {
    background: var(--primary-neon);
    color: #000;
    box-shadow: 0 0 15px var(--primary-glow);
    border-color: var(--primary-neon);
}

/* 8. Grid & Cards */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
    padding: 20px 0 80px 0;
}

.pro-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 16px;
    position: relative;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 380px;
    justify-self: center;
}

@media (max-width: 1200px) {
    .grid-layout {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .grid-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

.pro-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-neon);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px var(--primary-glow);
}
/* الحاوية الأساسية للصورة - تثبيت الارتفاع والعرض لكل الكروت */
.card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

/* التنسيق الافتراضي للصور */
.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* يملأ الصندوق تماماً */
    transition: var(--transition-smooth);
}

/* نسب الصور حسب نوع المنتج */
.card-image-wrapper.is-prompt-card {
    aspect-ratio: 16 / 9;
}

.card-image-wrapper.is-book-card {
    aspect-ratio: 9 / 16;
    padding: 12px;
}

.card-image-wrapper.is-square-card {
    aspect-ratio: 1 / 1;
}

.card-image-wrapper.is-book-card img {
    width: auto;
    height: auto;
    max-width: 100%; /* لا يتجاوز عرض الكرت */
    max-height: 100%; /* لا يتجاوز ارتفاع الكرت */
    object-fit: contain; /* يظهر الغلاف كاملاً */
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5)); /* ظل جمالي للكتاب */
}
.pro-card:hover img {
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: 12px;
    right: 12px; /* تم التعديل لليمين ليتناسب مع RTL */
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    color: var(--primary-neon);
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--primary-neon);
    z-index: 2;
}

.card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: #fff;
    background: none;
    -webkit-text-fill-color: #fff;
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-btn {
    background: linear-gradient(135deg, var(--secondary-neon), var(--primary-neon));
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: 0.3s;
}

.card-btn:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 15px var(--primary-neon);
}

/* 9. Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #12161d 25%, #1b2129 50%, #12161d 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}



/* View Page Layout */
.view-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    align-items: start;
}

@media (max-width: 992px) {
    .view-container { grid-template-columns: 1fr; }
}
/* التنسيق الافتراضي للصور في صفحة العرض */
.view-image-box {
    position: sticky;
    top: 120px;
    border-radius: 30px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2); /* خلفية خفيفة خلف الصور */
}

.view-image-box img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover; /* التنسيق الحالي لبقية المنتجات */
}

/* التنسيق الخاص بالكتب: عرض الصورة كاملة */
.view-image-box.is-book {
    background: transparent;
    border: none;
    box-shadow: none;
}

.view-image-box.is-book img {
    object-fit: contain; /* يضمن ظهور صورة الكتاب كاملة دون قص */
    max-height: 80vh;    /* منع الصورة من التمدد بشكل مفرط طولياً */
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.5)); /* ظل لغلاف الكتاب */
}
.view-info-box {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 40px;
}

.view-header { margin-bottom: 30px; }
.view-header h1 { 
    font-size: 2.5rem; 
    -webkit-text-fill-color: #fff; 
    margin-bottom: 15px;
}

.view-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.stat-item {
    background: rgba(255,255,255,0.05);
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-item i { color: var(--primary-neon); margin-left: 8px; }

.description-text {
    color: var(--text-main);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 40px;
    white-space: pre-wrap; /* للحفاظ على تنسيق الأسطر */
}

/* Action Area */
.action-area {
    display: flex;
    gap: 15px;
    border-top: 1px solid var(--glass-border);
    padding-top: 30px;
}

.btn-pro {
    flex: 1;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    text-decoration: none;
    color: #fff;
}

.btn-main { background: linear-gradient(135deg, var(--secondary-neon), var(--primary-neon)); }
.btn-share { background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border); }

.btn-pro:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }

/* Prompt Box المخصص */
.prompt-container {
    background: #000;
    border: 1px dashed var(--primary-neon);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    font-family: monospace;
    position: relative;
}

.copy-hint {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--primary-neon);
    color: #000;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 5px;
    font-weight: bold;
}


/* حاوية اللوجو لضمان التوسط */
.main-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px; /* مسافة بين اللوجو وكلمة استكشف */
    width: 100%;
}

/* تنسيق اللوجو الكبير */
.main-hero-logo {
    width: 350px; /* حجم كبير وواضح */
    max-width: 80%; /* لضمان التجاوب مع الموبايل */
    height: auto;
    object-fit: contain;
    /* إضافة توهج نيون خفيف يتماشى مع ألوان اللوجو */
    filter: drop-shadow(0 0 15px rgba(0, 255, 242, 0.2)); 
    transition: transform 0.4s ease-in-out;
}

/* تأثير بسيط عند تمرير الماوس */
.main-hero-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px rgba(188, 19, 254, 0.4));
}

/* ضبط الهيدر ليتناسب مع اللوجو الجديد */
.hero-section {
    padding-top: 60px; /* زيادة المساحة العلوية */
    text-align: center;
}

/* تحسين منطقة الأزرار في صفحة العرض */
.action-area {
    display: flex;
    flex-direction: column; /* ترتيب رأسي للموبايل */
    gap: 15px;
    width: 100%;
}

.btn-pro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 55px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    text-decoration: none;
    color: #fff;
}

/* زر التحميل أو النسخ الأساسي */
.btn-main {
    background: linear-gradient(135deg, var(--secondary-neon), var(--primary-neon));
    box-shadow: 0 4px 15px rgba(0, 242, 255, 0.2);
}

.btn-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--primary-glow);
    filter: brightness(1.1);
}

/* زر المشاركة */
.btn-share {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(5px);
}

.btn-share:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-neon) !important;
    color: var(--primary-neon);
}

/* تنسيق صندوق البرومبت */
.prompt-container {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px dashed var(--primary-neon) !important;
    position: relative;
    padding: 25px 15px !important;
}

.prompt-container code {
    font-family: 'Consolas', monospace;
    font-size: 0.95rem;
}



body {
    font-family: 'Cairo', sans-serif; /* الخط الأساسي للعربية */
    background-color: var(--bg-dark);
    color: var(--text-main);
}

h1, h2, h3, .btn-pro {
    font-family: 'Cairo', sans-serif;
    font-weight: 700; /* خط عريض للعناوين والأزرار */
}

code, .prompt-container {
    font-family: 'Inter', monospace; /* خط لاتيني تقني للأكواد والبرومبت */
}


/* التنسيق الافتراضي لصور الكروت */
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* الوضع الافتراضي لباقي المنتجات */
    transition: var(--transition-smooth);
}

/* التنسيق الخاص بالكتب في الصفحة الرئيسية */
.card-image.is-book-card {
    background: rgba(255, 255, 255, 0.02); /* خلفية خفيفة جداً لإبراز الغلاف */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; /* مسافة بسيطة حول الغلاف */
}

.card-image.is-book-card img {
    object-fit: contain; /* إظهار غلاف الكتاب كاملاً دون قص */
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.4)); /* ظل يعطي عمقاً للغلاف */
}