@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;900&family=Poppins:wght@400;500;700;900&display=swap');

:root {
    --primary-color: #fefffb;
    --secondary-color: #aac65d;
    --accent-color: #137980;
    --white: #ffffff;
    --light-gray: #f7f7f7;
    --dark-gray: #d5e0eb;
    --text-color: #333333;
    --border-color: #e1e5e9;
    --card-bg: #ffffff;
    --transition: all 0.3s ease;
    --main-pg: url('../images/main.png') center/cover no-repeat fixed;
}

/* Dark mode variables */
[data-theme="dark"] {
    --primary-color: #1a1a1a;
    --secondary-color: #8ba83f;
    --accent-color: #4a9ba5;
    --white: #2d2d2d;
    --main-pg: url('../images/main-dark.png') center/cover no-repeat fixed;
    --light-gray: #333333;
    --dark-gray: #555555;
    --text-color: #e0e0e0;
    --border-color: #404040;
    --card-bg: #2d2d2d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--primary-color);
    color: var(--accent-color);
    overflow-x: hidden;
}

body[dir="ltr"] {
    font-family: 'Poppins', sans-serif;
}

.header {
    padding: 0.9rem 0;  /* بدل 2rem */
    height: 120px;       /* ضبط ارتفاع ثابت مع محاذاة مركزية */
    display: flex;
    align-items: center;
    background: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 31, 63, 0.3);
    border-bottom: 2px solid var(--accent-color);
    overflow: hidden; /* 👈 إضافة مهمة */
}

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

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

.logo {
    display: flex;
    align-items: center; /* يضمن محاذاة الصورة والنص */
    gap: 0.5rem;          /* مسافة بين الشعار والنص */
}

.logo-icon {
    width: 260px;         /* أو الحجم اللي يناسبك */
    height: auto;        /* خليه يتناسب مع العرض تلقائيًا */
    border-radius: 0;    /* لو الصورة مش دائرية، شيل الاستدارة */
    object-fit: contain; /* يخلي الصورة متناسبة داخل المساحة */
    margin-left: 0px;
    transform: translateX(70px);
}


.nav-menu {
    display: flex;
    gap: 1.2rem;
    list-style: none;
    align-items: center;
    margin: 0;
    flex-wrap: nowrap;
    overflow-x: visible;
}

.nav-menu li a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    white-space: nowrap;
}

.nav-menu li a:not(.auth-button) {
    position: relative;
}

.nav-menu li a:not(.auth-button):after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--secondary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu li a:not(.auth-button):hover:after {
    width: 80%;
}

.nav-menu li a:hover {
    color: var(--secondary-color);
}

.auth-button {
    padding: 0.5rem 1.5rem !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    margin-left: 0.5rem;
}

[dir="rtl"] .auth-button {
    margin-left: 0;
    margin-right: 0.5rem;
}

.auth-button.login {
    border: 2px solid var(--accent-color);
}

.auth-button.register {
    background-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
}

.auth-button.register:hover {
    background-color: var(--accent-color) !important;
}

.language-switch {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-right: 0;
    margin-left: 0.8rem;
    white-space: nowrap;
}

[dir="rtl"] .language-switch {
    margin-left: 0;
    margin-right: 0.8rem;
}

.language-switch:hover {
    background: var(--accent-color);
    color: var(--primary-color);
}

.theme-toggle {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.2rem;
    transition: var(--transition);
    margin-left: 0.8rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

[dir="rtl"] .theme-toggle { margin-left: 0; margin-right: 0.8rem; }
.theme-toggle:hover { background: var(--accent-color); color: var(--primary-color); }

@media (max-width: 1200px) {
    .nav-menu {
        gap: 0.8rem;
    }

    .nav-menu li a {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }

    .auth-button {
        padding: 0.4rem 1rem !important;
    }

    .language-switch {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .theme-toggle {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 992px) {
    .nav-menu {
        gap: 0.5rem;
    }

    .nav-menu li a {
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem;
    }

    .auth-button {
        padding: 0.3rem 0.8rem !important;
        font-size: 0.9rem !important;
    }

    .language-switch {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    [dir="rtl"] .language-switch {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    [dir="rtl"] .theme-toggle {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
}

/*@media (max-width: 768px) {*/
/*    .header {*/
/*        flex-direction: column;*/
/*        height: auto;*/
/*        padding: 1rem;*/
/*    }*/

/*    .nav-container {*/
/*        flex-direction: column;*/
/*        gap: 1rem;*/
/*    }*/

/*    .nav-menu {*/
/*        flex-wrap: wrap;*/
/*        justify-content: center;*/
/*        gap: 0.5rem;*/
/*        width: 100%;*/
/*    }*/

/*    .nav-menu li {*/
/*        margin-bottom: 0.5rem;*/
/*    }*/

/*    .nav-menu li a {*/
/*        font-size: 0.9rem;*/
/*        padding: 0.4rem 0.8rem;*/
/*    }*/

/*    .auth-button {*/
/*        padding: 0.4rem 1rem !important;*/
/*    }*/

/*    .language-switch, .theme-toggle {*/
/*        margin: 0.5rem 0;*/
/*    }*/
/*}*/

.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: var(--main-pg);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero-content {
    max-width: 700px;
    background: #0c4347;
    padding: 2rem;
    color: #FFFFFF;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 2px solid var(--accent-color);
    text-align: inherit;
}

.hero-title {
    font-size: 5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    color: var(#137980);
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(#137980);
    margin-bottom: 2rem;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 31, 63, 0.3);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 31, 63, 0.4);
    background: var(--accent-color);
}

.features {
    padding: 6rem 0;
    background-color: var(--primary-color);
    border-top: 2px solid var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

.section-title {
    text-align: inherit;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    color: var(--accent-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}
@media (max-width: 600px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}


.feature-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    transition: var(--transition);
    text-align: inherit;
    border: 2px solid var(--accent-color);
    min-height: 300px;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 31, 63, 0.2);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--secondary-color);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.feature-description {
    color: var(--accent-color);
    line-height: 1.6;
}

.courses {
    padding: 6rem 0;
    background-color: var(--primary-color);
}

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

.course-card {
    background-color: var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid var(--accent-color);
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 31, 63, 0.2);
}

.course-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.course-image h2 {
    position: relative;
    z-index: 2;
    color: var(--white);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    padding: 70px 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.course-content {
    padding: 1.5rem;
}

.course-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.course-info {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.course-description {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.course-button {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.course-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 31, 63, 0.3);
    background: var(--accent-color);
}

/* Getting Started Section */
.getting-started {
    padding: 6rem 0;
    background-color: var(--primary-color);
    border-top: 2px solid var(--accent-color);
}

.step-area {
    margin-bottom: 5rem;
    position: relative;
}

.step-area:last-of-type {
    margin-bottom: 3rem;
}

.step-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 3rem;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.step-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(170, 198, 93, 0.1), transparent);
    transition: left 0.6s ease;
}

.step-content:hover::before {
    left: 100%;
}

.step-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 31, 63, 0.2);
    border-color: var(--secondary-color);
}

.step-image {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.step-image:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.step-image img {
    width: 100%;
    height: auto;
    min-height: 300px;
    max-height: 400px;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.step-text {
    padding: 1rem;
    color: var(--text-color);
    position: relative;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: var(--white);
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.step-text h3 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.step-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.step-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.step-features li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    background: var(--light-gray);
    border-radius: 10px;
    transition: var(--transition);
    border-left: 4px solid var(--secondary-color);
}

[dir="ltr"] .step-features li {
    border-left: none;
    border-right: 4px solid var(--secondary-color);
}

.step-features li:hover {
    background: var(--secondary-color);
    color: var(--white);
    transform: translateX(-5px);
}

[dir="ltr"] .step-features li:hover {
    transform: translateX(5px);
}

.step-features li i {
    color: var(--secondary-color);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    transition: var(--transition);
}

.step-features li:hover i {
    color: var(--white);
    transform: scale(1.2);
}

.step-features li span {
    font-weight: 600;
    font-size: 1rem;
}

.start-now-section {
    text-align: center;
    padding: 4rem 3rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border-radius: 20px;
    color: var(--white);
    margin-top: 3rem;
}

.start-now-section h3 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.start-now-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button.large {
    font-size: 1.3rem;
    padding: 1.2rem 3rem;
    background: var(--white);
    color: var(--accent-color);
}

.cta-button.large:hover {
    background: var(--primary-color);
    transform: translateY(-3px) scale(1.05);
}

.testimonials {
    padding: 6rem 0;
    background-color: var(--primary-color);
    border-top: 2px solid var(--accent-color);
}

.testimonial-card {
    background-color: var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    text-align: inherit;
    max-width: 800px;
    margin: 0 auto;
    border: 2px solid var(--accent-color);
}

.testimonial-text {
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

.testimonial-author {
    font-weight: 700;
    color: var(--accent-color);
}

.footer {
    background: var(--primary-color);
    color: var(--accent-color);
    padding: 4rem 0 2rem;
    border-top: 2px solid var(--accent-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    text-align: inherit;
}

.footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--accent-color);
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    opacity: 0.8;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1rem 0;
}

.social-link {
    width: 40px;
    height: 40px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

@media (max-width: 1200px) {
    .step-content {
        gap: 2rem;
        padding: 2rem;
    }

    .step-text h3 {
        font-size: 1.6rem;
    }

    .step-image img {
        min-height: 250px;
        max-height: 350px;
    }
}

@media (max-width: 992px) {
    .getting-started {
        padding: 4rem 0;
    }

    .step-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
    }

    .step-text h3 {
        font-size: 1.5rem;
    }

    .step-text p {
        font-size: 1rem;
    }

    .step-image img {
        min-height: 200px;
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .feature-card, .course-card {
        text-align: center;
    }

    [dir="rtl"] .feature-card,
    [dir="ltr"] .feature-card,
    [dir="rtl"] .course-card,
    [dir="ltr"] .course-card {
        text-align: center;
    }

    .footer-column {
        text-align: center !important;
    }

    .getting-started {
        padding: 3rem 0;
    }

    .step-area {
        margin-bottom: 3rem;
    }

    .step-content {
        padding: 1.5rem;
        border-radius: 15px;
    }

    .step-text h3 {
        font-size: 1.3rem;
    }

    .step-text p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .step-features li {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .step-image img {
        min-height: 180px;
        max-height: 250px;
    }

    .start-now-section {
        padding: 2rem 1.5rem;
    }

    .start-now-section h3 {
        font-size: 1.8rem;
    }

    .start-now-section p {
        font-size: 1rem;
    }

    .cta-button.large {
        font-size: 1.1rem;
        padding: 1rem 2rem;
    }

    .language-switch, .theme-toggle { margin: 0.5rem 0; }
}
.auth-button {
    padding: 0.5rem 1.5rem !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
}

.auth-button.login {
    border: 2px solid var(--accent-color);
}

.auth-button.register {
    background-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
}

.auth-button.register:hover {
    background-color: var(--accent-color) !important;
}

.language-switch {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

.language-switch:hover {
    background: var(--accent-color);
    color: var(--primary-color);
}

/* RTL and LTR specific styles */
[dir="rtl"] .nav-menu {
    padding-right: 0;
}

[dir="ltr"] .nav-menu {
    padding-left: 0;
}

[dir="rtl"] .language-switch {
    margin-right: 1rem;
}

[dir="ltr"] .language-switch {
    margin-left: 1rem;
}

/* Logo fixes */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[dir="rtl"] .logo {
    flex-direction: row;
}

[dir="ltr"] .logo {
    flex-direction: row-reverse;
}

/* Feature cards fixes */
.feature-card {
    text-align: inherit;
}

/* Course cards fixes */
.course-info {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

[dir="rtl"] .course-info {
    flex-direction: row;
}

[dir="ltr"] .course-info {
    flex-direction: row-reverse;
}

/* Footer fixes */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-grid {
    text-align: inherit;
}

[dir="rtl"] .footer-column {
    text-align: right;
}

[dir="ltr"] .footer-column {
    text-align: left;
}

/* Social links fixes */
.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1rem 0;
}

/* General text alignment fixes */
[dir="rtl"] .text-align-fix {
    text-align: right;
}

[dir="ltr"] .text-align-fix {
    text-align: left;
}

/* Hero content fixes */
.hero-content {
    text-align: inherit;
}

[dir="rtl"] .hero-content {
    text-align: right;
}

[dir="ltr"] .hero-content {
    text-align: left;
}

/* Section title fixes */
.section-title {
    text-align: inherit;
}

[dir="rtl"] .section-title {
    text-align: right;
}

[dir="ltr"] .section-title {
    text-align: left;
}

/* Testimonial fixes */
.testimonial-card {
    text-align: inherit;
}

[dir="rtl"] .testimonial-card {
    text-align: right;
}

[dir="ltr"] .testimonial-card {
    text-align: left;
}

/* Button fixes */
.auth-button {
    white-space: nowrap;
}

/* Container padding fixes */
.container {
    padding: 0 1rem;
}

/* Contact info styles */
.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.contact-info i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
}

.contact-info span {
    flex: 1;
}

[dir="rtl"] .contact-info li {
    text-align: right;
}

[dir="ltr"] .contact-info li {
    text-align: left;
}

@media (max-width: 768px) {
    .contact-info li {
        justify-content: center;
        text-align: center !important;
    }
}

/* Our Teachers Section */
.our-teachers {
    padding: 6rem 0;
    background-color: var(--primary-color);
    border-top: 2px solid var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 4rem;
    opacity: 0.8;
}

.teachers-carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
}

.teachers-container {
    width: 100%;
    max-width: 1100px;
    position: relative;
    height: 250px;
}

.teachers-page {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(40px);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.teachers-page.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.teacher-circle {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    overflow: visible;
    box-shadow: 0 10px 30px rgba(0, 31, 63, 0.2);
    border: 5px solid var(--secondary-color);
}

.teacher-circle:hover {
    transform: scale(1.25);
    box-shadow: 0 15px 40px rgba(0, 31, 63, 0.3);
    border-color: var(--accent-color);
    z-index: 10;
}

.teacher-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.teacher-info {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    padding: 0.5rem;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 20;
}

.teacher-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.carousel-arrow:hover {
    background: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.carousel-arrow-left {
    left: -80px;
}

.carousel-arrow-right {
    right: -80px;
}

.show-all-btn {
    position: absolute;
    top: 50%;
    right: -120px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    z-index: 5;
}

.show-all-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--dark-gray);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--secondary-color);
    transform: scale(1.2);
}

.dot:hover {
    background: var(--accent-color);
}

/* Responsive Design for Teachers Section */
@media (max-width: 1200px) {
    .teachers-page {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }

    .teacher-circle {
        width: 160px;
        height: 160px;
    }

    .teachers-container {
        max-width: 900px;
        height: 220px;
    }

    .carousel-arrow-left {
        left: -60px;
    }

    .carousel-arrow-right {
        right: -60px;
    }

    .show-all-btn {
        right: -90px;
    }
}

@media (max-width: 992px) {
    .teachers-page {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .teacher-circle {
        width: 140px;
        height: 140px;
    }

    .teachers-container {
        max-width: 700px;
        height: 200px;
    }

    .our-teachers {
        padding: 4rem 0;
    }
}

@media (max-width: 768px) {
    .teachers-page {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .teacher-circle {
        width: 120px;
        height: 120px;
    }

    .teacher-circle:hover {
        transform: scale(1.2);
    }

    .teachers-container {
        max-width: 450px;
        height: 170px;
    }

    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .carousel-arrow-left {
        left: -40px;
    }

    .carousel-arrow-right {
        right: -40px;
    }

    .show-all-btn {
        right: -60px;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .teacher-info {
        padding: 0.6rem 1rem;
    }

    .teacher-info h4 {
        font-size: 0.9rem;
    }

    .teacher-info span {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .teachers-page {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .teacher-circle {
        width: 100px;
        height: 100px;
    }

    .teachers-container {
        max-width: 250px;
        height: 140px;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
}

/* Teachers Loading State */
.teachers-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 250px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
}

.loading-spinner {
    text-align: center;
    color: var(--primary-color, #667eea);
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.loading-spinner p {
    font-size: 1.1rem;
    color: var(--text-secondary, #666);
    margin: 0;
}

/* Teachers Error State */
.teachers-error {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 250px;
    text-align: center;
    padding: 2rem;
}

.teachers-error i {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.teachers-error p {
    color: var(--text-secondary, #666);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.retry-btn {
    padding: 0.75rem 2rem;
    background: var(--primary-color, #667eea);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: var(--primary-dark, #5a6fd6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* No Teachers State */
.no-teachers {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 250px;
    text-align: center;
}

.no-teachers i {
    font-size: 3rem;
    color: var(--text-secondary, #999);
    margin-bottom: 1rem;
}

.no-teachers p {
    color: var(--text-secondary, #666);
    font-size: 1.1rem;
}

/* Teacher Subject Badge */
.teacher-subject {
    display: block;
    font-size: 0.85rem;
    color: var(--primary-color, #667eea);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Make teacher circles clickable */
.teacher-circle {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.teacher-circle:hover {
    transform: translateY(-5px);
}

/* Carousel arrows visibility fix */
.carousel-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-arrow-left {
    display: none;
}

/* Dark theme adjustments */
[data-theme="dark"] .loading-spinner p,
[data-theme="dark"] .teachers-error p,
[data-theme="dark"] .no-teachers p {
    color: var(--secondary-color, #aaa);
}

[data-theme="dark"] .retry-btn {
    background: var(--primary-color, #7c8ce8);
}

[data-theme="dark"] .retry-btn:hover {
    background: var(--primary-color, #667eea);
}

[data-theme="dark"] .logo-icon {
    content: url('../images/logo-dark.png');
}

/* ==========================================================================
   RESPONSIVE OVERRIDES (APPEND TO END OF FILE)
   ========================================================================== */

/* --- TABLETS & SMALL LAPTOPS (Max 992px) --- */
@media (max-width: 992px) {
    /* Stack "Getting Started" section vertically */
    .step-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .step-content::before {
        display: none; /* Remove hover effect that might glitch on touch */
    }

    /* Adjust Teachers Grid for tablets */
    .teachers-page {
        grid-template-columns: repeat(3, 1fr);
        position: relative;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    /* Hide non-active pages to prevent layout breaking */
    .teachers-page:not(.active) {
        display: none;
    }

    .teachers-container {
        height: auto; /* Remove fixed height */
        min-height: 400px;
    }
}

/* --- MOBILE DEVICES (Max 768px) --- */
@media (max-width: 768px) {

    /*!* 1. Header & Navigation Stacking *!*/
    /*.header {*/
    /*    height: auto; !* Override fixed 120px *!*/
    /*    padding: 1rem;*/
    /*    flex-direction: column;*/
    /*}*/

    /*.nav-container {*/
    /*    flex-direction: column;*/
    /*    width: 100%;*/
    /*}*/

    /*.logo {*/
    /*    margin-bottom: 1rem;*/
    /*    justify-content: center;*/
    /*    width: 100%;*/
    /*}*/

    /*.logo-icon {*/
    /*    transform: none !important; !* Reset the shift *!*/
    /*    margin: 0 !important;*/
    /*    max-width: 180px;*/
    /*}*/

    /*.nav-menu {*/
    /*    flex-direction: column;*/
    /*    width: 100%;*/
    /*    gap: 10px;*/
    /*    padding: 0;*/
    /*}*/

    /*.nav-menu li {*/
    /*    width: 100%;*/
    /*    text-align: center;*/
    /*}*/

    /*.nav-menu li a {*/
    /*    display: block;*/
    /*    padding: 12px;*/
    /*    background-color: rgba(0,0,0,0.03); !* Touch target background *!*/
    /*    border-radius: 8px;*/
    /*}*/

    /* 2. Hero Section */
    .hero {
        padding: 4rem 1rem;
        min-height: auto;
    }

    .hero-content {
        padding: 1.5rem;
        width: 100%;
        margin: 0;
    }

    .hero-title {
        font-size: 2.5rem; /* Reduce from 5rem */
    }

    /* 3. Force Single Columns for Grids */
    .features-grid,
    .courses-grid,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* 4. Teachers Carousel Mobile Fixes */
    .teachers-page {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for mobile */
        gap: 1rem;
    }

    .teacher-circle {
        width: 100px;
        height: 100px;
    }

    /* Move arrows to bottom so they don't get cut off */
    .carousel-arrow {
        position: static;
        display: inline-flex;
        transform: none;
        margin: 20px 10px 0;
    }

    .teachers-carousel {
        flex-direction: column;
    }

    .show-all-btn {
        position: static;
        transform: none;
        display: block;
        margin: 20px auto 0;
        width: fit-content;
    }

    /* 5. Footer & General */
    .footer-column {
        text-align: center !important;
    }

    [dir="rtl"] .footer-column,
    [dir="ltr"] .footer-column {
        text-align: center;
    }

    .section-title {
        font-size: 2rem;
        text-align: center !important;
    }
}

/* --- SMALL PHONES (Max 480px) --- */
@media (max-width: 480px) {
    /* 1 teacher per row */
    .teachers-page {
        grid-template-columns: 1fr;
    }

    /* Full width buttons */
    .auth-button {
        width: 100%;
        text-align: center;
        margin: 5px 0 !important;
    }

    .theme-toggle, .language-switch {
        margin: 10px auto;
        display: inline-flex;
    }

    .hero-title {
        font-size: 2rem;
    }
}

/**/


@media (max-width: 1300px) {
    /* 1. Utilize more screen edge-to-edge space */
    .container {
        width: 98%;
        padding: 0 10px;
    }

    /* 2. Fix the logo size and positioning */
    /* Removing the translateX prevents it from overlapping the menu */
    .logo-icon {
        width: 180px; /* Smaller logo */
        transform: none; /* Remove the 70px shift */
        margin-left: 0;
    }

    /* 3. Compact the navigation menu */
    .nav-menu {
        gap: 0.5rem; /* Reduce gap between items */
    }

    .nav-menu li a {
        font-size: 0.9rem; /* Slightly smaller text */
        padding: 0.4rem 0.6rem; /* Reduce hit area padding */
    }

    /* 4. Make auth buttons smaller */
    .auth-button {
        padding: 0.4rem 1rem !important;
        font-size: 0.9rem !important;
        margin-left: 0.2rem;
    }

    /* 5. Adjust Theme Toggle */
    .theme-toggle {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        margin-left: 0.4rem;
    }
}

/* Optional: Intermediate step for Tablet Portrait (approx 992px) */
@media (max-width: 992px) {
    .header {
        height: 100px; /* Reduce header height */
    }

    .logo-icon {
        width: 150px;
    }

    /* If the menu is still too wide, hide the underline effect or reduce further */
    .nav-menu li a:not(.auth-button):after {
        display: none;
    }
}
/**/

/* Fix for the danger zone (tablets/small laptops) */
@media (max-width: 900px) {

    /* 1. Reset the container to use full width */
    .container {
        width: 100%;
        padding: 0 10px;
    }

    /* 2. Shrink the logo and remove the shift causing the overlap */
    .logo-icon {
        width: 110px; /* Much smaller logo */
        transform: none !important; /* CRITICAL: Stops it from pushing right */
        margin: 0;
    }

    /* 3. Squeeze the menu items */
    .nav-menu {
        gap: 4px; /* Tiny gap between items */
    }

    /* 4. Make text smaller */
    .nav-menu li a {
        font-size: 0.8rem; /* approx 12-13px */
        padding: 5px 6px; /* Reduce hit area slightly */
    }

    /* 5. Compact the buttons specifically */
    .auth-button {
        padding: 4px 10px !important;
        font-size: 0.75rem !important; /* Smaller button text */
        margin: 0 2px !important;
    }

    /* 6. Shrink the moon icon toggle */
    .theme-toggle {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        padding: 0;
        margin-left: 2px;
    }

    /* 7. Reduce Header Height to save vertical space */
    .header {
        height: 80px;
    }
}

/* Optional: If it STILL breaks at exactly 760px, trigger mobile view earlier */
@media (max-width: 820px) {
    .header {
        height: auto;
        padding: 10px 0;
    }

    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .logo-icon {
        margin-bottom: 5px;
    }
}
/**/
@media (max-width: 1392px) {
    .hero {
        /* Overrides the variable containing the image URL */
        background: var(--primary-color) !important;
    }
}

/**/
/* Add to your CSS file */
.our-teachers.hidden {
    display: none !important;
    visibility: hidden;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Smooth transition when showing section */
.our-teachers {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.our-teachers.fade-in {
    animation: fadeInSection 0.5s ease forwards;
}

@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}