/* --- Variables & Reset --- */
:root {
    --bg-color: #e9f6ff;
    --text-color: #11324d;
    --primary-color: #28d59a;
    --primary-dark: #1fba85;
    --white: #ffffff;
    --gray-light: #f4f4f4;
    --gray-dark: #666666;
    --shadow: 0 10px 30px rgba(17, 50, 77, 0.08);
    --shadow-hover: 0 15px 40px rgba(40, 213, 154, 0.2);
    --border-radius: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* --- Typography & Elements --- */
h1, h2, h3, h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

p {
    margin-bottom: 1rem;
    color: var(--gray-dark);
}

a {
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(40, 213, 154, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 213, 154, 0.4);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-large {
    padding: 14px 32px;
    font-size: 1.1rem;
}

/* --- Navbar --- */
.navbar {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(17, 50, 77, 0.06);
    border-bottom: 1px solid rgba(40, 213, 154, 0.15);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo img {
    height: 46px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.04);
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Header Action Buttons */
.btn-rate-header {
    background: rgba(255, 193, 7, 0.12);
    color: #d97706;
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-rate-header:hover {
    background: #f59e0b;
    color: #ffffff;
    border-color: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-rate-header i {
    color: #f59e0b;
    transition: color 0.25s ease;
}

.btn-rate-header:hover i {
    color: #ffffff;
}

.btn-login-header {
    background: #ffffff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-login-header:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(40, 213, 154, 0.35);
}

.btn-login-header i {
    color: var(--primary-color);
    transition: color 0.25s ease;
}

.btn-login-header:hover i {
    color: #ffffff;
}

/* Responsive Navbar Button Labels */
.btn-text-full {
    display: inline;
}

.btn-text-short {
    display: none;
}

/* Teacher Actions in Info Section */
.btn-teacher-action {
    min-width: 210px;
    padding: 14px 24px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

/* --- Hero Section --- */
.hero {
    padding: 150px 0 100px;
    position: relative;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 60%, #e6f4f1 100%);
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-text {
    flex: 1.1;
}

.hero-text h1 {
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 22px;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.hero-text p {
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 35px;
    color: #475569;
    max-width: 580px;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-cta-hero {
    background: var(--primary-color);
    color: #ffffff;
    padding: 14px 38px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(40, 213, 154, 0.35);
    transition: all 0.3s ease;
}

.btn-cta-hero:hover {
    background: #20bd88;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(40, 213, 154, 0.45);
}

.hero-image {
    flex: 0.9;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-width: 420px;
    height: auto;
    filter: drop-shadow(0 20px 35px rgba(40, 213, 154, 0.25));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-16px); }
    100% { transform: translateY(0px); }
}

.wave-shape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-shape svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.wave-shape .shape-fill {
    fill: #ffffff;
}

/* --- Section Headers --- */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* --- Teachers Section --- */
.teachers {
    background-color: #ffffff;
    padding: 80px 0;
}

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

.teacher-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(17, 50, 77, 0.05);
}

.teacher-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.teacher-image img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-color);
    margin-bottom: 15px;
}

.teacher-info .subject {
    display: inline-block;
    padding: 5px 15px;
    background-color: rgba(40, 213, 154, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.teacher-info .bio {
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.price-tag {
    background-color: var(--bg-color);
    padding: 10px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.price-tag .label {
    font-size: 0.9rem;
    font-weight: 600;
}

.price-tag .amount {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 800;
}

/* --- Bundles Section --- */
.bundles {
    padding: 80px 0;
    background-color: var(--bg-color);
}

.bundles-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    align-items: stretch;
}

.bundle-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(17, 50, 77, 0.05);
    flex: 1 1 320px;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bundle-card:hover {
    transform: translateY(-10px);
}

.bundle-card.highlight {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
    z-index: 1;
}

.bundle-card.highlight:hover {
    transform: scale(1.05) translateY(-10px);
}

.badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(40, 213, 154, 0.3);
}

.bundle-header h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.bundle-features {
    margin: 30px 0;
    text-align: right;
}

.bundle-features ul {
    list-style: none;
}

.bundle-features li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bundle-features li i {
    color: var(--primary-color);
}

.bundle-btn {
    width: 100%;
}

/* --- Registration Section --- */
.register-section {
    padding: 80px 0;
    background-color: #ffffff;
}

.form-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(17, 50, 77, 0.05);
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-color);
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background-color: var(--gray-light);
}

input[type="email"],
input[type="password"] {
    direction: ltr;
    text-align: right;
}

input[type="email"]:focus,
input[type="email"]:not(:placeholder-shown),
input[type="password"]:focus,
input[type="password"]:not(:placeholder-shown) {
    text-align: left;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(40, 213, 154, 0.1);
}

/* Custom Checkbox */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-right: 35px;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    right: 0;
    height: 24px;
    width: 24px;
    background-color: var(--gray-light);
    border-radius: 6px;
    border: 2px solid var(--gray-light);
    transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #e0e0e0;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.btn-submit {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    margin-top: 20px;
}

/* --- Footer --- */
footer {
    background-color: var(--text-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo img {
    height: 60px;
    margin-bottom: 15px;
    background-color: var(--bg-color);
    padding: 5px;
    border-radius: 10px;
}

.footer-logo p {
    color: #a0b2c1;
}

.footer-links a {
    display: block;
    color: #a0b2c1;
    margin-bottom: 10px;
}

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

.footer-contact p {
    color: #a0b2c1;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0b2c1;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: rgba(17, 50, 77, 0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px 10px;
    box-sizing: border-box;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: var(--white);
    padding: 30px 25px;
    border-radius: var(--border-radius);
    width: 92%;
    max-width: 520px;
    text-align: right;
    direction: rtl;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    margin: auto;
}

.modal.show .modal-content {
    transform: translateY(0);
}

#successModal .modal-content {
    text-align: center;
}

.success-icon {
    font-size: 60px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.notice-box {
    background-color: #fff4e5;
    border-right: 4px solid #ffa000;
    padding: 20px;
    text-align: right;
    border-radius: 8px;
    margin: 25px 0;
}

.notice-box h3 {
    color: #d32f2f;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.notice-box p {
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.notice-box p:last-child {
    margin-bottom: 0;
}

.follow-up {
    font-weight: 700;
    color: var(--text-color);
}

.modal-footer {
    margin-top: 30px;
}

#closeModal {
    width: 100%;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero {
        padding: 120px 0 60px;
    }
}

@media (max-width: 768px) {
    .nav-content {
        padding: 10px 14px;
    }

    .logo-text {
        display: none !important;
    }

    .logo img {
        height: 38px;
    }

    .nav-actions {
        gap: 6px;
    }

    .btn-rate-header {
        padding: 6px 12px;
        font-size: 0.82rem;
        border-radius: 20px;
    }

    .btn-login-header {
        padding: 6px 14px;
        font-size: 0.82rem;
        border-radius: 20px;
    }

    /* Teacher Actions in Info Section */
    .teachers-actions-container {
        gap: 12px !important;
    }

    .btn-teacher-action {
        min-width: unset !important;
        width: 100% !important;
        max-width: 280px !important;
        padding: 12px 20px !important;
        font-size: 1rem !important;
        justify-content: center !important;
    }

    /* Hero Section Mobile Order: Logo Top -> Text -> CTA Button Bottom */
    .hero {
        padding: 100px 0 60px;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 22px;
        padding: 0 15px;
    }

    .hero-image {
        order: 1;
        width: 100%;
        margin-bottom: 5px;
    }

    .hero-image img {
        max-width: 230px;
        animation: float 6s ease-in-out infinite;
    }

    .hero-text {
        order: 2;
        width: 100%;
    }

    .hero-text h1 {
        font-size: 1.9rem;
        line-height: 1.35;
        margin-bottom: 12px;
    }

    .hero-text p {
        font-size: 1.02rem;
        line-height: 1.65;
        margin-bottom: 22px;
        padding: 0 10px;
    }

    .hero-buttons {
        justify-content: center;
        width: 100%;
    }

    .btn-cta-hero {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 13px 28px;
        font-size: 1.05rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .bundle-card.highlight {
        transform: scale(1);
    }
    
    .bundle-card.highlight:hover {
        transform: translateY(-10px);
    }
}

@media (max-width: 600px) {
    /* Responsive Short Button Labels on Mobile */
    .btn-text-full {
        display: none !important;
    }

    .btn-text-short {
        display: inline !important;
    }

    .nav-content {
        padding: 8px 12px;
    }

    .logo img {
        height: 36px;
    }

    .nav-actions {
        gap: 6px;
    }

    .btn-rate-header {
        padding: 6px 10px;
        font-size: 0.8rem;
        gap: 4px;
        border-radius: 18px;
    }

    .btn-login-header {
        padding: 6px 12px;
        font-size: 0.8rem;
        gap: 4px;
        border-radius: 18px;
    }
}

@media (max-width: 390px) {
    .nav-content {
        padding: 7px 10px;
    }

    .logo img {
        height: 34px;
    }

    .nav-actions {
        gap: 5px;
    }

    .btn-rate-header {
        padding: 5px 8px;
        font-size: 0.76rem;
        gap: 4px;
        border-radius: 16px;
    }

    .btn-login-header {
        padding: 5px 9px;
        font-size: 0.76rem;
        gap: 4px;
        border-radius: 16px;
    }
}

@media (max-width: 340px) {
    .nav-content {
        padding: 5px 6px;
    }

    .logo img {
        height: 30px;
    }

    .nav-actions {
        gap: 4px;
    }

    .btn-rate-header {
        padding: 4px 6px;
        font-size: 0.72rem;
        gap: 3px;
        border-radius: 14px;
    }

    .btn-login-header {
        padding: 4px 7px;
        font-size: 0.72rem;
        gap: 3px;
        border-radius: 14px;
    }
}

/* --- Teacher Directory Modal --- */
.modal-content-large {
    max-width: 800px;
    text-align: right;
    direction: rtl;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    padding: 30px;
    box-sizing: border-box;
}

.modal-header-dir {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.close-modal-dir {
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: var(--gray-dark);
    transition: color 0.2s;
    line-height: 1;
}

.close-modal-dir:hover {
    color: var(--primary-color);
}

.teachers-dir-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 55vh;
    padding-left: 10px;
    padding-right: 5px;
}

.teacher-dir-card {
    background: #fafbfc;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    text-align: right;
}

.teacher-dir-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    border-color: rgba(40, 213, 154, 0.4);
}

.teacher-dir-name {
    margin: 0 0 8px 0;
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 700;
}

.teacher-dir-spec {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.teacher-dir-bio {
    margin: 0;
    font-size: 0.9rem;
    color: #4e5d6c;
    line-height: 1.6;
    text-align: justify;
    white-space: pre-line;
}

/* --- Teacher Bio Button in Registration Form --- */
.btn-view-teacher-bio {
    background: #f0fdf4;
    color: var(--primary-dark);
    border: 1px solid #86efac;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
}

.btn-view-teacher-bio:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(40, 213, 154, 0.25);
}

.btn-view-teacher-bio:active {
    transform: translateY(0);
}

@media (max-width: 600px) {
    .btn-view-teacher-bio {
        padding: 4px 8px;
        font-size: 0.78rem;
    }
}

.teacher-spec-pill {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: var(--primary-dark);
    border: 1px solid #86efac;
    font-size: 0.84rem;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

