:root {
    --primary: #ff9800;
    --dark-blue: #1a2236;
    --bg: #f8fafc;
    --text: #1e293b;
    --card-bg: #ffffff;
    --dropdown-bg: #1e293b; /* لون القائمة المنسدلة */
}

[data-theme="dark"] {
    --bg: #0f172a;
    --text: #f8fafc;
    --card-bg: #1e293b;
    --dropdown-bg: #111b2d;
}

body {
    direction: rtl;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    transition: 0.3s;
}

/* --- الهيدر (المكان الأساسي للسليكتر) --- */
.main-header {
    background: var(--dark-blue);
    color: white;
    padding: 10px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
}

.logo { font-size: 22px; font-weight: bold; min-width: 150px; color: white; cursor: pointer; }
.logo span { color: var(--primary); }
.logo-link { text-decoration: none; display: inline-block; transition: 0.2s; }

/* --- شريط البحث --- */
.search-container { flex-grow: 1; display: flex; justify-content: center; }
.search-bar {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 25px;
    display: flex;
    padding: 5px 15px;
}
.search-bar input { border: none; outline: none; width: 100%; padding: 8px; font-size: 14px; }
.search-bar button { background: none; border: none; color: #667; cursor: pointer; }

/* --- الأزرار الجانبية والسليكتر --- */
.header-actions { display: flex; align-items: center; gap: 15px; min-width: 180px; justify-content: flex-end; }
.action-btn { background: none; border: none; color: white; font-size: 20px; cursor: pointer; position: relative; text-decoration: none; }

/* --- إدارة القائمة المنسدلة (Dropdown) --- */
.user-menu-container {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none; /* مخفية افتراضياً وتظهر بـ JS */
    position: absolute;
    top: 45px;
    right: 0;
left: auto;
    background: var(--dropdown-bg);
    min-width: 180px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border-radius: 12px;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.dropdown-menu.show {
    display: block; /* تظهر عند الضغط */
    animation: fadeIn 0.2s ease-out;
}

.dropdown-nav {
    display: flex;
    flex-direction: column; /* ترتيب العناصر من الأعلى للأسفل */
    padding: 5px 0;
}

.dropdown-nav a, .logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: white;
    text-decoration: none; /* إزالة الخطوط تماماً */
    font-size: 14px;
    transition: 0.3s;
    background: none;
    border: none;
    width: 100%;
    text-align: right;
    cursor: pointer;
}

.dropdown-nav a:hover, .logout-btn:hover {
    background: rgba(255, 152, 0, 0.1);
    color: var(--primary);
}

.dropdown-nav hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 5px 0;
}

.logout-btn {
    color: #ff4d4d; /* لون أحمر لتنبيه تسجيل الخروج */
    font-weight: bold;
}

/* --- شبكة البطاقات --- */
/* الحاوية الرئيسية للبطاقات */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* زيادة العرض قليلاً لتناسب الصور */
    gap: 25px;
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* تصميم البطاقة الفردية */
.card-item {
    background: var(--card-bg);
    border-radius: 20px; /* زوايا أكثر نعومة */
    padding: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

/* تأثير عند تمرير الماوس */
.card-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    border-color: var(--primary-color); /* تأكد من تعريف لون رئيسي لموقعك */
}

/* حاوية الصورة - هذا هو الجزء الأهم لإصلاح مشكلة صورة نيتفليكس */
.card-image {
    width: 100%;
    height: 160px;
    border-radius: 15px;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
    background: #0f172a;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
    display: block;
}

.card-item:hover .card-image img {
    transform: scale(1.08);
}

/* تأثير تدرج خفيف في الأسفل */
.card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.35), transparent);
    pointer-events: none;
}

/* معلومات البطاقة */
.card-info h3 {
    font-size: 1.1rem;
    margin: 10px 0;
    color: var(--text-color);
    font-weight: 700;
}

.price-start {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 15px;
}

.price-start span {
    color: #2ecc71; /* لون أخضر للسعر */
    font-weight: bold;
    font-size: 1.1rem;
}

/* زر عرض الفئات */
.view-btn {
    width: 100%;
    padding: 10px;
    background: #f8f9fa;
    border: none;
    border-radius: 10px;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.card-item:hover .view-btn {
    background: var(--primary-color, #007bff);
    color: white;
}

/* حركة الظهور التدريجي */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === تحسينات الموبايل === */
@media (max-width: 768px) {

    /* الهيدر */
    .header-container {
        flex-wrap: wrap;
        padding: 8px 15px;
        gap: 10px;
    }

    .logo { font-size: 18px; min-width: auto; }

    /* إخفاء البحث في الموبايل وجعله سطر منفصل */
    .search-container {
        order: 3;
        width: 100%;
        flex-grow: unset;
    }

    .search-bar { max-width: 100%; }

    .header-actions { gap: 10px; min-width: auto; }
    .action-btn { font-size: 18px; }

    /* القائمة المنسدلة */
    .dropdown-menu {
        left: auto;
        right: 0;
        min-width: 160px;
    }

    /* شبكة البطاقات */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 15px 12px;
    }

    .card-image { height: 120px; }

    .card-info h3 { font-size: 0.9rem; }

    .price-start { font-size: 0.8rem; }

    .price-start span { font-size: 0.95rem; }

    .view-btn { padding: 8px; font-size: 13px; }
}

@media (max-width: 400px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .card-image { height: 100px; }
    .card-info h3 { font-size: 0.82rem; }
}


        /* ===== SLIDER ===== */
 .hero-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #0f172a;
}

.slider-container {
    width: 100vw;
    overflow: hidden; /* لمنع ظهور الصور المجاورة خارج الإطار */
    position: relative;
    border-radius: 12px;
    margin: 0;
    padding: 0;
}

#slidesWrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;

    /* منع وجود أي مسافات بين الشرائح */
    gap: 0 !important;
}

.slide {
    min-width: 100%;
    height: 350px; /* ← نفس ارتفاع slider-container */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    box-sizing: border-box;


    
    /* التعديل الأهم: منع الشريحة من التقلص وإجبارها على أخذ 100% من عرض الأب */
    flex: 0 0 100%; 
    width: 100%;
}

.slide h2 {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    z-index: 1;
    margin: 0 0 8px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.8);
    letter-spacing: 1px;
}

.slide p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    z-index: 1;
    margin: 0 0 16px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
    max-width: 500px;
    line-height: 1.6;


}

.slide a {
    background: white;
    color: #0f172a;
    padding: 10px 28px;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    z-index: 1;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.slide a:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}


.slide::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    top: -80px;
    left: -60px;
    z-index: 0;
}

.slide::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    bottom: -60px;
    right: -40px;
    z-index: 0;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.slider-btn:hover { background: rgba(255,255,255,0.3); }
.slider-prev { right: 12px; }
.slider-next { left: 12px; }

.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .slider-container { height: 250px; }
    .slide { height: 250px; }
    .slide h2 { font-size: 1.3rem; }
    .slide p { font-size: 0.85rem; }
}

.slide img {
    width: 100%;
    height: 200px; /* يمكنك تعديل الارتفاع حسب الرغبة */
    object-fit: cover; /* لضمان ملء الصورة للمساحة دون تمطيط */
    display: block;



max-width: calc(100vw - 20px)

}

/* إصلاح موضع قائمة البروفيل */
#user-dropdown {
    position: absolute;
    top: 100%;
    right: auto;
    left: 0;        /* يظهر لليسار بدل اليمين */
    min-width: 160px;
    z-index: 9999;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    padding: 8px 0;
    display: none;
}

#user-dropdown.show {
    display: block;
}

/* الحاوية تكون relative */
.user-menu-wrapper,
.nav-icons,
header {
    position: relative;
}

/* ===== إصلاح dropdown في وضع النهار ===== */
[data-theme="light"] #user-dropdown {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="light"] #user-dropdown a,
[data-theme="light"] #user-dropdown .dropdown-nav > *:not(.logout-btn) {
    color: white !important;
}

[data-theme="light"] #user-dropdown a:hover {
    background: rgba(249,115,22,0.15) !important;
    color: #f97316 !important;
}

.navbar-brand img {
  border-radius: 14px;
}
header .logo img {
  border-radius: 10px;
}
