/* --- Global Variables (يفضل أن تكون في ملف CSS رئيسي) --- */
:root {
    --primary-color: #3e838c; /* Teal */
    --secondary-color: #4b9fa5; /* Dark Blue */
    --text-dark: #333;
    --text-light: #555;
    --bg-light: #ffffff;
    --bg-section-alt: #f8f9fa;
    --border-color: #e0e0e0; /* نفس لون الحدود في HTML الأصلي */
    --accordion-header-bg: #f7f7f7; /* لون خلفية رأس الأكورديون */
    --font-family: "Cairo", sans-serif;
}

/* --- General Styles for Legal Pages --- */
.legal-page {
    line-height: 1.8;
    color: var(--text-dark);
    font-family: var(--font-family); /* تطبيق الخط العام */
}

.legal-page .container {
    width: 90%;
    max-width: 850px;
    margin: 0 auto;
    padding: 0 15px;
}

.legal-page h1,
.legal-page h2 {
    color: var(--primary-color);
    margin-bottom: 0.75em;
    font-weight: 700;
}

.legal-page p,
.legal-page ul li {
    margin-bottom: 1em;
    color: var(--text-light);
    font-size: 1rem;
}
.legal-page ul {
    padding-right: 20px;
    margin-bottom: 1.5em;
}
.legal-page ul li {
    margin-bottom: 0.5em;
}

/* --- Page Hero Section --- */

.page-hero-legal {
    background-color: var(--secondary-color); /* أو استخدم صورة خلفية */
    color: var(--bg-light);
    padding: 50px 0;
    text-align: center;
    margin-bottom: 40px;
}

.page-hero-legal h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--bg-light);
}
/* --- Legal Content Section --- */
.legal-content-section {
    padding: 20px 0 40px;
}
.tab-content-wrapper {
    /* اسم الكلاس الذي استخدمته لتغليف الأكورديون */
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 20px;
    background-color: var(--bg-light); /* خلفية للحاوية إذا أردت */
}

/* --- Custom Accordion Styles (Bootstrap 5 Override/Enhancement) --- */
/* Bootstrap 5 يستخدم كلاس .accordion-button و .accordion-body */
/* سنقوم بتخصيص المظهر قليلاً ليشبه ما لديك */

.accordion-custom .card {
    /* إذا كنت لا تزال تستخدم هيكل .card */
    border: 1px solid var(--border-color);
    margin-bottom: -1px; /* To overlap borders */
    border-radius: 0; /* Reset default card radius if any */
}
.accordion-custom .card:first-child {
    border-top-left-radius: 4px; /* Match wrapper's border-radius */
    border-top-right-radius: 4px;
}
.accordion-custom .card:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    margin-bottom: 0;
}

.accordion-custom .card-header {
    background-color: var(--accordion-header-bg);
    padding: 0;
    border-bottom: 1px solid var(--border-color); /* Add border between header and body if not collapsed */
}
.accordion-custom .card-header:has(+ .collapse.show) {
    /* If next sibling .collapse is shown */
    /* border-bottom: 1px solid var(--border-color); */ /* Already set above */
}
.accordion-custom .card-header:has(+ .collapse:not(.show)) {
    border-bottom: none; /* Remove border if collapsed and it's not the last card */
}
.accordion-custom .card:last-child .card-header:has(+ .collapse:not(.show)) {
    border-bottom: none;
}

.accordion-custom .btn-accordion {
    font-family: var(--font-family);
    font-weight: 700;
    color: var(--primary-color);
    text-align: right; /* For RTL */
    display: block;
    width: 100%;
    padding: 0.75rem 1.25rem; /* Bootstrap's default-like padding */
    border: none;
    background: none; /* Transparent background for the button itself */
    cursor: pointer;
    position: relative;
    font-size: 1.1rem;
    transition: background-color 0.2s ease;
    text-decoration: none; /* Remove underline if it's an <a> tag behaving like a button */
}
.accordion-custom .btn-accordion:hover {
    background-color: #e9e9e9;
    color: var(--secondary-color);
}

/* Styling the Bootstrap accordion icon (::after on .accordion-button) */
.accordion-custom .btn-accordion::after {
    /* Bootstrap 5 handles its own icon, but we can customize it or use our own */
    /* If you want to use your '+' and '-' */
    content: "+";
    font-family: monospace;
    position: absolute;
    left: 1.25rem; /* Adjust for RTL */
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    font-weight: bold;
    transition: transform 0.3s ease;
    color: var(--primary-color); /* Color for the icon */
}

.accordion-custom .btn-accordion:not(.collapsed)::after {
    content: "-";
    /* Bootstrap 5 rotates its default SVG icon, so this might conflict if you don't override Bootstrap's icon completely */
    /* transform: translateY(-50%) rotate(0deg); /* Reset rotation if needed */
}
.accordion-custom .btn-accordion:focus {
    box-shadow: none; /* Remove Bootstrap focus shadow if not desired */
    outline: none;
}

.accordion-custom .card-body {
    padding: 1.25rem; /* Bootstrap's default-like padding */
    background-color: var(--bg-light);
}
.accordion-custom .card-body p:last-child {
    margin-bottom: 0;
}

/* Ensure Bootstrap's .collapse and .show classes work as expected */
.accordion-custom .collapse:not(.show) {
    display: none;
}
.accordion-custom .collapse.show {
    display: block;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .page-hero-legal h1 {
        font-size: 1.8rem;
    }
    .accordion-custom .btn-accordion {
        font-size: 1rem;
        padding: 0.6rem 1rem;
    }
    .accordion-custom .btn-accordion::after {
        left: 1rem;
    }
    .legal-page p,
    .legal-page ul li {
        font-size: 0.95rem;
    }
}
