/* =========================================
   التأسيس والمتغيرات (Design System)
   ========================================= */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Plus Jakarta Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: all 0.3s ease;
}

body.ar { font-family: var(--font-ar); direction: rtl; }
body.en { font-family: var(--font-en); direction: ltr; }

body.ar .en { display: none !important; }
body.en .ar { display: none !important; }

/* =========================================
   التخطيط الأساسي (Layout)
   ========================================= */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.lang-btn:hover { background: var(--bg-body); }

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.header-text {
    text-align: center;
    margin-bottom: 40px;
}

/* =========================================
   شريط الماركات المتحرك (Brands Marquee)
   ========================================= */
.brands-marquee-section {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    padding: 0 24px;
    overflow: hidden;
}

.marquee-container {
    display: flex;
    overflow: hidden;
    width: 100%;
    direction: ltr !important; 
    position: relative;
    padding: 10px 0 30px 0;
}

.marquee-container::before,
.marquee-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}
.marquee-container::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-body) 0%, transparent 100%);
}
.marquee-container::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-body) 0%, transparent 100%);
}

.marquee-content {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 30px; 
    padding-right: 30px; 
    min-width: 100%;
    animation: scroll-linear 25s linear infinite;
}

/* التعديل الجديد: الصورة تملأ الدائرة بالكامل */
.marquee-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: var(--bg-card);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    padding: 0; /* تم إلغاء الـ padding لتملأ الصورة الدائرة */
}

.marquee-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* لملء الدائرة وقص الزوائد */
    mix-blend-mode: multiply;
}

.marquee-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 15px rgba(37, 99, 235, 0.15);
    border-color: var(--primary);
}

.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

@keyframes scroll-linear {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* =========================================
   شبكة الكروت (Responsive Grid)
   ========================================= */
.coupons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* =========================================
   تصميم الكارت (Modern Card)
   ========================================= */
.coupon-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.coupon-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

.card-header {
    position: relative;
    background: #f1f5f9;
    padding: 0;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px dashed #cbd5e1;
    overflow: hidden;
}

.card-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: multiply;
}

/* بادج العرض */
.offer-badge {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px; 
    background: #ef4444;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.4);
    z-index: 10;
}

.card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.brand-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: #eff6ff;
    padding: 4px 10px;
    border-radius: 20px;
    align-self: flex-start;
    margin-bottom: 12px;
}

.coupon-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 20px;
    color: var(--text-main);
}

.copy-wrapper {
    background: #f8fafc;
    border: 2px dashed var(--primary);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 16px;
}

.copy-wrapper:hover { background: #eff6ff; }

.copy-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.code-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
    font-family: monospace;
}

.details-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    text-align: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}

.collapsible-content.active {
    max-height: 1000px;
}

.details-inner {
    padding-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.store-btn {
    display: block;
    text-align: center;
    background: var(--primary);
    color: white !important;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    margin-top: 16px;
}

/* Highlight Section Styling */
.highlight-section {
    padding: 40px 0;
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
    border-radius: 24px;
    margin-bottom: 40px;
}

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    padding: 20px;
}
/* Highlight Card - New Fluid Gradient Animation */
.highlight-card {
    position: relative;
    /* بنكبر حجم الجريدينت عشان نعرف نحركه */
    background: linear-gradient(-45deg, #2563eb, #7c3aed, #3b82f6, #6366f1);
    background-size: 400% 400%; 
    animation: fluidGradient 10s ease infinite; /* انميشن الجريدينت الناعم */
    border-radius: 20px;
    padding: 25px;
    color: white;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.2);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.highlight-card:hover {
    transform: translateY(-5px);
}

/* التعديل الجديد: شيلنا الـ rotate وحطينا انميشن تحريك الألوان */
@keyframes fluidGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* شيل كود الـ .highlight-card::before القديم خالص عشان هو ده اللي كان عامل جليتش */
.highlight-card::before {
    display: none;
}

.highlight-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: bold;
}

.highlight-content {
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1;
    position: relative;
}

.brand-side img {
    width: 80px;
    height: 80px;
    background: white;
    padding: 10px;
    border-radius: 15px;
    object-fit: contain;
}

.info-side h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.highlight-code-box {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 15px;
    border-radius: 10px;
    justify-content: space-between;
    align-items: center;
    border: 1px border rgba(255,255,255,0.3);
}

.code-val {
    font-family: monospace;
    font-weight: bold;
    font-size: 1.3rem;
    letter-spacing: 2px;
}

.highlight-copy-btn {
    background: white;
    color: #2563eb;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
}

.highlight-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 0.9rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* ستايل زر المتجر في الكارت الهايلايت */
.highlight-store-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15); /* شفافية شيك */
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    width: 100%; /* ياخد العرض كامل تحت الوصف */
}

.highlight-store-btn:hover {
    background: white;
    color: #2563eb; /* يقلب لون الأساسي عند الهوفر */
    transform: translateY(-2px);
}

/* تحسين المسافات في الفوتر */
.highlight-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =========================================
   الـ Media Queries لضبط المسافات (Responsive)
   ========================================= */

/* للشاشات المتوسطة (Tablets - أقل من 992px) */
@media (max-width: 992px) {
    .main-content {
        padding: 1.5rem 1.25rem; /* تقليل المسافات الجانبية للمحتوى */
    }
    
    .header-text {
        margin-bottom: 2rem; /* تقليل المارجن تحت العناوين */
    }

    .highlight-section {
        padding: 1.25rem; /* بادنج أقل لسكشن الهايلايت */
        margin-bottom: 2.5rem;
    }
}

/* للموبايل (Phones - أقل من 768px) */
@media (max-width: 768px) {
      .footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-info, .footer-social {
        align-items: center;
    }
    
    .footer-info p {
        margin: 1rem auto;
    }

    .social-links {
        justify-content: center;
    }
    .nav-container {
        padding: 0.75rem 1rem; /* تضييق النافبار */
    }

    .main-content {
        padding: 1rem 0.75rem; /* أقل بادنج ممكن عشان الشاشة صغيرة */
    }

    .header-text h2 {
        font-size: 1.4rem; /* تصغير الخطوط عشان متبقاش ضخمة */
        margin-bottom: 15px;
    }

    .coupons-grid, .highlight-grid {
        gap: 1rem; /* تقليل المسافات (Gap) بين الكروت */
    }

    .coupon-card .card-body {
        padding: 1rem; /* تقليل البادنج جوه كارت الكوبون */
    }

    .copy-wrapper {
        padding: 8px 12px; /* تصغير منطقة الكود */
        margin: 0.75rem 0;
    }
    
    .marquee-item {
        width: 70px; /* تصغير حجم اللوجوهات في الماركي */
        height: 70px;
        margin: 0 0.5rem;
    }
}

/* للموبايلات الصغيرة جداً (Small Phones - أقل من 480px) */
@media (max-width: 480px) {
    .logo {
        font-size: 1.1rem;
    }

    .highlight-card {
        padding: 1rem;
    }

    .highlight-content {
        flex-direction: column; /* قلب محتوى الهايلايت لعمودي */
        text-align: center;
        gap: 0.75rem;
    }
}

/* =========================================
   Footer Styling (Responsive)
   ========================================= */
.main-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 3rem 1rem 1.5rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer-info {
    flex: 1;
    min-width: 280px;
}

.footer-info p {
    color: var(--text-muted);
    margin-top: 1rem;
    font-size: 0.95rem;
    max-width: 400px;
}

.footer-social {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

body.ar .footer-social { align-items: flex-start; }
body.en .footer-social { align-items: flex-start; }

.footer-social h3 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

.social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

/* ألوان البراندات عند الهوفر */
.social-icon.tiktok:hover { background: #000; color: #fff; }
.social-icon.instagram:hover { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); color: #fff; }
.social-icon.snapchat:hover { background: #fffc00; color: #000; text-shadow: none; }
.social-icon.facebook:hover { background: #1877f2; color: #fff; }
.social-icon.x-twitter:hover { background: #000; color: #fff; }

.social-icon:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
