* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- ستايل الديسكتوب (نفس كودك بالظبط مع تحسينات بسيطة للربط) --- */
.navbar {
    background-color: #092254;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 40px;
    height: 103px;
    border-radius: 99px;
    border: 1px solid #00000008;
    width: 94%;
    margin: 15px auto 0px auto;
    position: relative; /* مهم جداً لضبط قائمة الموبايل المنسدلة */
    direction: rtl; /* لترتيب العناصر من اليمين لليسار */
}

.nav-right {
    width: 60%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-menu-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    margin-right: 30px; /* مسافة بعد اللوجو */
}

.nav-right, .nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-left-desktop {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    max-height: 50px; /* تحجيم اللوجو ليناسب الارتفاع */
}
.nav-right{
    gap: 75px !important;
}
.nav-links {
    display: flex;
    list-style: none;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    margin: 0;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #b0c4de;
}

.nav-links i {
    font-size: 10px;
    margin-right: 5px;
}

.header-btn {
    background-color: #f7a416;
    border: none;
    color: #ffffff;
    padding: 6px 35px;
    border-radius: 44px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    box-shadow: 1px 2px 2px 0px #FFFFFF40 inset;
    white-space: nowrap;
    height: 53px;
}

.register-header-btn {
    background: transparent;
    border: 2px solid #ffffff;
    color: #ffffff;
    padding: 6px 25px;
    border-radius: 44px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    white-space: nowrap;
    height: 53px;
}

.search-icon, .menu-toggle {
    font-size: 20px;
    cursor: pointer;
}
.menu-toggle {
    color:#FBAC01;
}
.search-icon{
    color:#FBAC01;
}
.menu-toggle {
    display: none; /* مخفي تماماً على الديسكتوب */
}

.nav-left-mobile {
    display: none; /* مخفي تماماً على الديسكتوب */
}
nav .custom-dropdown {
    position: relative;
    width: 100%;
}

nav .dropdown-header {
    width: 100%;
    border-radius: 14px;
    font-size: 14px;
    color: white; /* لون الـ Placeholder الافتراضي */
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

/* عند فتح القائمة أو عمل فوكس */
nav .custom-dropdown.active .dropdown-header {
   
    color: #b0c4de;
}

/* السهم الأيسر وحركته عند الفتح */
nav .dropdown-header .arrow-icon {
    position: absolute;
    left: -23px;
    color: #94a3b8;
    font-size: 14px;
    transition: transform 0.3s ease;
}
@media (max-width:760px) {
    nav .dropdown-header .arrow-icon {
         left: 13px;
    }
}
.custom-dropdown.active .arrow-icon {
    transform: rotate(180deg);
    color: #94a3b8;
}

/* قائمة الخيارات المنبثقة (Custom List) */
nav .dropdown-list {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    width: 133%;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    padding: 8px 0;
    list-style: none;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 160px; 
    overflow-y: auto;
}
@media (max-width: 760px) {
    nav .dropdown-list {
        width: 100%;
    }
    .card-wrapper{
        width: 100%;
        max-width: 100%;
    }
}
/* إظهار القائمة */
.custom-dropdown.active .dropdown-list {
    display: block;
}

/* العناصر الداخلية للقائمة */
.dropdown-list li {
    padding: 12px 20px;
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
    text-align: right;
    transition: background 0.2s ease, color 0.2s ease;
}

/* تأثير الـ Hover على الخيارات */
.dropdown-list li:hover {
    background-color: #f4f7fc;
    color: #1e6bf1;
}

/* عندما يتم اختيار عنصر */
.dropdown-header.selected {
    color: white;
}

/* --- ستايل الموبايل والتابلت (شاشات أصغر من 992 بكسل) --- */
@media (max-width: 991px) {
    .navbar {
        height: auto; /* ترك الارتفاع مرن ليناسب الموبايل */
        padding: 15px 25px;
        border-radius: 30px; /* تقليل الدوران ليناسب الشاشات الصغيرة */
    }

    .nav-right {
        width: auto; /* إلغاء الـ 60% على الموبايل لعدم تداخل العناصر */
    }

    .nav-left-desktop {
        display: none; /* إخفاء أزرار الديسكتوب */
    }

    .menu-toggle {
        display: block; /* إظهار زر الـ Bar على اليسار */
    }

    /* تحويل الحاوية إلى قائمة منسدلة تختفي وتظهر */
    .navbar .nav-menu-wrapper {
        display: none; 
        position: absolute;
        top: 110%; /* تظهر أسفل الهيدر بقليل */
        left: 0;
        right: 0;
        width: 100%;
        background-color: #092254; /* نفس لون الخلفية الأساسية */
        border-radius: 20px;
        box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
        flex-direction: column;
        padding: 25px;
        gap: 25px;
        margin-right: 0;
        z-index: 999;
    }

    /* الكلاس الذي سيتم إضافته عبر الجافاسكريبت لفتح القائمة */
    .navbar .nav-menu-wrapper.show {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        text-align: center;
        gap: 20px;
    }

    .nav-left-mobile {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .nav-left-mobile button {
        width: 100%; /* الأزرار تأخذ العرض كامل في الموبايل لسهولة الضغط */
    }
}
/* footer */
/* --- تصميم الـ Footer الجديد باستخدام CSS Grid --- */
.main-footer {
    background-color: #09214F; /* اللون الكحلي الداكن مطابق للتصميم */
    padding: 40px 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    
    /* تفعيل الـ Grid وتوزيع الأعمدة */
    display: grid;
    /* توزيع المساحة: عمود اللوجو والوصف يأخذ ضعف مساحة أعمدة الروابط العادية */
    grid-template-columns: 2fr 1fr 1fr 1fr; 
    gap: 40px;
}

/* تنسيق أعمدة الروابط */
.footer-column {
    text-align: right;
}

.footer-column h4 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 15px;
}

.footer-column ul li a {
    color: #a0aec0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-column ul li a:hover {
    color: #ffb703; /* ذهبي عند التمرير */
}

/* تنسيق عمود اللوجو والوصف والسوشيال ميديا */
.footer-brand-column {
    text-align: right;
}

.footer-logo {
    margin-bottom: 10px;
}

.logo-yellow {
    color: #ffb703;
}

.logo-white {
    color: #ffffff;
}

.brand-description {
    color: #a0aec0;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 30px;
    max-width: 324px;
}

/* أزرار السوشيال ميديا الدائرية */
.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: #ffffff;
    color: #0a1f44;
    border-color: #ffffff;
    transform: translateY(-3px);
}
.courses-section {
    padding: 60px 20px;
    text-align: center;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: #0b132b;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 16px;
    color: #7a869a;
    margin-bottom: 45px;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

/* كارت الكورس */
.course-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0px 1px 8px 0px #0103041A;
    border: 1px solid #f0f2f5;
    text-align: right;
    transition: transform 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
}

/* صورة الكورس النائبة */
.course-image-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #003366, #0055a5);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* محاكاة لتصميم البانر الداخلي */
.course-image-placeholder::before {
    content: '';
    position: absolute;
    left: -20px;
    top: -20px;
    width: 180px;
    height: 180px;
    background: #ffb703;
    border-radius: 50%;
    opacity: 0.8;
}

.course-image-placeholder.has-custom-image::before {
    display: none;
}

.banner-text {
    position: relative;
    z-index: 1;
    text-align: center;
}
.banner-badge {
    background: #ffb703;
    color: #000;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 8px;
}

/* تفاصيل الكورس */
.course-info {
    padding: 16px 4px 0 4px;
}

.course-title {
    font-size: 23px;
    font-weight: 600;
    color: #0e1e38;
    margin-bottom: 6px;
    line-height: 1.4;
}

.course-category {
    font-size: 12px;
    font-weight: 400;
    color: #010304;
    margin-bottom: 16px;
}

/* صف المحاضر والتقييم والسعر */
.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.price-badge {
    background-color: #6646F3;
    color: white;
    padding: 6px 14px;
    border-radius: 46px;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.2;
}

.instructor-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating {
    font-size: 12px;
    color: #000000;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating i {
    color: #ffb703;
}

.instructor {
    display: flex;
    align-items: center;
    gap: 8px;
}

.instructor span {
    font-size: 12px;
    font-weight: 400;
    color: #746C83;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;  
    overflow: hidden;
}

.avatar-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* أزرار التحكم */
.card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-subscribe {
    background-color: #fca311;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 65px;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-subscribe:hover {
    background-color: #e59500;
}

.btn-details {
    background-color: transparent;
    color: #075BD3;
    border: 2px solid #075BD3;
    padding: 12px;
    border-radius: 65px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.btn-details:hover {
    background-color: #075BD3;
    color: white;
}


/* --- التحكم في التجاوب (Responsive) عبر الـ Grid مريح جداً --- */

@media (max-width:990px) {
    .courses-grid{
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 992px) {
    .footer-container {
        /* في الشاشات المتوسطة يتحول لعمودين */
        grid-template-columns: 1fr 1fr;
    }
    .modal-content{
        width: unset !important;
        margin-right: 20px;
        margin-left: 20px;
    }
}

@media (max-width: 600px) {
    .footer-container {
        /* في شاشات الموبايل يتحول لعمود واحد فقط وكل شيء يتوسط */
        /* grid-template-columns: 1fr; */
        text-align: center;
    }
    
    .footer-column, .footer-brand-column {
        text-align: center;
    }
    
    .brand-description {
        margin: 0 auto 30px auto;
    }
    
    .social-links {
        justify-content: center;
    }
    .courses-grid{
        grid-template-columns: 1fr;
    }
    .main-footer{
        padding: 20px;
    }
}
.flex-container{
    display:flex;
}
.courseDetailsPage{
    width:91%; 
    margin:30px auto 0 auto;
        padding-bottom:50px;

}
.back-btn {
    display: inline-block;
    padding: .25rem .5rem;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
    background-color: #212529;
    border: 1px solid #212529;
    border-radius: .25rem;
    text-decoration: none;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    transition: color .15s ease-in-out,
                background-color .15s ease-in-out,
                border-color .15s ease-in-out,
                box-shadow .15s ease-in-out;
}

.back-btn:hover {
    color: #fff;
    background-color: #1c1f23;
    border-color: #1a1e21;
    text-decoration: none;
}

.back-btn:focus,
.back-btn:focus-visible {
    color: #fff;
    background-color: #1c1f23;
    border-color: #1a1e21;
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(66, 70, 73, .5);
}

.back-btn:active {
    color: #fff;
    background-color: #1a1e21;
    border-color: #16181b;
}

.back-btn:disabled,
.back-btn.disabled {
    opacity: .65;
    pointer-events: none;
}