/* assets/css/main.css */

/* --- CSS Variables (Palette & Reusables) --- */
/*
   هنا نقوم بتعريف المتغيرات الأساسية للمشروع.
   يمكنك تعديل هذه القيم لضبط الألوان والخطوط والظلال بسهولة في جميع أنحاء الموقع.
*/
:root {
    /* Primary Colors */
    --primary-blue: #0066cc; /* لون أزرق أساسي للعناوين والروابط الهامة */
    --accent-blue: #004d99; /* لون أزرق أغمق للhover أو العناصر الثانوية */
    --dark-blue: #2c3e50; /* لون أزرق داكن جدًا، مثالي للخلفيات أو الهيدر/الفوتر */
    --light-blue: #e3f2fd; /* لون أزرق فاتح جدًا للخلفيات الخفيفة */

    /* Grayscale/Neutrals */
    --white: #ffffff;
    --black: #000000;
    --light-gray: #f5f5f5; /* خلفية للعناصر الخفيفة */
    --background-light: #f4f7f6; /* خلفية الجسم العامة */
    --dark-gray: #343a40; /* لون رمادي داكن للفوتر أو عناصر مشابهة */
    --text-color-general: #333; /* لون النص العام */
    --text-dark: #555; /* لون نص أغمق قليلاً */
    --light-text-color: #f8f8f8; /* لون نص فاتح (مثلاً للفوتر) */
    --border-light: #eee; /* لون الحدود الخفيفة */
    --border-medium: #ddd; /* لون حدود متوسط */
    --border-dark: #dee2e6; /* لون حدود داكن قليلاً (للجداول مثلاً) */

    /* Specific Component Colors (يمكنك نقل هذه إلى أعلى ودمجها إذا كانت عامة بما يكفي) */
    --welcome-bg: #e3f2fd; /* خلفية قسم الترحيب في لوحة التحكم */
    --light-bg: #eaf6ff; /* خلفية قسم Intro في الصفحة الرئيسية */
    --light-blue-bg: #f0f8ff; /* خلفية رأس الأكورديون */
    --lighter-blue-bg: #e6f0ff; /* خلفية رأس الأكورديون عند التنشيط */
    --border-blue-active: #cce0ff; /* لون حدود رأس الأكورديون عند التنشيط */
    --light-bg-alt: #fcfdff; /* خلفية جسم الأكورديون */
    --border-light-inner: #e8e8e8; /* حدود الأكورديون الداخلي (الربع) */
    --background-light-quarter-header: #f9f9f9; /* خلفية رأس الربع */
    --background-light-hover: #f0f0f0; /* خلفية رأس الربع عند الهوفر */
    --light-blue-active: #eef; /* خلفية رأس الربع عند التنشيط */
    --border-blue-active-quarter: #ddeeff; /* حدود رأس الربع عند التنشيط */
    --border-light-dashed: #eee; /* حدود منقطة خفيفة */
    --light-blue-action: #f0f8ff; /* خلفية أزرار الإجراءات */
    --border-light-blue-action: #cce0ff; /* حدود أزرار الإجراءات */
    --light-blue-action-hover: #e6f0ff; /* خلفية أزرار الإجراءات عند الهوفر */

    /* Shadows */
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-medium: 0 0 5px rgba(0,0,0,0.1);
    --shadow: 0 4px 10px rgba(0,0,0,0.1); /* ظل أوسع */
    --shadow-action-btn: 0 1px 3px rgba(0, 102, 204, 0.1); /* ظل لأزرار الإجراءات */
    --shadow-action-btn-hover: 0 2px 5px rgba(0, 102, 204, 0.2); /* ظل لأزرار الإجراءات عند الهوفر */

    /* Transitions */
    --transition: all 0.3s ease;
    --transition-long: all 0.4s ease;
    --transition-short: all 0.2s ease;

    /* Max Width */
    --max-width: 1200px;
}

/* --- General Body Styling --- */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-light);
    color: var(--text-color-general);
    line-height: 1.6;
    direction: rtl; /* Ensure RTL for Arabic content */
    text-align: right;
}

/* --- Header Styling (Main Navigation) --- */
header {
    background-color: var(--white);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-light);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

header .logo img {
    height: 50px;
    vertical-align: middle;
}

/* Specific Navbar styling for Bootstrap/custom structure - if not using general nav-links */
/*
   NOTE: If you are using Bootstrap's Navbar, these styles might need to be adjusted
   or placed in a separate section that overrides Bootstrap's defaults.
   The following styles assume a custom `nav-links` structure.
*/
.navbar { /* From previous parts - general navbar styles */
    background-color: var(--dark-blue) !important; /* لون خلفية شريط التنقل */
    padding: 0.8rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
}

/* These nav-links styles are from the custom header nav, not Bootstrap's default .navbar-nav */
header .nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

header .nav-links li a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: bold;
    font-size: 17px;
    transition: var(--transition-short);
    position: relative;
    padding-bottom: 5px;
}

header .nav-links li a:hover {
    color: var(--primary-blue);
    transform: translateY(-2px);
}

header .nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0; /* Correct for RTL */
    width: 0;
    height: 3px;
    background-color: var(--primary-blue);
    transition: width 0.3s ease;
}

header .nav-links li a:hover::after {
    width: 100%;
}

/* Bootstrap-like .navbar-nav specific styles */
.navbar-nav { /* From previous parts - general navbar styles */
    margin-right: auto; /* Push items to the right for RTL */
    margin-left: unset; /* Ensure no conflicting left margin */
}

.nav-item {
    margin-left: 0.5rem; /* Space between nav items */
    margin-right: 0.5rem;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition-short);
    color: var(--white); /* Default nav-link color */
}

.nav-link:hover {
    color: var(--primary-blue) !important;
}

/* Dropdown Menu Styles (General) */
.dropdown-menu {
    background-color: var(--dark-blue); /* لون خلفية القائمة المنسدلة */
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    left: auto; /* Override default Bootstrap LTR behavior */
    right: 0; /* Align dropdown to the right for RTL */
}

.dropdown-item {
    color: var(--white); /* لون نص عناصر القائمة المنسدلة */
    padding: 0.5rem 1.5rem;
    text-align: right; /* Ensure text is right-aligned */
}

.dropdown-item:hover {
    background-color: var(--primary-blue);
    color: var(--white) !important;
}

/* Language Toggle Button */
.language-toggle .btn-secondary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    min-width: 120px;
    color: var(--white);
}

.language-toggle .btn-secondary:hover {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.language-toggle .dropdown-menu {
    min-width: 120px;
}

/* --- Hero Section Styles --- */
.header-hero {
    background: linear-gradient(135deg, var(--dark-blue), var(--primary-blue));
    color: var(--white);
    padding: 60px 20px;
    border-radius: 0 0 15px 15px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    text-align: right; /* Ensure text alignment for RTL */
}

.header-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://via.placeholder.com/1500x300?text=Security+Awareness+Banner') no-repeat center center/cover;
    opacity: 0.1;
    z-index: 0;
}

.header-hero .container {
    position: relative;
    z-index: 1;
}

/* --- Card Styles (General) --- */
.card {
    border-radius: 12px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* --- Intro Section --- */
.intro-section {
    background-color: var(--light-bg);
    border-right: 5px solid var(--primary-blue); /* Border on the right for RTL */
}

.feature-list li {
    margin-bottom: 10px;
}

.icon-feature {
    color: var(--primary-blue);
    margin-left: 10px; /* Space on the left for RTL */
}

/* --- Alert Styles --- */
.alert-custom {
    background-color: #fff3cd; /* Warning yellow */
    border-color: #ffeeba;
    color: #664d03;
    border-right: 5px solid #ffc107; /* Border on the right for RTL */
}

/* --- Table Styles --- */
.table-bordered th, .table-bordered td {
    border-color: var(--border-dark);
}

.table thead th {
    background-color: var(--light-gray);
    color: var(--text-color-general);
}

.table tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.05);
}

.table tbody tr:hover {
    background-color: var(--light-gray); /* Lighter hover background */
}

/* --- Button Styles --- */
.btn-primary, .btn-outline-primary {
    border-radius: 8px;
    font-weight: 600;
}

.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.btn-outline-primary {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    background-color: transparent;
}

.btn-outline-primary:hover {
    color: var(--white) !important;
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* Guide CTA Button */
.guide-cta-section {
    background-color: #fefbe6; /* Light yellow background */
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-medium);
    margin-top: 50px;
    text-align: center;
}

.guide-cta-btn {
    background-color: #e67e22; /* Orange color */
    color: var(--white);
    padding: 15px 30px;
    font-size: 1.15rem;
    font-weight: bold;
    border-radius: 8px;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.guide-cta-btn:hover {
    background-color: #d35400; /* Darker orange */
    transform: translateY(-3px);
    color: var(--white);
}

.guide-cta-btn i {
    margin-left: 10px; /* Icon on the left for RTL */
    font-size: 1.3rem;
}

.whatsapp-btn {
    background-color: #25D366; /* WhatsApp green */
    color: var(--white);
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 20px;
    transition: var(--transition-short);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.whatsapp-btn:hover {
    background-color: #1DA851; /* Darker green */
    color: var(--white);
}
.whatsapp-btn i {
    margin-left: 8px; /* Icon on the left for RTL */
}

/* --- Dashboard Specific Styles --- */
.dashboard-container {
    max-width: var(--max-width);
    margin: auto;
    padding: 2rem;
}

.welcome {
    background-color: var(--welcome-bg);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 2rem;
}

.welcome h2 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.stats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.stat-box {
    background-color: var(--light-gray);
    padding: 1rem 2rem;
    border-radius: 8px;
    min-width: 200px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-box h3 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-size: 2.2em;
}

.stat-box p {
    font-size: 1.1em;
    color: var(--text-dark);
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background-color: var(--white);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05); /* Can be var(--shadow-light) */
    transition: var(--transition-short);
}

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

.course-card h4 {
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
}

.course-card p {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.course-card a {
    display: inline-block;
    margin-top: 0.8rem;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    transition: var(--transition-short);
}

.course-card a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* --- Main Content Area - Specific Sections --- */
.page-title {
    text-align: center;
    color: var(--primary-blue);
    font-size: 3em;
    margin-bottom: 30px;
    border-bottom: 3px solid var(--primary-blue);
    padding-bottom: 15px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.program-details {
    max-width: 900px;
    margin: 0 auto 40px auto;
    padding: 30px;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: right;
    direction: rtl;
}

.program-details h2 {
    color: var(--primary-blue);
    font-size: 2.2em;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 10px;
}

.program-details ul {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}

.program-details ul li {
    margin-bottom: 12px;
    font-size: 1.1em;
    padding-right: 25px;
    position: relative;
}

.program-details ul li::before {
    content: '•';
    color: var(--primary-blue);
    position: absolute;
    right: 0;
    top: 0;
    font-weight: bold;
    font-size: 1.2em;
}

.register-button {
    display: block;
    width: fit-content;
    margin: 30px auto;
    padding: 15px 30px;
    background-color: var(--primary-blue);
    color: var(--white);
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.2em;
    transition: var(--transition-long);
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.3);
}

.register-button:hover {
    background-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 102, 204, 0.4);
}

/* --- Accordion Styling --- */
.accordion-item {
    border: 1px solid var(--border-light);
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--white);
    box-shadow: var(--shadow-light);
}

.accordion-header {
    width: 100%;
    background-color: var(--light-blue-bg);
    color: var(--primary-blue);
    padding: 18px 25px;
    text-align: right;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    outline: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.accordion-header::after {
    content: '➕';
    font-size: 1.2em;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.accordion-header.active {
    background-color: var(--lighter-blue-bg);
    color: var(--accent-blue);
    border-bottom: 1px solid var(--border-blue-active);
}

.accordion-header.active::after {
    content: '➖';
    transform: rotate(0deg);
}

.accordion-body {
    display: none;
    padding: 20px 25px;
    background-color: var(--light-bg-alt);
    border-top: 1px solid var(--border-light);
}

.accordion-body.open {
    display: block;
}

.accordion-inner {
    padding: 10px 0;
}

/* --- Quarter (Inner Accordion) Styling --- */
.quarter {
    margin-bottom: 15px;
    border: 1px solid var(--border-light-inner);
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--white);
    box-shadow: 0 1px 5px rgba(0,0,0,0.03); /* Keep this specific shadow, or make a var for it */
}

.quarter h4 {
    background-color: var(--background-light-quarter-header);
    padding: 12px 20px;
    margin: 0;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    color: var(--text-color-general);
    transition: var(--transition-short);
    border-bottom: 1px solid transparent;
}

.quarter h4:hover {
    background-color: var(--background-light-hover);
    color: var(--primary-blue);
}

.quarter h4::after {
    content: '▼';
    font-size: 0.9em;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.quarter h4.active {
    background-color: var(--light-blue-active);
    border-bottom-color: var(--border-blue-active-quarter);
}

.quarter h4.active::after {
    content: '▲';
    transform: rotate(0deg);
}

.quarter ul {
    list-style-type: none;
    padding: 15px 20px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: var(--white);
}

.quarter ul.open {
    max-height: 1000px;
    padding-top: 15px;
    padding-bottom: 15px;
}

.quarter li {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-light-dashed);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    font-size: 1em;
}

.quarter li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.quarter li > span {
    flex-grow: 1;
    margin-inline-end: 15px; /* Use logical property for RTL */
    padding-top: 5px;
    word-break: break-word;
}

.file-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 5px;
}

.file-actions button,
.file-actions a {
    padding: 6px 14px;
    font-size: 0.95em;
    background-color: var(--light-blue-action);
    border: 1px solid var(--border-light-blue-action);
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    color: var(--primary-blue);
    transition: var(--transition-short);
    white-space: nowrap;
    box-shadow: var(--shadow-action-btn);
}

.file-actions button:hover,
.file-actions a:hover {
    background-color: var(--light-blue-action-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-action-btn-hover);
}

/* --- Image & Text Utilities --- */
.image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.text-justify {
    text-align: justify;
}

/* --- Back to top button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px; /* Position to the right for RTL */
    left: auto; /* Ensure no conflict with left property */
    z-index: 1000;
    display: none; /* Controlled by JavaScript */
    background-color: var(--dark-gray);
    border-color: var(--dark-gray);
    color: var(--white);
    opacity: 0.8;
    border-radius: 50%; /* Make it round */
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem; /* Size of the icon/text inside */
    transition: var(--transition-short);
}

.back-to-top:hover {
    opacity: 1;
    background-color: var(--accent-blue); /* Slightly different hover color */
    border-color: var(--accent-blue);
}

.back-to-top i {
    color: var(--white);
}

/* --- Footer styles --- */
footer {
    padding: 30px;
    background: var(--dark-gray);
    color: var(--white);
    margin-top: 30px;
    border-top: 3px solid var(--primary-blue);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    text-align: right;
    direction: rtl;
    font-size: 0.95em;
}

footer .footer-content { /* From combined part 3 */
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

footer p { /* From combined part 3 */
    margin: 0 0 20px 0;
}

footer > div { /* From original part 2, adjusted */
    flex: 1;
    min-width: 150px;
    margin: 0 15px;
}

footer h4 {
    color: var(--white);
    margin-bottom: 15px;
    font-weight: bold;
    text-align: right;
}

footer a {
    color: #ccc; /* Lighter color for footer links */
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    transition: var(--transition-short);
}

footer a:hover {
    color: var(--primary-blue);
}

footer .copyright {
    flex-basis: 100%;
    text-align: center;
    margin-top: 30px;
    border-top: 1px solid #555; /* Can be a variable */
    padding-top: 20px;
    font-size: 0.9em;
    color: #aaa; /* Can be a variable */
}

.contact-info i {
    margin-left: 8px; /* Icon on the left for RTL */
    color: var(--primary-blue);
}

footer .social-links { /* From combined part 3 */
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

footer .social-links a { /* From combined part 3 */
    display: inline-block;
    text-decoration: none;
}

footer .social-links img { /* From combined part 3 */
    height: 30px;
    width: 30px;
    vertical-align: middle;
    transition: var(--transition);
    filter: grayscale(100%) brightness(180%);
}

footer .social-links img:hover { /* From combined part 3 */
    transform: scale(1.15) rotate(5deg);
    filter: grayscale(0%) brightness(100%);
    opacity: 0.9;
}


/* --- Responsive Styles (Media Queries) --- */
@media (max-width: 991.98px) { /* For Bootstrap's 'lg' breakpoint */
    .games-container { /* Assuming this is part of your content layout */
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .main-content {
        padding: 20px;
    }

    /* Navbar Toggle & Collapse Behavior for Mobile */
    .navbar-toggler {
        display: block !important;
        color: var(--white);
        font-size: 1.5rem;
    }
    .navbar-collapse {
        background-color: var(--dark-gray);
        padding: 10px 0;
        position: absolute;
        top: 100%;
        right: 0; /* Align to the right for RTL */
        left: auto;
        width: 100%;
        z-index: 1000;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }

    .navbar-nav {
        padding: 0 15px;
        /* Ensure no extra margins from desktop styles */
        margin-right: unset;
        margin-left: unset;
    }

    .navbar-nav .nav-item {
        border-bottom: 1px solid #444;
        padding: 5px 0;
        text-align: right;
    }

    .navbar-nav .nav-item:last-child {
        border-bottom: none;
    }

    .navbar-nav .nav-link {
        padding: 10px 0 !important;
        width: 100%;
    }

    /* Dropdown adjustments within mobile nav */
    .navbar-nav .dropdown-menu {
        position: static; /* Crucial: make dropdowns within collapsible nav static */
        float: none;
        width: 100%;
        margin-top: 5px;
        border-radius: 0;
        background-color: #555; /* Darker background for nested dropdowns */
        padding-right: 20px; /* Indent for sub-items */
        box-shadow: none;
        right: unset; /* Remove specific right alignment here */
        left: unset;
    }

    .navbar-nav .dropdown-menu .dropdown-item {
        color: var(--white);
        padding: 8px 15px;
        text-align: right;
    }

    .navbar-nav .dropdown-menu .dropdown-item:hover {
        background-color: var(--accent-blue);
        color: var(--white) !important;
    }

    /* Language Toggle Specific Styles for Mobile */
    .language-toggle .dropdown-toggle {
        width: 100%;
        text-align: right;
        padding-right: 15px;
        justify-content: flex-end; /* Align icon and text to the right */
    }
    .language-toggle .dropdown-menu {
        text-align: right;
    }
    .language-toggle .dropdown-item {
        padding-right: 30px;
    }

    /* Dashboard responsive adjustments */
    .dashboard-container {
        padding: 1rem;
    }
    .stats {
        flex-direction: column; /* Stack stats vertically on small screens */
    }
    .stat-box {
        min-width: 100%;
    }
    .courses-grid {
        grid-template-columns: 1fr; /* Single column on small screens */
    }

    /* General site responsive adjustments */
    .header-hero {
        padding: 40px 15px;
    }
    .header-hero h1 {
        font-size: 2rem;
    }
    .header-hero p.lead {
        font-size: 1.1rem;
    }
    .section-title {
        text-align: center; /* Adjust based on content */
        width: 100%;
    }
    body, p, li, table {
        text-align: right; /* Default for RTL */
    }

    /* Hide the regular nav-links on smaller screens if using Bootstrap Navbar */
    header .nav-links {
        display: none;
    }
    /* Show the Bootstrap toggler */
    .navbar-toggler {
        display: block !important;
    }
}

@media (max-width: 767.98px) { /* For Bootstrap's 'md' breakpoint */
    .games-container {
        grid-template-columns: 1fr; /* Single column */
        gap: 1.5rem;
    }
    .hero-section h1 {
        font-size: 2.5rem;
    }
    .hero-section p {
        font-size: 1rem;
    }
    footer > div {
        flex-basis: 45%;
        margin-bottom: 20px;
    }
    footer > div:last-of-type:not(.copyright) {
        flex-basis: 100%;
    }
    .back-to-top {
        bottom: 20px;
        right: 20px;
        left: auto;
        font-size: 1.1rem; /* Slightly smaller icon */
        width: 40px; /* Slightly smaller button */
        height: 40px;
    }
}

@media (max-width: 480px) { /* For very small screens */
    footer > div {
        flex-basis: 100%;
        margin: 0 0 15px 0;
    }
    /* Further adjustments for extremely small devices */
    .dashboard-container, main {
        padding: 1rem;
    }
    .program-details {
        padding: 20px;
    }
    .accordion-header, .accordion-body, .quarter h4, .quarter ul {
        padding-left: 15px;
        padding-right: 15px;
    }
    .file-actions {
        justify-content: center; /* Center buttons if they wrap */
    }
}
/* assets/css/main.css - قم بتحديث هذا الملف */

/* --- CSS Variables (Palette & Reusables) --- */
/* تأكد من أن هذه المتغيرات موجودة في ملفك الرئيسي */
:root {
    /* Primary Colors */
    --primary-blue: #0066cc; /* لون أزرق أساسي للعناوين والروابط الهامة */
    --primary-dark: #2c3e50; /* لون أزرق داكن جدًا، مثالي للخلفيات أو الهيدر/الفوتر (تم تحديث الاسم) */
    --accent-blue: #004d99; /* لون أزرق أغمق للhover أو العناصر الثانوية */
    --light-blue: #e3f2fd; /* لون أزرق فاتح جدًا للخلفيات الخفيفة */
    --accent-green: #28a745; /* لون أخضر للتقدم المكتمل */

    /* Grayscale/Neutrals */
    --white: #ffffff;
    --black: #000000;
    --light-gray: #f5f5f5; /* خلفية للعناصر الخفيفة */
    --background-light: #f4f7f6; /* خلفية الجسم العامة */
    --dark-gray: #343a40; /* لون رمادي داكن للفوتر أو عناصر مشابهة */
    --text-color-general: #333; /* لون النص العام */
    --text-dark: #555; /* لون نص أغمق قليلاً */
    --text-medium: #6c757d; /* لون نص متوسط (جديد) */
    --light-text-color: #f8f8f8; /* لون نص فاتح (مثلاً للفوتر) */
    --border-light: #eee; /* لون الحدود الخفيفة */
    --border-medium: #ddd; /* لون حدود متوسط */
    --border-dark: #dee2e6; /* لون حدود داكن قليلاً (للجداول مثلاً) */

    /* Specific Component Colors (يمكنك نقل هذه إلى أعلى ودمجها إذا كانت عامة بما يكفي) */
    --welcome-bg: #e3f2fd; /* خلفية قسم الترحيب في لوحة التحكم */
    --light-bg: #eaf6ff; /* خلفية قسم Intro في الصفحة الرئيسية */
    --light-blue-bg: #f0f8ff; /* خلفية رأس الأكورديون */
    --lighter-blue-bg: #e6f0ff; /* خلفية رأس الأكورديون عند التنشيط */
    --border-blue-active: #cce0ff; /* لون حدود رأس الأكورديون عند التنشيط */
    --light-bg-alt: #fcfdff; /* خلفية جسم الأكورديون */
    --border-light-inner: #e8e8e8; /* حدود الأكورديون الداخلي (الربع) */
    --background-light-quarter-header: #f9f9f9; /* خلفية رأس الربع */
    --background-light-hover: #f0f0f0; /* خلفية رأس الربع عند الهوفر */
    --light-blue-active: #eef; /* خلفية رأس الربع عند التنشيط */
    --border-blue-active-quarter: #ddeeff; /* حدود رأس الربع عند التنشيط */
    --border-light-dashed: #eee; /* حدود منقطة خفيفة */
    --light-blue-action: #f0f8ff; /* خلفية أزرار الإجراءات */
    --border-light-blue-action: #cce0ff; /* حدود أزرار الإجراءات */
    --light-blue-action-hover: #e6f0ff; /* خلفية أزرار الإجراءات عند الهوفر */

    /* Shadows */
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-medium: 0 0 5px rgba(0,0,0,0.1);
    --shadow: 0 4px 10px rgba(0,0,0,0.1); /* ظل أوسع */
    --shadow-action-btn: 0 1px 3px rgba(0, 102, 204, 0.1); /* ظل لأزرار الإجراءات */
    --shadow-action-btn-hover: 0 2px 5px rgba(0, 102, 204, 0.2); /* ظل لأزرار الإجراءات عند الهوفر */

    /* Transitions */
    --transition: all 0.3s ease;
    --transition-long: all 0.4s ease;
    --transition-short: all 0.2s ease;

    /* Max Width */
    --max-width: 1200px;
}

/* --- General Body Styling --- */
body {
    font-family: 'Tajawal', sans-serif; /* استخدام الخط الذي أضفته في HTML */
    margin: 0;
    padding: 0;
    background-color: var(--background-light);
    color: var(--text-color-general);
    line-height: 1.6;
    direction: rtl; /* Ensure RTL for Arabic content */
    text-align: right;
}

/* --- Header Styling (Main Navigation) --- */
header {
    background-color: var(--white);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-light);
    display: flex; /* لتمكين استخدام flexbox للعناصر داخل الهيدر */
    justify-content: space-between; /* توزيع العناصر (لوجو، زر القائمة، زر اللغة، الروابط) */
    align-items: center; /* محاذاة العناصر عمودياً */
    max-width: var(--max-width); /* تحديد عرض أقصى */
    margin: 0 auto; /* توسيط الهيدر */
    padding: 0 20px; /* هامش داخلي جانبي */
}

header .logo {
    display: flex; /* لجعل الشعار والنص بجانب بعضهما */
    align-items: center;
    text-decoration: none;
    color: var(--primary-dark);
    font-size: 1.5rem;
    font-weight: bold;
}

header .logo img {
    height: 50px;
    vertical-align: middle;
    margin-left: 10px; /* مسافة بين الشعار والنص في RTL */
}

/* زر تبديل القائمة (Mobile Toggle) */
.menu-toggle {
    display: none; /* يتم إخفاؤه في وضع سطح المكتب ويظهر في الشاشات الصغيرة */
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary-dark);
    margin-right: auto; /* يدفع زر اللغة والروابط لليمين */
    margin-inline-end: 20px; /* مسافة بين زر القائمة وزر اللغة */
}

/* زر تبديل اللغة */
.lang-switch {
    background-color: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition-short);
    margin-inline-end: 20px; /* مسافة بين زر اللغة والقائمة الرئيسية */
}

.lang-switch:hover {
    background-color: var(--accent-blue);
}

/* القائمة الرئيسية (Desktop Navigation) */
header nav {
    display: flex; /* في وضع سطح المكتب، تكون القائمة أفقية */
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

header nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: bold;
    font-size: 17px;
    transition: var(--transition-short);
    position: relative;
    padding-bottom: 5px;
}

header nav a:hover,
header nav a.active { /* إضافة حالة active */
    color: var(--primary-blue);
    transform: translateY(-2px);
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0; /* Correct for RTL */
    width: 0;
    height: 3px;
    background-color: var(--primary-blue);
    transition: width 0.3s ease;
}

header nav a:hover::after,
header nav a.active::after { /* إضافة حالة active */
    width: 100%;
}

/* قائمة الجوال (Mobile Navigation) - هذا هو الجزء الذي كان يظهر بشكل غير متوقع */
.mobile-nav {
    display: none; /* إخفاؤها بشكل افتراضي في وضع سطح المكتب */
    background-color: var(--primary-dark);
    width: 100%;
    position: absolute; /* أو fixed لتثبيتها عند التمرير */
    top: 80px; /* أسفل الهيدر */
    right: 0;
    left: 0;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    flex-direction: column; /* جعل الروابط عمودية */
    padding: 10px 0;
    text-align: right;
}

.mobile-nav.active { /* الفئة التي تضاف بواسطة JavaScript لإظهار القائمة */
    display: flex;
}

.mobile-nav a {
    color: var(--white);
    padding: 15px 20px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease, padding-right 0.3s ease; /* إضافة تأثير للداخل */
}

.mobile-nav a:last-child {
    border-bottom: none;
}

.mobile-nav a:hover {
    background-color: var(--accent-blue);
    padding-right: 25px; /* تأثير لطيف عند الهوفر */
}

/* --- Rest of main.css (باقي الكود الذي قدمته لك سابقًا، بدون تغييرات كبيرة هنا) --- */

/* --- Hero Section Styles --- */
.header-hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue)); /* استخدام primary-dark */
    color: var(--white);
    padding: 60px 20px;
    border-radius: 0 0 15px 15px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    text-align: right; /* Ensure text alignment for RTL */
}

/* ... باقي أنماط main.css كما هي، تأكد من وجودها بالكامل ... */

/* --- Dashboard Specific Styles (من `main.css` لتجنب تكرار الأنماط) --- */
/* تم دمج هذه الأنماط هنا لإزالة الأنماط المتكررة في <style> في HTML */
.dashboard-container {
    max-width: var(--max-width); /* استخدام المتغير */
    margin: 50px auto; /* هامش علوي وسفلي */
    padding: 40px;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 8px 20px var(--shadow-medium); /* ظل أقوى هنا */
    text-align: right; /* Ensure RTL alignment */
    direction: rtl; /* Ensure content flows RTL */
}

.dashboard-container .welcome {
    text-align: center;
    margin-bottom: 40px;
    background-color: var(--welcome-bg); /* استخدام المتغير */
    padding: 1.5rem;
    border-radius: 10px;
}

.dashboard-container .welcome h2 {
    color: var(--primary-dark); /* استخدام المتغير */
    font-size: 2.8em;
    margin-bottom: 10px;
}

.dashboard-container .welcome p {
    color: var(--text-medium); /* استخدام المتغير */
    font-size: 1.1em;
    line-height: 1.6;
}

.dashboard-container .stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 50px;
}

.dashboard-container .stat-box {
    background-color: var(--light-bg); /* استخدام المتغير */
    border-radius: 10px;
    padding: 25px 30px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-container .stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.dashboard-container .stat-box h3 {
    color: var(--primary-blue); /* استخدام المتغير */
    font-size: 2.5em;
    margin-bottom: 10px;
}

.dashboard-container .stat-box p {
    color: var(--text-dark); /* استخدام المتغير */
    font-size: 1.1em;
    font-weight: 500;
}

.dashboard-container h2.my-courses-heading {
    color: var(--primary-dark); /* استخدام المتغير */
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
}

.dashboard-container .courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.dashboard-container .course-card {
    background-color: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-container .course-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.dashboard-container .course-card h4 {
    color: var(--primary-dark); /* استخدام المتغير */
    font-size: 1.8em;
    margin-bottom: 15px;
}

.dashboard-container .course-card p {
    color: var(--text-medium); /* استخدام المتغير */
    font-size: 1em;
    margin-bottom: 20px;
}

.dashboard-container .course-card .progress-value {
    color: var(--accent-green); /* استخدام المتغير */
    font-weight: 700;
}

.dashboard-container .course-card a {
    display: inline-block;
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: fit-content;
    margin-top: auto;
}

.dashboard-container .course-card a:hover {
    background-color: var(--accent-blue);
    transform: translateY(-2px);
}

/* Responsive Styles for Dashboard (من main.css) */
@media (max-width: 768px) { /* Adjust based on your responsive.css breakpoints */
    .dashboard-container {
        padding: 20px;
        margin: 30px auto;
    }
    .dashboard-container .welcome h2 {
        font-size: 2.2em;
    }
    .dashboard-container .stats {
        flex-direction: column;
        align-items: center;
    }
    .dashboard-container .stat-box {
        width: 90%;
        max-width: none;
    }
    .dashboard-container h2.my-courses-heading {
        font-size: 2em;
    }
    .dashboard-container .courses-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-container .course-card {
        padding: 20px;
    }
}


/* --- Responsive Styles (Media Queries) --- */
@media (max-width: 991.98px) { /* For Bootstrap's 'lg' breakpoint, or your custom breakpoint */
    /* Mobile Menu Toggle */
    .menu-toggle {
        display: block; /* إظهار زر التبديل في الشاشات الصغيرة */
    }

    /* Hide Desktop Navigation */
    header nav {
        display: none; /* إخفاء قائمة سطح المكتب في الشاشات الصغيرة */
    }

    /* Mobile Navigation */
    .mobile-nav {
        /*
        هذه الأنماط يجب أن تبقى هنا، لأنها هي التي تتحكم في كيفية ظهور القائمة
        عند تفعيلها بواسطة JavaScript.
        */
    }

    /* ... باقي الـ Media Queries كما هي في main.css ... */

    /* Footer Responsive Adjustments */
    footer > div {
        flex-basis: 45%; /* في الشاشات الأصغر، صفان بعنصرين */
        margin-bottom: 20px;
    }
    footer > div:last-of-type:not(.copyright) {
        flex-basis: 100%; /* اجعل آخر عمود يأخذ عرضًا كاملاً */
    }
}

@media (max-width: 767.98px) { /* For Bootstrap's 'md' breakpoint */
    /* Adjustments for even smaller screens */
    footer > div {
        flex-basis: 100%; /* عمود واحد لكل قسم في الفوتر في الشاشات الصغيرة جداً */
        margin: 0 0 15px 0;
    }
}
