/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: #333;
    line-height: 1.6;
    background-color: #f8f9fa; /* Light background */
}

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

a {
    text-decoration: none;
    color: #006400; /* Dark Green */
}

a:hover {
    color: #DAA520; /* Gold */
}

h1, h2, h3 {
    font-weight: 700;
    margin-bottom: 1rem;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block; /* Prevent extra space below */
}

/* Color Palette */
:root {
    --primary-color: #006400; /* Dark Green */
    --secondary-color: #DAA520; /* Gold */
    --accent-color: #ffffff; /* White */
    --text-color: #333333;
    --light-bg: #f8f9fa;
    --dark-bg: #e9ecef;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s ease;
    cursor: pointer;
    border: none;
    font-weight: bold;
}

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

.btn-primary:hover {
    background-color: #004d00; /* Darker Green */
    color: var(--accent-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--accent-color);
}

.btn-secondary:hover {
    background-color: #b8860b; /* Darker Gold */
    color: var(--accent-color);
}

.btn-tertiary {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-tertiary:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

/* Header & Navigation */
header {
    background-color: var(--accent-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* Needed for absolute positioning of mobile menu */
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    /* Add Islamic calligraphy font if available or image logo */
}

.navbar-toggler {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001; /* Ensure toggler is above menu */
}

.navbar-toggler span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Add styles for toggler active state (e.g., cross icon) */
.navbar-toggler.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.navbar-toggler.active span:nth-child(2) {
    opacity: 0;
}
.navbar-toggler.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.navbar-menu {
    display: flex;
    align-items: center;
}

.navbar-nav {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar-nav li {
    margin-left: 1.5rem;
}

.nav-link {
    color: var(--text-color);
    font-weight: bold;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link.active,
.nav-link:hover {
    color: var(--secondary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    margin-top: 5px;
    right: 0;
    background: var(--secondary-color);
    transition: width 0.3s ease;
    -webkit-transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
    left: 0;
    background-color: var(--secondary-color);
}

.nav-link.active::after {
    width: 100%;
    left: 0;
    background-color: var(--secondary-color);
}

.language-switcher {
    margin-left: 2rem;
}

.language-switcher button {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 5px 10px;
    margin-left: 5px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.3s, color 0.3s;
}

.language-switcher button:hover,
.language-switcher button.active {
    background-color: var(--primary-color);
    color: var(--accent-color);
}

/* Hero Section */
.hero-section {
    /* Use the downloaded image */
    background: url('../images/teacher-students-learning.jpeg') no-repeat center center/cover;
    color: var(--accent-color);
    text-align: center;
    padding: 80px 0; /* Adjusted padding */
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 100, 0, 0.65); /* Slightly darker Green overlay */
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: 2.5rem; /* Adjusted font size */
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.1rem; /* Adjusted font size */
    margin-bottom: 2rem;
}

/* General Section Padding */
.intro-section,
.testimonials-section,
.cta-section,
.courses-section,
.about-content-section,
.contact-section,
.student-section {
    padding: 40px 0; /* Reduced padding for mobile first */
}

/* Page Title Section */
.page-title-section {
    padding: 30px 0; /* Reduced padding */
}

.page-title-section h1 {
    font-size: 2rem;
}

/* Intro Section */
.intro-section h2 {
    color: var(--primary-color);
}

/* Testimonials Section */
.testimonials-section h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.testimonial-item {
    background-color: var(--accent-color);
    padding: 20px;
    margin: 1rem auto;
    border-radius: 8px;
    max-width: 600px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 5px solid var(--secondary-color);
}

.testimonial-item p {
    font-style: italic;
    margin-bottom: 10px;
}

.testimonial-item footer {
    font-weight: bold;
    color: var(--primary-color);
}

/* CTA Section */
.cta-section h2 {
    margin-bottom: 2rem;
}

/* Courses Page Specific */
.course-category {
    display: grid;
    grid-template-columns: 1fr; /* Default to 1 column */
    gap: 20px; /* Reduced gap */
    margin-bottom: 30px;
}

.course-card {
    background-color: var(--accent-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 5px solid var(--primary-color);
}

.course-category:nth-of-type(2) .course-card { /* Style Arabic courses differently */
    border-left-color: var(--secondary-color);
}

.course-card h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.course-category:nth-of-type(2) .course-card h3 {
    color: var(--secondary-color);
}

/* About Page Specific */
.mission-vision {
    display: flex;
    flex-direction: column; /* Stack on mobile */
    gap: 20px;
    margin-bottom: 30px;
}

.mission,
.vision {
    flex: 1;
    background-color: var(--accent-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.mission {
    border-top: 5px solid var(--primary-color);
}

.vision {
    border-top: 5px solid var(--secondary-color);
}

.methodology {
    margin-bottom: 30px;
    background-color: var(--accent-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.methodology ul {
    list-style: disc;
    margin-left: 20px; /* Keep indentation */
    padding-left: 0;
}

.teacher-profiles {
    display: grid;
    grid-template-columns: 1fr; /* Default to 1 column */
    gap: 20px;
}

.teacher-card {
    background-color: var(--accent-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.teacher-card img {
    width: 120px; /* Smaller image */
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--secondary-color);
}

/* Contact Page Specific */
.contact-section .container {
    display: flex;
    flex-direction: column; /* Stack on mobile */
    gap: 30px;
}

.contact-form-container,
.contact-info-map-container {
    flex: 1; /* Take full width when stacked */
}

#contact-form {
    background-color: var(--accent-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.contact-details {
    background-color: var(--accent-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.map-placeholder {
    background-color: #e9ecef;
    height: 200px; /* Reduced height */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6c757d;
    padding: 15px;
}

/* Student Section Specific */
.login-prompt {
    background-color: var(--accent-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    margin-bottom: 30px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stack cards */
    gap: 20px;
    margin-bottom: 40px; /* Add margin below grid */
}

.dashboard-card {
    background-color: var(--accent-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.dashboard-card ul {
    list-style: none;
    padding: 0;
}

.dashboard-card li {
    margin-bottom: 10px;
}

.dashboard-card:nth-child(1) { border-left: 5px solid var(--primary-color); }
.dashboard-card:nth-child(2) { border-left: 5px solid var(--secondary-color); }

/* Gallery Styles */
.gallery-section {
    margin-bottom: 40px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Responsive grid */
    gap: 15px;
}

.gallery-item {
    background-color: var(--accent-color);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden; /* Ensure content fits */
}

.gallery-item img {
    width: 100%;
    height: 120px; /* Fixed height for consistency */
    object-fit: cover;
    border-radius: 4px;
}

.video-item video {
    border-radius: 4px;
    margin-bottom: 5px;
}

.video-item p {
    font-size: 0.9rem;
    text-align: center;
    margin: 5px 0 0 0;
}

/* Footer */
footer {
    background-color: #333;
    color: #ccc;
    padding: 30px 0 15px; /* Adjusted padding */
}

.footer-content {
    display: flex;
    flex-direction: column; /* Stack sections */
    align-items: center; /* Center align content */
    text-align: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-section {
    flex: 1;
    width: 100%; /* Take full width */
    max-width: 350px; /* Limit width for readability */
    margin-bottom: 10px;
}

.footer-section h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--secondary-color);
    padding-bottom: 5px;
    display: inline-block;
}

.footer-section p,
.footer-section ul,
.footer-section a {
    color: #ccc;
    font-size: 0.9rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.social-links a {
    color: #ccc;
    margin: 0 8px; /* Adjusted margin */
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color);
}

.newsletter-form input[type="email"] {
    padding: 10px;
    border: none;
    border-radius: 3px;
    margin-bottom: 10px; /* Stack button below */
    width: 80%; /* Adjust width */
    max-width: 300px;
}

.newsletter-form button {
    padding: 10px 15px;
    width: auto;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #555;
    padding-top: 15px;
    font-size: 0.8rem;
}

/* Arabic Styles */
html[lang="ar"] {
    direction: rtl;
}

html[lang="ar"] body {
    font-family: 'Cairo', 'Amiri', sans-serif;
}

html[lang="ar"] .navbar-nav li {
    margin-left: 0;
    margin-right: 1.5rem;
}

html[lang="ar"] .language-switcher {
    margin-left: 0;
    margin-right: 2rem;
}

html[lang="ar"] .language-switcher button {
    margin-left: 0;
    margin-right: 5px;
}

html[lang="ar"] .testimonial-item,
html[lang="ar"] .course-card,
html[lang="ar"] .dashboard-card:nth-child(1),
html[lang="ar"] .dashboard-card:nth-child(2) {
    border-left: none;
    border-right: 5px solid var(--secondary-color); /* Default to gold, override below */
}

html[lang="ar"] .course-card,
html[lang="ar"] .dashboard-card:nth-child(1) {
    border-right-color: var(--primary-color);
}

html[lang="ar"] .newsletter-form input[type="email"] {
    margin-right: 0;
    margin-left: 0; /* Reset from LTR */
}

html[lang="ar"] .methodology ul {
    margin-left: 0;
    margin-right: 20px;
}

/* --- Responsive Design --- */

/* Small devices (phones, 576px and up) */
@media (min-width: 576px) {
    .hero-section h1 { font-size: 2.8rem; }
    .hero-section p { font-size: 1.2rem; }
    .newsletter-form input[type="email"] { width: 70%; }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Larger items on small+ screens */
    }
    .gallery-item img {
        height: 150px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    /* Sections */
    .intro-section,
    .testimonials-section,
    .cta-section,
    .courses-section,
    .about-content-section,
    .contact-section,
    .student-section {
        padding: 60px 0;
    }
    .page-title-section { padding: 40px 0; }
    .page-title-section h1 { font-size: 2.5rem; }

    /* Navigation */
    .navbar-toggler {
        display: none; /* Hide toggler on medium and up */
    }
    .navbar-menu {
        display: flex !important; /* Ensure menu is visible */
        flex-direction: row;
        position: static;
        width: auto;
        background-color: transparent;
        box-shadow: none;
        padding: 0;
    }
    .navbar-nav {
        flex-direction: row;
        width: auto;
        text-align: left;
    }
    .navbar-nav li {
        margin: 0;
        margin-left: 1.5rem;
    }
    html[lang="ar"] .navbar-nav li {
        margin-left: 0;
        margin-right: 1.5rem;
    }
    .language-switcher {
        margin: 0 0 0 2rem;
        text-align: left;
    }
    html[lang="ar"] .language-switcher {
        margin: 0 2rem 0 0;
    }

    /* Layouts */
    .course-category {
        grid-template-columns: repeat(2, 1fr); /* 2 columns */
        gap: 30px;
    }
    .mission-vision {
        flex-direction: row; /* Side-by-side */
        gap: 30px;
    }
    .teacher-profiles {
        grid-template-columns: repeat(2, 1fr); /* 2 columns */
        gap: 30px;
    }
    .contact-section .container {
        flex-direction: row; /* Side-by-side */
        gap: 40px;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns */
        gap: 30px;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
    }
    .gallery-item img {
        height: 160px;
    }

    /* Footer */
    .footer-content {
        flex-direction: row; /* Side-by-side */
        align-items: flex-start; /* Align top */
        text-align: left;
        gap: 30px;
    }
    .footer-section {
        width: auto; /* Allow flex to size */
        max-width: none;
        margin-bottom: 0;
    }
    .newsletter-form input[type="email"] {
        margin-bottom: 0; /* Button beside */
        margin-right: 5px;
        width: calc(100% - 120px); /* Adjust based on button size */
        max-width: none;
    }
    html[lang="ar"] .newsletter-form input[type="email"] {
        margin-right: 0;
        margin-left: 5px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .hero-section { padding: 100px 0; }
    .hero-section h1 { font-size: 3rem; }
    .hero-section p { font-size: 1.3rem; }

    .course-category {
        grid-template-columns: repeat(3, 1fr); /* 3 columns */
    }
    .teacher-profiles {
        grid-template-columns: repeat(3, 1fr); /* 3 columns */
    }
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns */
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .gallery-item img {
        height: 180px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        /* Max width already set */
    }
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .gallery-item img {
        height: 200px;
    }
}




/* Hero Carousel Styles */
.hero-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Adjust height as needed, or make it aspect-ratio based */
    min-height: 400px; /* Minimum height */
    background-color: var(--dark-bg); /* Fallback background */
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    height: 100%;
    display: flex; /* Use flex to center content if needed */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1; /* Ensure active slide is on top */
}

.carousel-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the slide area */
    z-index: -1; /* Behind the caption */
}

.carousel-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 100, 0, 0.65); /* Green overlay */
    z-index: 0; /* Above image, below caption */
}

.carousel-caption {
    position: relative;
    z-index: 1;
    color: var(--accent-color);
    text-align: center;
    padding: 20px;
    max-width: 80%;
}

.carousel-caption h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.carousel-caption p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Carousel Controls (Prev/Next Buttons) */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.carousel-control:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.carousel-control.prev {
    left: 15px;
}

.carousel-control.next {
    right: 15px;
}

/* Carousel Indicators (Dots) */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}

.indicator {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s ease;
}

.indicator.active,
.indicator:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Responsive adjustments for carousel */
@media (min-width: 768px) {
    .hero-carousel {
        min-height: 500px; /* Taller on larger screens */
    }
    .carousel-caption h1 {
        font-size: 3rem;
    }
    .carousel-caption p {
        font-size: 1.3rem;
    }
}

@media (min-width: 992px) {
    .hero-carousel {
        min-height: 600px;
    }
}

