/* style.css */

/* -------------------------------------------------------------------------
   1. CSS Variables & Root Styles
   ------------------------------------------------------------------------- */
:root {
    /* Analogous Color Scheme (Example: Primary Blue -> Teal & Purple-Blue) */
    --primary-color: #3A7CA5; /* A corporate, trustworthy blue */
    --primary-color-darker: #2E6384;
    --primary-color-lighter: #5B9BC4;

    --secondary-color: #2F9C95; /* Teal - Analogous 1 */
    --secondary-color-darker: #257C76;
    
    --tertiary-color: #6A4C93; /* Purple-Blue - Analogous 2 */
    --tertiary-color-darker: #553D76;

    --accent-color: #FFB833; /* Warm Gold/Orange - for CTAs and highlights */
    --accent-color-darker: #D99A2B;

    /* Neutral Colors */
    --light-bg-color: #F8F9FA; /* Very light gray for backgrounds */
    --light-bg-alt-color: #FFFFFF; /* White for alternating backgrounds or cards */
    --medium-gray-color: #CED4DA; /* Borders, subtle text */
    --dark-gray-color: #6C757D;   /* Subheadings, less important text */

    /* Text Colors */
    --text-color-dark: #212529;    /* Main text on light backgrounds */
    --text-color-light: #FFFFFF;   /* Main text on dark backgrounds */
    --text-color-muted: #6c757d; /* Muted text, captions */
    --heading-color: #1A3A53;     /* Darker, distinct heading color */

    /* Fonts */
    --font-family-headings: 'Roboto', 'Cairo', 'Tajawal', sans-serif;
    --font-family-base: 'Lato', 'Cairo', 'Tajawal', sans-serif;

    /* Spacing & Sizing */
    --spacing-unit: 1rem; /* Approx 16px */
    --container-width: 1140px;
    --container-padding: calc(var(--spacing-unit) * 1.5); /* 24px */
    --header-height: 80px;
    --border-radius-base: 8px; /* Subtle biomorphic touch */
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;
    --border-radius-pill: 50px; /* For specific elements like switches */

    /* Transitions & Shadows */
    --transition-base: all 0.3s ease-in-out;
    --box-shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --box-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --box-shadow-lg: 0 8px 25px rgba(0,0,0,0.1);
    --text-shadow-light: 1px 1px 3px rgba(0,0,0,0.5); /* For light text on complex backgrounds */
}

/* -------------------------------------------------------------------------
   2. Global Styles & Resets
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 100%; /* Corresponds to 16px by default */
}

body {
    font-family: var(--font-family-base);
    line-height: 1.7;
    color: var(--text-color-dark);
    background-color: var(--light-bg-color);
    overflow-x: hidden; /* Prevent horizontal scroll */
    direction: rtl; /* For Arabic */
    text-align: right; /* For Arabic */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    color: var(--heading-color);
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    line-height: 1.3;
    font-weight: 700;
}

h1 { font-size: 2.8rem; font-weight: 900; } /* ~44.8px */
h2 { font-size: 2.2rem; } /* ~35.2px */
h3 { font-size: 1.75rem; } /* ~28px */
h4 { font-size: 1.4rem; } /* ~22.4px */

p {
    margin-bottom: var(--spacing-unit);
    color: var(--text-color-dark);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-base);
}
a:hover {
    color: var(--primary-color-darker);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    margin-bottom: var(--spacing-unit);
    padding-right: calc(var(--spacing-unit) * 1.25); /* Indentation for Arabic lists */
}

/* For pages like privacy & terms to avoid header overlap */
.privacy-page-content,
.terms-page-content {
    padding-top: calc(var(--header-height) + var(--spacing-unit) * 2);
    padding-bottom: calc(var(--spacing-unit) * 2);
}

/* -------------------------------------------------------------------------
   3. Layout & Container
   ------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.content-container { /* For general content within sections */
    max-width: 960px; /* Slightly narrower for text-heavy sections */
    margin-left: auto;
    margin-right: auto;
}

.section-padding {
    padding-top: calc(var(--spacing-unit) * 4); /* 64px */
    padding-bottom: calc(var(--spacing-unit) * 4);
}
.section-padding-alternate {
    padding-top: calc(var(--spacing-unit) * 4);
    padding-bottom: calc(var(--spacing-unit) * 4);
    background-color: var(--light-bg-alt-color);
}

.section-title {
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 2.5);
    font-weight: 900;
    color: var(--heading-color);
    position: relative;
}
.section-title::after { /* Subtle biomorphic underline */
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    margin: 0.5rem auto 0;
    border-radius: var(--border-radius-pill);
}

.section-intro, .section-outro {
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-size: 1.1rem;
    color: var(--dark-gray-color);
}

/* -------------------------------------------------------------------------
   4. Header & Navigation
   ------------------------------------------------------------------------- */
.site-header {
    background-color: rgba(255, 255, 255, 0.9); /* Slight glassmorphism */
    backdrop-filter: blur(8px);
    padding: calc(var(--spacing-unit) * 0.75) 0; /* 12px top/bottom */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--box-shadow-sm);
    height: var(--header-height);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo img {
    max-height: 50px; /* Adjust as needed */
    width: auto;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-navigation li {
    margin-right: calc(var(--spacing-unit) * 1.5); /* Spacing for Arabic */
}
.main-navigation li:last-child {
    margin-right: 0;
}

.main-navigation a {
    text-decoration: none;
    color: var(--text-color-dark);
    font-weight: 700;
    padding: 0.5rem 0.2rem;
    position: relative;
    font-size: 0.95rem;
}
.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0; /* For RTL */
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}
.main-navigation a:hover::after,
.main-navigation a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.hamburger-icon {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color-dark);
    position: relative;
    transition: var(--transition-base);
}
.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: var(--text-color-dark);
    transition: var(--transition-base);
    right: 0; /* For RTL */
}
.hamburger-icon::before { top: -8px; }
.hamburger-icon::after { bottom: -8px; }

/* Mobile Menu Active State (JS will toggle .menu-open on body or header) */
.menu-open .hamburger-icon {
    background-color: transparent; /* Middle bar disappears */
}
.menu-open .hamburger-icon::before {
    transform: translateY(8px) rotate(45deg);
}
.menu-open .hamburger-icon::after {
    transform: translateY(-8px) rotate(-45deg);
}


/* -------------------------------------------------------------------------
   5. Global Button Styles
   ------------------------------------------------------------------------- */
.cta-button,
.submit-button,
.button-primary,
.button-secondary,
.modal-trigger,
.read-more-link, /* Apply base button styling to read-more links too */
button, 
input[type="submit"], 
input[type="button"] {
    display: inline-block;
    font-family: var(--font-family-headings);
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 2px solid transparent;
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1.75); /* 12px 28px */
    font-size: 1rem;
    line-height: 1.5;
    border-radius: var(--border-radius-pill); /* Biomorphic: pill shape for distinct buttons */
    transition: var(--transition-base);
    text-decoration: none; /* Ensure links styled as buttons don't have underline */
}

/* Primary Button Style (e.g., Hero CTA, Submit) */
.cta-button,
.submit-button,
.button-primary {
    color: var(--text-color-light);
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: var(--box-shadow-sm);
}
.cta-button:hover,
.submit-button:hover,
.button-primary:hover {
    background-color: var(--accent-color-darker);
    border-color: var(--accent-color-darker);
    color: var(--text-color-light);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
    text-decoration: none;
}

/* Secondary Button Style */
.button-secondary {
    color: var(--primary-color);
    background-color: transparent;
    border-color: var(--primary-color);
}
.button-secondary:hover {
    color: var(--text-color-light);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    text-decoration: none;
}

/* Read More Link Styling (as a button or distinct link) */
.read-more-link {
    color: var(--primary-color);
    background-color: transparent;
    padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1);
    border-radius: var(--border-radius-base);
    font-weight: 700;
    border: 1px solid var(--medium-gray-color);
}
.read-more-link:hover {
    background-color: var(--primary-color-lighter);
    color: var(--text-color-light);
    border-color: var(--primary-color-lighter);
    text-decoration: none;
}


/* -------------------------------------------------------------------------
   6. Card Styles (Global Pattern)
   ------------------------------------------------------------------------- */
.card {
    background-color: var(--light-bg-alt-color);
    border-radius: var(--border-radius-lg); /* Slightly more pronounced radius for cards */
    box-shadow: var(--box-shadow-md);
    overflow: hidden;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure cards in a grid take same height if needed by parent */
    text-align: center; /* Center inline/inline-block children if not flexed */
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.card-image { /* Container for the image */
    width: 100%;
    /* Fixed height for consistency in grids, adjust as needed */
    /* Example: height: 200px; or use aspect-ratio */
    overflow: hidden;
    display: flex; /* For centering the image if it's smaller */
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg-color); /* Fallback bg for images */
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crucial for consistent image display */
    transition: transform 0.4s ease;
}
.card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: calc(var(--spacing-unit) * 1.5); /* 24px */
    flex-grow: 1; /* Allows content to fill space if card height is fixed by grid */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes button to bottom if card is flex column */
    text-align: right; /* Default for Arabic, override if centered content needed */
}
.card-content > *:last-child {
    margin-bottom: 0; /* Remove bottom margin from last element */
}
.card-title {
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    color: var(--heading-color);
    font-size: 1.4rem;
}
.card-text, .card-content p { /* Ensure specific class for card text if needed */
    margin-bottom: var(--spacing-unit);
    color: var(--dark-gray-color);
    font-size: 0.95rem;
    flex-grow: 1; /* Allows text to take available space before button */
}
.card-content .modal-trigger,
.card-content .read-more-link {
    margin-top: auto; /* Pushes button to the bottom of card-content */
    align-self: flex-start; /* Aligns button to the start (right for RTL) */
}


/* -------------------------------------------------------------------------
   7. Section Specific Styles
   ------------------------------------------------------------------------- */

/* Hero Section */
.hero-section {
    position: relative;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: var(--text-color-light); /* As per requirement */
    padding: calc(var(--spacing-unit) * 8) 0; /* Generous padding */
    min-height: 85vh; /* Ensure it's substantial but not fixed */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7)); /* Darkening overlay */
    z-index: 1;
}
.hero-content-container {
    position: relative;
    z-index: 2;
    max-width: 800px;
}
.hero-title {
    font-size: 3.5rem; /* Larger for Hero */
    margin-bottom: var(--spacing-unit);
    color: var(--text-color-light); /* Ensured white */
    text-shadow: var(--text-shadow-light);
    font-weight: 900;
}
.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
    color: var(--text-color-light); /* Ensured white */
    text-shadow: var(--text-shadow-light);
    line-height: 1.8;
}
.hero-section .cta-button {
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2.5); /* Larger CTA */
    font-size: 1.15rem;
}

/* Our Process Section - Timeline */
.timeline {
    position: relative;
    max-width: 750px;
    margin: 0 auto;
}
.timeline::after { /* The central line */
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--secondary-color); /* Using secondary for visual distinction */
    top: 0;
    bottom: 0;
    right: 50%; /* Center line for RTL - this might need adjustment based on item placement */
    margin-right: -2px; /* Adjust for line thickness */
    border-radius: var(--border-radius-sm);
}
.timeline-item {
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 2.5); /* 16px 40px */
    position: relative;
    background-color: inherit;
    width: 50%;
}
/* Alternate items on timeline */
.timeline-item:nth-child(odd) {
    right: 0; /* Item on the right of the line for RTL */
    padding-left: calc(var(--spacing-unit) * 2.5);
    padding-right: 0;
    text-align: left; /* Adjust text align for items on left */
}
.timeline-item:nth-child(even) {
    left: 50%; /* Item on the left of the line for RTL */
    padding-right: calc(var(--spacing-unit) * 2.5);
    padding-left: 0;
    text-align: right;
}

.timeline-item::after { /* Connector from item to line */
    content: '';
    position: absolute;
    width: 25px;
    height: 2px;
    background-color: var(--secondary-color);
    top: calc(var(--spacing-unit) * 1.5 + 8px); /* Align with icon center */
    z-index: 1;
}
.timeline-item:nth-child(odd)::after {
    left: -25px; /* Connector points left */
}
.timeline-item:nth-child(even)::after {
    right: -25px; /* Connector points right */
}

.timeline-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-size: 1.5rem;
    color: var(--text-color-light);
    background-color: var(--secondary-color);
    border: 3px solid var(--light-bg-color); /* Creates a border effect */
    top: calc(var(--spacing-unit) * 1.5);
    border-radius: 50%;
    z-index: 2;
    text-align: center;
    /* Placeholder for actual icons later if needed */
    display: flex;
    align-items: center;
    justify-content: center;
}
.timeline-item:nth-child(odd) .timeline-icon {
    left: -20px; /* Position icon on the line */
}
.timeline-item:nth-child(even) .timeline-icon {
    right: -20px; /* Position icon on the line */
}

.timeline-content {
    padding: var(--spacing-unit);
    background-color: var(--light-bg-alt-color);
    position: relative;
    border-radius: var(--border-radius-base);
    box-shadow: var(--box-shadow-sm);
}
.timeline-title {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.3rem;
}

/* Portfolio Section - Slider and Modals */
.portfolio-slider, .testimonial-slider { /* Basic slider structure */
    position: relative;
}
.slider-wrapper {
    display: flex; /* This will be handled by JS library, but good for base */
    overflow-x: auto; /* Fallback if JS fails, or for mouse drag */
    gap: calc(var(--spacing-unit) * 1.5);
    padding-bottom: var(--spacing-unit); /* Space for scrollbar if visible */
    scroll-snap-type: x mandatory; /* Optional: for smoother native scrolling */
}
.slider-wrapper > .card { /* Ensure cards in slider don't shrink too much */
    min-width: 300px; /* Adjust as needed */
    flex: 0 0 auto;
    scroll-snap-align: start;
}
.portfolio-card .card-image { height: 220px; } /* Consistent image height for portfolio */

.slider-controls {
    text-align: center;
    margin-top: calc(var(--spacing-unit) * 1.5);
}
.slider-controls button {
    background-color: var(--primary-color-lighter);
    color: var(--text-color-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    margin: 0 0.5rem;
    line-height: 40px; /* Center icon vertically */
    padding:0;
}
.slider-controls button:hover {
    background-color: var(--primary-color);
}


/* Vision Section */
.parallax-section {
    background-attachment: fixed; /* Parallax effect */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}
.vision-overlay, .testimonials-overlay { /* For text readability on parallax/image bgs */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(42, 98, 143, 0.6); /* Using primary color with alpha */
    z-index: 1;
}
.vision-section .container, .testimonials-section .container {
    position: relative;
    z-index: 2;
}
.vision-section .section-title, .vision-section p,
.testimonials-section .section-title, .testimonials-section p {
    color: var(--text-color-light);
    text-shadow: var(--text-shadow-light);
}
.vision-section .section-title::after {
    background-color: var(--accent-color); /* Brighter accent for dark bg */
}
.vision-graphic {
    max-width: 250px;
    margin: var(--spacing-unit) auto 0;
}

/* Methodology Section */
.methodology-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
    margin-top: calc(var(--spacing-unit) * 2);
}
.methodology-step {
    text-align: center;
    padding: var(--spacing-unit);
}
.methodology-step-icon img {
    width: 70px;
    height: 70px;
    margin-bottom: var(--spacing-unit);
    margin-right: auto; margin-left: auto; /* Center image */
}
.methodology-step-title {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

/* Testimonials Section */
.testimonial-card {
    text-align: center;
    padding: var(--spacing-unit);
}
.testimonial-client-photo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto calc(var(--spacing-unit) * 1);
    object-fit: cover;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.testimonial-card .card-content {
    background-color: rgba(255, 255, 255, 0.1); /* Glassmorphism touch */
    backdrop-filter: blur(5px);
    border-radius: var(--border-radius-base);
    padding: var(--spacing-unit);
    color: var(--text-color-light); /* Text on the semi-transparent card content */
}
.testimonial-card blockquote p {
    font-style: italic;
    font-size: 1.05rem;
    margin-bottom: var(--spacing-unit);
    color: var(--text-color-light);
}
.testimonial-card cite {
    font-weight: 700;
    color: var(--accent-color); /* Accent for citation */
    font-size: 0.9rem;
}

/* Behind the Scenes Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-unit);
}
.gallery-item {
    border-radius: var(--border-radius-base);
    overflow: hidden;
    position: relative;
    box-shadow: var(--box-shadow-sm);
}
.gallery-item img {
    width: 100%;
    height: 250px; /* Consistent height for gallery items */
    object-fit: cover;
}
.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0,0,0,0.6);
    color: var(--text-color-light);
    padding: calc(var(--spacing-unit) * 0.5) var(--spacing-unit);
    font-size: 0.9rem;
    text-align: center;
    margin: 0;
}

/* News Section */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
}
.news-article .card-image { height: 200px; } /* Consistent image height for news */
.news-meta {
    font-size: 0.85rem;
    color: var(--text-color-muted);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}
.news-article .card-content { text-align: right; } /* Override card default if needed */
.news-article .card-title { font-size: 1.3rem; }
.news-article .read-more-link { margin-top: var(--spacing-unit); align-self: flex-start; }


/* Partners Section */
.partners-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2.5); /* 40px */
    margin-top: calc(var(--spacing-unit) * 2);
}
.partner-logo img {
    max-height: 70px; /* Adjust as needed */
    width: auto;
    filter: grayscale(100%); /* Desaturate logos, color on hover */
    opacity: 0.7;
    transition: var(--transition-base);
}
.partner-logo img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* FAQ Section */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}
.faq-item {
    background-color: var(--light-bg-alt-color);
    margin-bottom: var(--spacing-unit);
    border-radius: var(--border-radius-base);
    box-shadow: var(--box-shadow-sm);
    overflow: hidden;
}
.faq-question {
    width: 100%;
    background-color: transparent;
    border: none;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 1.5);
    text-align: right; /* For RTL */
    font-family: var(--font-family-headings);
    font-size: 1.15rem;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}
.faq-question:hover {
    background-color: var(--primary-color-lighter);
    color: var(--text-color-light);
}
.faq-toggle-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    /* Basic plus icon, can be replaced with SVG or font icon */
    position: relative;
    margin-left: var(--spacing-unit); /* Space for RTL */
}
.faq-toggle-icon::before, .faq-toggle-icon::after {
    content: '';
    position: absolute;
    background-color: currentColor; /* Inherits color from parent button */
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.faq-toggle-icon::before { /* Horizontal bar */
    width: 100%;
    height: 3px;
    top: 50%;
    transform: translateY(-50%);
}
.faq-toggle-icon::after { /* Vertical bar */
    width: 3px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}
.faq-question[aria-expanded="true"] .faq-toggle-icon::after {
    transform: translateX(-50%) rotate(90deg); /* Hide vertical bar for minus */
    opacity: 0;
}
.faq-answer {
    padding: 0 calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 1.5);
    /* display: none; by default in HTML */
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--dark-gray-color);
}

/* External Resources Section */
.resources-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: calc(var(--spacing-unit) * 1.5);
}
.resource-item.card .card-image { height: 150px; } /* Specific height for resource images */
.resource-item .card-content { text-align: right; }
.resource-title { font-size: 1.2rem; margin-bottom: 0.5rem; }
.resource-title a { color: var(--tertiary-color); }
.resource-title a:hover { color: var(--tertiary-color-darker); }
.resource-description { font-size: 0.9rem; color: var(--text-color-muted); }
.resource-image {
    margin-top: auto; /* Push image to bottom if content is short */
    border-top: 1px solid var(--medium-gray-color);
    padding-top: var(--spacing-unit);
}

/* Contact Section */
.contact-form-container {
    display: grid;
    grid-template-columns: 1fr; /* Default to single column */
    gap: calc(var(--spacing-unit) * 2.5);
    background-color: var(--light-bg-alt-color);
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-md);
}

@media (min-width: 992px) { /* Two columns on larger screens */
    .contact-form-container {
        grid-template-columns: 2fr 1fr; /* Form takes more space */
    }
    .contact-details { text-align: right; } /* Ensure details align right */
}

.form-group {
    margin-bottom: calc(var(--spacing-unit) * 1.25);
}
.form-label {
    display: block;
    margin-bottom: calc(var(--spacing-unit) * 0.4);
    font-weight: 700;
    color: var(--text-color-dark);
}
.form-input, .form-textarea {
    width: 100%;
    padding: calc(var(--spacing-unit) * 0.75);
    border: 1px solid var(--medium-gray-color);
    border-radius: var(--border-radius-base); /* Biomorphic: slightly rounded inputs */
    font-family: var(--font-family-base);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: var(--light-bg-color);
}
.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 58, 124, 165), 0.25); /* Use RGB for box-shadow */
}
.form-textarea {
    resize: vertical;
    min-height: 120px;
}
.contact-details h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-unit);
}
.contact-details p {
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}
.contact-details p img { /* Icons in contact details */
    width: 20px;
    height: 20px;
    margin-left: calc(var(--spacing-unit) * 0.5); /* For RTL */
}
.contact-details a { color: var(--text-color-dark); }
.contact-details a:hover { color: var(--primary-color); }
.contact-map img {
    border-radius: var(--border-radius-base);
    margin-top: var(--spacing-unit);
    box-shadow: var(--box-shadow-sm);
    width:100%;
    height: 200px;
    object-fit: cover;
}

/* -------------------------------------------------------------------------
   8. Footer
   ------------------------------------------------------------------------- */
.site-footer {
    background-color: var(--heading-color); /* Dark footer */
    color: var(--medium-gray-color); /* Lighter text for dark bg */
    padding-top: calc(var(--spacing-unit) * 3);
    padding-bottom: calc(var(--spacing-unit) * 1.5);
}
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 2);
}
.footer-widget .widget-title {
    font-size: 1.25rem;
    color: var(--text-color-light);
    margin-bottom: var(--spacing-unit);
    position: relative;
    padding-bottom: calc(var(--spacing-unit) * 0.5);
}
.footer-widget .widget-title::after { /* Underline for widget titles */
    content: '';
    position: absolute;
    bottom: 0;
    right: 0; /* For RTL */
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
    border-radius: var(--border-radius-pill);
}
.footer-widget p {
    color: var(--medium-gray-color);
    font-size: 0.9rem;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li {
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}
.footer-links a {
    color: var(--medium-gray-color);
    text-decoration: none;
    font-size: 0.9rem;
}
.footer-links a:hover {
    color: var(--text-color-light);
    text-decoration: underline;
}

/* Social Media Text Links in Footer */
.social-media-links-text {
    list-style: none;
    padding: 0;
    margin: 0;
}
.social-media-links-text li {
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}
.social-media-links-text a {
    color: var(--medium-gray-color);
    font-weight: 700; /* Make them slightly bolder */
    font-size: 0.95rem;
    display: inline-block; /* Allows for padding if needed */
    padding: 0.2rem 0;
}
.social-media-links-text a:hover {
    color: var(--accent-color); /* Highlight with accent color on hover */
    text-decoration: none;
}


.footer-bottom {
    border-top: 1px solid var(--dark-gray-color);
    padding-top: calc(var(--spacing-unit) * 1.5);
    text-align: center;
    font-size: 0.85rem;
}
.footer-bottom p { margin-bottom: 0.5rem; color: var(--medium-gray-color); }
.footer-bottom a { color: var(--medium-gray-color); }
.footer-bottom a:hover { color: var(--text-color-light); }
.back-to-top {
    margin-right: var(--spacing-unit); /* For RTL */
    font-weight: 700;
}

/* -------------------------------------------------------------------------
   9. Modals (Portfolio, Success)
   ------------------------------------------------------------------------- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6); /* Semi-transparent black overlay */
    backdrop-filter: blur(5px); /* Glassmorphism */
    padding-top: 50px; /* Space from top */
}
.modal-content {
    background-color: var(--light-bg-alt-color);
    margin: auto;
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 700px; /* Max width for content modal */
    box-shadow: var(--box-shadow-lg);
    position: relative;
    text-align: center; /* Center content like icons, titles */
}
.portfolio-detail-modal .modal-content {
    max-width: 800px; /* Larger for portfolio details */
    text-align: right; /* Default for Arabic text in portfolio */
}
.portfolio-detail-modal img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-base);
    margin-bottom: var(--spacing-unit);
}
.portfolio-detail-modal h2 { text-align: right; }

.close-modal-button {
    color: var(--dark-gray-color);
    position: absolute;
    top: calc(var(--spacing-unit) * 0.75);
    left: calc(var(--spacing-unit) * 1.25); /* For RTL */
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}
.close-modal-button:hover,
.close-modal-button:focus {
    color: var(--text-color-dark);
    text-decoration: none;
    cursor: pointer;
}
.success-modal .modal-content img { /* Icon in success modal */
    margin: 0 auto var(--spacing-unit);
}
.success-modal .modal-content h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-unit);
}
.modal-details-button { margin-top: var(--spacing-unit); margin-right: 0.5rem;}
.close-modal-action-button { margin-top: var(--spacing-unit); }

/* -------------------------------------------------------------------------
   10. Particle Animation Container
   ------------------------------------------------------------------------- */
#particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind all content */
    pointer-events: none; /* Make it non-interactive */
}

/* -------------------------------------------------------------------------
   11. Switch (Example for FAQ, if used)
   ------------------------------------------------------------------------- */
.switch-label {
    font-weight: 600;
    margin-left: 0.5rem; /* For RTL */
}
.switch {
    position: relative;
    display: inline-block;
    width: 50px; /* Adjust size */
    height: 26px; /* Adjust size */
    vertical-align: middle;
}
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--medium-gray-color);
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px; /* Adjust size */
    width: 20px; /* Adjust size */
    left: 3px; /* Adjust position */
    bottom: 3px; /* Adjust position */
    background-color: white;
    transition: .4s;
}
input:checked + .slider {
    background-color: var(--secondary-color);
}
input:focus + .slider {
    box-shadow: 0 0 1px var(--secondary-color);
}
input:checked + .slider:before {
    transform: translateX(24px); /* Adjust distance */
}
.slider.round {
    border-radius: var(--border-radius-pill); /* 34px or similar */
}
.slider.round:before {
    border-radius: 50%;
}

/* -------------------------------------------------------------------------
    12. Success Page Specific Styles
   ------------------------------------------------------------------------- */
.success-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: var(--container-padding);
    background-color: var(--light-bg-color); /* Or a specific success page background */
}
.success-page-container img { /* Success icon */
    width: 100px;
    height: 100px;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}
.success-page-container h1 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-unit);
}
.success-page-container p {
    font-size: 1.1rem;
    color: var(--dark-gray-color);
    max-width: 500px;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}
.success-page-container .button-primary {
    margin-top: var(--spacing-unit);
}

/* -------------------------------------------------------------------------
    13. Cookie Consent Popup (Basic styling, refine as needed)
   ------------------------------------------------------------------------- */
#cookie-consent-popup {
    /* HTML already provides: display, position, bottom, left, width, bg, color, padding, z-index, text-align */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}
#cookie-consent-popup p {
    font-size: 0.9rem;
    line-height: 1.6;
}
#cookie-consent-popup a {
    color: var(--accent-color); /* Make link stand out */
    font-weight: 700;
}
#accept-cookie-consent {
    /* HTML already provides: bg, color, padding, border, radius, cursor, font-size */
    font-weight: 700;
    transition: background-color 0.3s ease;
}
#accept-cookie-consent:hover {
    background-color: var(--accent-color-darker); /* Darken button on hover */
}


/* -------------------------------------------------------------------------
   14. Responsive Design
   ------------------------------------------------------------------------- */
@media (max-width: 991px) {
    .main-navigation {
        position: absolute;
        top: var(--header-height); /* Below header */
        right: 0; /* For RTL */
        width: 100%;
        background-color: var(--light-bg-alt-color);
        box-shadow: var(--box-shadow-md);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
    }
    .main-navigation ul {
        flex-direction: column;
        padding: var(--spacing-unit);
    }
    .main-navigation li {
        margin-right: 0;
        margin-bottom: var(--spacing-unit);
        text-align: center;
    }
    .main-navigation li:last-child {
        margin-bottom: 0;
    }
    .main-navigation a {
        display: block; /* Make links full width for easier tapping */
        padding: calc(var(--spacing-unit) * 0.75);
    }
    .menu-toggle {
        display: block; /* Show burger icon */
    }
    /* JS will add .menu-open to header/body */
    .menu-open .main-navigation {
        max-height: 500px; /* Or enough height to show all items */
    }

    .timeline::after { /* For mobile, place line to the side */
        right: 31px; /* Adjust to align with icons */
        left: auto;
    }
    .timeline-item {
        width: 100%;
        padding-left: 0; /* Reset padding for RTL single column */
        padding-right: 70px; /* Space for icon and line */
        text-align: right;
    }
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: auto;
        right: auto;
        padding-left: 0;
        padding-right: 70px; /* Consistent padding */
        text-align: right;
    }
    .timeline-icon {
        top: calc(var(--spacing-unit) * 1.5);
    }
    .timeline-item:nth-child(odd) .timeline-icon,
    .timeline-item:nth-child(even) .timeline-icon {
        right: 16px; /* Position icons on the right */
        left: auto;
    }
    .timeline-item::after { /* Connectors point from item to the line on right */
        right: 55px; /* Adjust to connect to icon */
        left: auto;
        width: 15px; /* Shorter connector */
    }
     .contact-form-container {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
    .contact-details {
        text-align: right; /* Center for mobile if preferred, or keep right */
        margin-top: calc(var(--spacing-unit) * 2);
    }
}

@media (max-width: 767px) {
    h1, .hero-title { font-size: 2.2rem; }
    h2, .section-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .hero-section { padding: calc(var(--spacing-unit) * 5) 0; }

    .slider-wrapper > .card {
        min-width: 280px; /* Slightly smaller cards on mobile */
    }
    .portfolio-card .card-image { height: 180px; }
    .news-article .card-image { height: 180px; }

    .footer-widgets {
        grid-template-columns: 1fr; /* Stack widgets on small screens */
        text-align: center;
    }
    .footer-widget .widget-title::after {
        margin-right: auto; margin-left: auto; /* Center underline */
    }
    .footer-widget img { margin: 0 auto; }
}

/* -------------------------------------------------------------------------
    15. AOS Animations (If data-aos attributes are used)
   ------------------------------------------------------------------------- */
[data-aos] {
    opacity: 0;
    transition-property: transform, opacity;
}
[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
    opacity: 1;
}
[data-aos="fade-in"].aos-animate {
    opacity: 1;
}
/* Add more AOS styles as needed based on the animations used in HTML */
*{
    opacity: 1 !important;
}