/*
 * =========================================================
 * 1. Global Styles & Variables (:root)
 * =========================================================
 */
:root {
    --color-blue: #1976D2;        /* Primary Blue */
    --color-green: #4CAF50;       /* Green for Prep/Success/Apply */
    --color-yellow: #FFC107;      /* Yellow */
    --color-orange: #FF5722;      /* Orange for Call to action */
    --color-dark-blue: #1565C0;   /* Dark Blue for Headings */
    --color-white: #FFFFFF;
    --color-grey: #616161;
    --color-light-grey: #F5F5F5;
    --color-text-dark: #333333;
    
    /* Stages/Learning Systems Colors */
    --color-general: #2196F3;     /* Light Blue (General) */
    --color-prep: #FFC107;        /* Yellow (تجريبى) - NEW/FIXED */
    --color-azhar: #009688;       /* Teal/Cyan (Azhar) */
    --color-tahfizh: #8BC34A;     /* Lime Green (Tahfizh) */
    --color-ai: #9C27B0;          /* Purple (AI/Programming) - FIXED COLOR DEFINITION */
    --color-guidance: var(--color-prep); /* Using Prep color for Languages/Experimental stage */

    /* Subject Colors (for Teachers Cards) */
    --color-subj-math: #03A9F4;      /* Light Blue */
    --color-subj-science: #8BC34A;   /* Light Green */
    --color-subj-arabic: #FF9800;    /* Deep Orange */
    --color-subj-english: #9C27B0;   /* Purple */
    --color-subj-social: #FFC107;    /* Yellow (Social Studies/Darasat) */
    --color-subj-chemistry: #3F51B5; /* Indigo */
    --color-subj-physics: #D32F2F;   /* Dark Red */
    --color-subj-biology: #4CAF50;   /* Medium Green */
    --color-subj-history: #795548;   /* Brown */
    --color-subj-geo: #00BCD4;       /* Cyan (Geography) */
    --color-subj-religion: #009688;  /* Teal */
    --color-subj-art: #E91E63;       /* Pink */
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-white);
    color: var(--color-text-dark);
    direction: rtl; 
    text-align: right;
}

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

h1, h2, h3 {
    margin-top: 0;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s, border-bottom 0.3s;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s, opacity 0.3s;
    font-size: 16px;
    white-space: nowrap; 
}


/*
 * =========================================================
 * 2. Navigation Bar (Navbar)
 * =========================================================
 */
.navbar {
    background-color: var(--color-white);
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.navbar .container {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    position: relative; 
}

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

.logo img {
    width: 60px !important; 
    height: 60px !important;
    border-radius: 50%;
}

.logo-text {
    font-size: 26px;
    font-weight: 900;
    color: var(--color-blue);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    padding: 0;
    margin: 0;
    flex-grow: 1; 
    justify-content: center;
}

.nav-links a {
    color: var(--color-grey);
    font-weight: 500;
    padding: 5px 0;
}

.nav-links a:hover {
    color: var(--color-blue); 
    border-bottom: 2px solid var(--color-blue); 
}

.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-login {
    background-color: transparent;
    border: 1px solid var(--color-blue);
    color: var(--color-blue);
    padding: 10px 20px;
}

.btn-login:hover {
    background-color: var(--color-light-grey);
}

.btn-enroll {
    background-color: var(--color-orange);
    color: var(--color-white);
}

.btn-enroll:hover {
    background-color: #e64a19; 
}

.menu-toggle {
    display: none; 
    background: none;
    border: none;
    font-size: 28px;
    color: var(--color-blue);
    cursor: pointer;
    padding: 0;
    order: 3; 
}
.menu-toggle i {
    font-size: 28px;
}

/*
 * =========================================================
 * 3. Hero Section (Landing Page)
 * =========================================================
 */
.hero-section {
    background: linear-gradient(to left, var(--color-blue), var(--color-green)); 
    padding: 60px 0 0;
    color: var(--color-white);
    overflow: hidden; 
}

.hero-section .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0;
    text-align: right;
}

.hero-content {
    flex: 1;
    max-width: 50%;
    padding-left: 20px;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 40px;
    color: #f0f0f0;
}

.btn-start-lesson {
    background-color: var(--color-orange);
    color: var(--color-white);
    padding: 18px 40px;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-start-lesson:hover {
    background-color: #e64a19;
}

.hero-image {
    flex: 1;
    text-align: left; 
    padding-top: 20px;
}

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

/*
 * =========================================================
 * 4. Stages Section (5 Columns)
 * =========================================================
 */
.stages-section, .features-section {
    padding: 80px 0;
    text-align: center;
}

.stages-section h2, .features-section h2 {
    font-size: 38px;
    margin-bottom: 50px;
    color: var(--color-dark-blue);
}

/* Set the stages-grid to CSS Grid for 5 columns */
.stages-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 20px; 
}

/* Define the base style for 5 stage cards */
.stage-card {
    padding: 30px 15px; 
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    color: var(--color-white); 
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 220px; 
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stage-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.stage-card i {
    font-size: 32px; 
    margin-bottom: 15px;
    display: block;
}

.stage-card h3 {
    font-size: 20px; 
    margin-bottom: 10px;
    font-weight: 900;
}

.stage-card p {
    font-size: 14px; 
    margin: 0;
}

/* Applying 5 unique background colors */
.stage-primary { background-color: var(--color-general); }
.stage-azhar { background-color: var(--color-azhar); }
.stage-tahfeez { background-color: var(--color-tahfizh); } /* Corrected variable name */
.stage-ai { background-color: var(--color-ai); }          /* FIXED/WORKING COLOR */
.stage-guidance { background-color: var(--color-guidance); }


/*
 * =========================================================
 * 5. Founders Section
 * =========================================================
 */
.founders-section {
    padding: 80px 0;
    background-color: var(--color-light-grey); 
    text-align: center;
}

.founders-section h2 {
    font-size: 38px;
    margin-bottom: 50px;
    color: var(--color-dark-blue);
}

.founders-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.founder-card {
    flex: 1;
    max-width: 350px;
    background-color: var(--color-white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
}

.founder-card:hover {
    transform: translateY(-8px);
}

.founder-card img {
    width: 150px; 
    height: 150px;
    object-fit: cover;
    border-radius: 50%; 
    margin-bottom: 20px;
    border: 5px solid var(--color-blue); 
}

.founder-card h3 {
    font-size: 24px;
    color: var(--color-text-dark);
    margin-bottom: 5px;
}

.founder-card span {
    display: block;
    font-size: 16px;
    color: var(--color-orange);
    font-weight: 700;
    margin-bottom: 15px;
}

.founder-card p {
    font-size: 15px;
    color: var(--color-grey);
    line-height: 1.6;
}


/*
 * =========================================================
 * 6. Features Section
 * =========================================================
 */
.features-grid {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin-bottom: 50px;
}

.feature-card {
    flex: 1;
    background-color: var(--color-light-grey);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.feature-card i {
    font-size: 40px;
    color: var(--color-blue);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 22px;
    color: var(--color-text-dark);
    font-weight: 700;
    margin-bottom: 10px;
}

/*
 * =========================================================
 * 7. Footer
 * =========================================================
 */
.footer {
    background-color: var(--color-white);
    padding: 30px 0;
    border-top: 1px solid #eee;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo img {
    width: 40px; 
    height: 40px;
}

.footer-links a {
    color: var(--color-grey);
    margin-left: 25px;
    font-size: 14px;
}

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

.social-icons a {
    color: var(--color-grey);
    font-size: 22px;
    margin-right: 15px;
}

.social-icons a:hover {
    color: var(--color-blue);
}


/*
 * =========================================================
 * 8. Teachers Page Styles (teachers_style.css)
 * =========================================================
 */
.teachers-hero-section {
    background: linear-gradient(to right, var(--color-dark-blue), var(--color-blue));
    padding: 80px 0;
    color: var(--color-white);
    text-align: center;
}

.teachers-hero-section h1 {
    font-size: 44px;
    font-weight: 900;
    margin-bottom: 10px;
}

.teachers-list-section {
    padding: 60px 0;
    background-color: var(--color-light-grey);
}

.teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    justify-content: center;
}

/* --- Filter Bar --- */
.filters-bar {
    background-color: var(--color-white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    border-right: 5px solid var(--color-orange);
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeInDown 0.6s ease-out forwards;
}

@keyframes fadeInDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end; /* [FIXED] Ensures button alignment */
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px; /* Adjusted width */
}

.filter-group label {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-dark-blue);
    margin-bottom: 8px;
}

.filter-group label i {
    margin-left: 5px;
    color: var(--color-orange);
}

.filters-form input[type="text"],
.filters-form select {
    padding: 10px 15px;
    border: 1px solid var(--color-light-grey);
    border-radius: 5px;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    color: var(--color-text-dark);
    background-color: var(--color-white);
    transition: border-color 0.3s;
}

.filters-form input[type="text"]:focus,
.filters-form select:focus {
    border-color: var(--color-blue);
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.btn-apply-filters {
    background-color: var(--color-green);
    color: var(--color-white);
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 5px;
    transition: background-color 0.3s;
    height: 44px; /* MATCHES INPUT HEIGHT */
}

.btn-apply-filters:hover {
    background-color: #388E3C;
}

/* --- Teacher Card Design --- */
.teacher-card {
    background-color: var(--color-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.teacher-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.card-image-wrapper {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.teacher-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.teacher-card:hover img {
    transform: scale(1.05);
}

/* Subject Badges & Colors */
.subject-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    color: var(--color-white);
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 700;
    border-top-left-radius: 10px;
}

/* ALL SUBJECT COLORS DEFINITIONS */
.math-color { background-color: var(--color-subj-math); }
.science-color { background-color: var(--color-subj-science); }
.arabic-color { background-color: var(--color-subj-arabic); }
.english-color { background-color: var(--color-subj-english); }
.social-color { background-color: var(--color-subj-social); }
.chemistry-color { background-color: var(--color-subj-chemistry); }
.physics-color { background-color: var(--color-subj-physics); }
.biology-color { background-color: var(--color-subj-biology); }
.history-color { background-color: var(--color-subj-history); }
.geo-color { background-color: var(--color-subj-geo); }
.religion-color { background-color: var(--color-subj-religion); }
.art-color { background-color: var(--color-subj-art); }
.ai-color { background-color: var(--color-ai); } /* FIXED: Re-added for subject */

/* Card Info */
.card-info {
    padding: 20px;
}

.card-info h3 {
    font-size: 24px;
    color: var(--color-dark-blue);
    margin-bottom: 10px;
}

.rating {
    margin-bottom: 10px;
}

.rating i {
    color: var(--color-yellow);
    font-size: 18px;
}

.rating span {
    font-size: 14px;
    color: var(--color-grey);
    margin-right: 5px;
    font-weight: 400;
}

.stage-info {
    font-size: 15px;
    color: var(--color-text-dark);
    margin-bottom: 20px;
}

.stage-info i {
    margin-left: 5px;
    color: var(--color-blue);
}

.btn-view-profile {
    display: inline-block;
    background-color: var(--color-orange);
    color: var(--color-white);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 700;
    transition: background-color 0.3s;
}

.btn-view-profile:hover {
    background-color: var(--color-dark-blue);
}


/*
 * =========================================================
 * 9. FAQ Page Styles (faq_style.css)
 * =========================================================
 */
.faq-hero-section {
    background: linear-gradient(to left, var(--color-dark-blue), var(--color-blue));
    padding: 60px 0;
    color: var(--color-white);
    text-align: center;
}

.faq-hero-section h1 {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 15px;
}

.faq-content-section {
    padding: 60px 0;
    background-color: var(--color-white);
}

.faq-accordion {
    max-width: 900px;
    margin: 0 auto;
}

.accordion-item {
    margin-bottom: 15px;
    border: 1px solid var(--color-light-grey);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background-color: var(--color-white);
    border: none;
    cursor: pointer;
    text-align: right;
    font-family: 'Cairo', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-dark);
    transition: background-color 0.3s;
}

.accordion-header:hover {
    background-color: var(--color-light-grey);
    color: var(--color-dark-blue);
}

.accordion-header[aria-expanded="true"] {
    background-color: var(--color-blue);
    color: var(--color-white);
    border-bottom: 1px solid var(--color-blue);
}
.accordion-header[aria-expanded="true"] .icon-toggle {
    color: var(--color-white);
}

.icon-toggle {
    font-size: 20px;
    color: var(--color-orange); 
    transition: transform 0.3s;
    margin-right: 15px;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    padding-left: 25px;
    padding-right: 25px;
    padding-top: 0;
    padding-bottom: 0;
    background-color: #fcfcfc;
    transition: max-height 0.4s ease-out, padding-top 0.4s ease-out, padding-bottom 0.4s ease-out;
}

.accordion-content p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-grey);
    margin-top: 0;
    margin-bottom: 15px;
}

.accordion-content ul {
    list-style: none;
    padding-right: 20px;
    margin: 10px 0;
}

.accordion-content ul li {
    position: relative;
    padding-right: 15px;
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--color-text-dark);
}

.accordion-content ul li::before {
    content: '\f00c'; 
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 0;
    top: 2px;
    color: var(--color-green); 
}


/*
 * =========================================================
 * 10. Student Profile Page Styles (profile.css)
 * =========================================================
 */
.profile-layout {
    display: flex;
    gap: 30px;
    padding-top: 30px;
    min-height: calc(100vh - 80px); 
    align-items: flex-start;
}

.profile-content {
    flex-grow: 1; 
    padding: 20px;
    background-color: var(--color-white);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.profile-content h1 {
    color: var(--color-dark-blue);
    font-size: 28px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-light-grey);
    padding-bottom: 10px;
}

.sidebar {
    width: 280px; 
    flex-shrink: 0; 
    background-color: var(--color-white);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding-bottom: 20px;
}

.student-info {
    text-align: center;
    padding: 20px 10px;
    border-bottom: 1px solid var(--color-light-grey);
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 3px solid var(--color-green);
}

.student-info h3 {
    font-size: 18px;
    color: var(--color-text-dark);
}

.progress-bar {
    width: 80%;
    margin: 10px auto 0;
    height: 8px;
    background-color: var(--color-light-grey);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    width: 75%; 
    background-color: var(--color-orange);
    border-radius: 4px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 15px 0;
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--color-grey);
    font-weight: 500;
    border-right: 4px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-nav li a i {
    font-size: 18px;
    margin-left: 10px;
    color: var(--color-blue);
    width: 20px;
    text-align: center;
}

.sidebar-nav li a.active,
.sidebar-nav li a:hover {
    color: var(--color-dark-blue);
    background-color: var(--color-light-grey);
    border-right-color: var(--color-orange);
}

.sidebar-nav li a:hover i {
    color: var(--color-orange); 
}

.sidebar-nav li a::after {
    content: '\f053'; 
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 15px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    font-size: 12px;
    color: var(--color-orange); 
}

.sidebar-nav li a:hover::after {
    opacity: 1;
    transform: translateX(0);
}


/*
 * =========================================================
 * 11. Responsive Design (Media Queries) - COMBINED
 * =========================================================
 */

@media (max-width: 992px) {
    /* Navbar Mobile Styles */
    .nav-links, .nav-actions { display: none; flex-basis: 100%; order: 4; }
    .menu-toggle { display: block; }
    .navbar .container { flex-wrap: wrap; }
    .nav-links.active {
        display: flex; flex-direction: column; width: 100%; position: absolute; top: 80px; right: 0;
        background-color: var(--color-white); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); padding: 10px 0; z-index: 1000;
    }
    .nav-links.active li { text-align: right; padding: 12px 30px; border-bottom: 1px solid var(--color-light-grey); }
    .nav-links.active li:last-child { border-bottom: none; }
    .nav-links.active a { font-weight: 700; color: var(--color-text-dark); display: block; }
    .nav-actions.mobile-hidden { display: none; }

    /* Hero Section Mobile Styles */
    .hero-section .container { flex-direction: column; text-align: center; padding-bottom: 20px; }
    .hero-content { max-width: 100%; padding-left: 0; margin-bottom: 30px; }
    .btn-start-lesson, .btn-sign-up { width: 100%; max-width: 400px; margin: 0 auto; display: block; }

    /* Stages Grid Mobile Styles */
    .stages-grid { grid-template-columns: repeat(2, 1fr); }
    
    /* Teachers Grid Mobile Styles */
    .teachers-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
    
    /* Filters Bar Mobile Styles */
    .filters-form { flex-direction: column; align-items: stretch; }
    .filter-group { min-width: 100%; }
    .btn-apply-filters { width: 100%; margin-top: 10px; }

    /* Profile Layout Mobile Styles */
    .profile-layout { flex-direction: column; padding-top: 15px; }
    .sidebar { width: 100%; order: -1; margin-bottom: 20px; }
    .sidebar-nav ul { display: flex; flex-wrap: wrap; justify-content: space-around; padding: 10px; }
    .sidebar-nav li { flex-basis: 45%; text-align: center; }
    .sidebar-nav li a { justify-content: center; border-right: none; border-bottom: 4px solid transparent; }
    .sidebar-nav li a.active, .sidebar-nav li a:hover { border-right-color: transparent; border-bottom-color: var(--color-orange); }
    .sidebar-nav li a::after { display: none; }
}


@media (max-width: 768px) {
    .hero-content h1 { font-size: 32px; }
    .stages-section, .features-section { padding: 50px 0; }
    
    /* Teachers & Founders & Stages Grid to single column */
    .teachers-grid, .founders-grid { grid-template-columns: 1fr; }
    .stages-grid, .features-grid { flex-direction: column; gap: 20px; }
    .stages-grid { display: grid; grid-template-columns: 1fr; }
    
    /* Founders Section */
    .founders-grid { flex-direction: column; align-items: center; }
    .founder-card { max-width: 90%; }

    /* Footer adjustments */
    .footer .container { flex-direction: column; gap: 15px; text-align: center; }
    .footer-links { display: flex; flex-direction: column; gap: 5px; }
}


@media (max-width: 600px) {
    .sidebar-nav li { flex-basis: 100%; }
    .sidebar-nav ul { flex-direction: column; }
}

@media (max-width: 480px) {
    .nav-actions { display: none; }
    .logo img { width: 50px !important; height: 50px !important; }
    .logo-text { font-size: 20px; }
}

/* Preloader styles */
#preloader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 99999;
    transition: opacity .5s ease;
}