/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&family=Cairo:wght@400;700&display=swap');

/* --- Root Variables --- */
:root {
    --primary-blue: #0a4d68;
    --secondary-orange: #f57c00;
    --light-blue: #e0f7fa;
    --very-light-blue: #f0faff;
    --dark-color: #082032;
    --background-color: #fdfdfd;
    --card-background: #fff;
    --border-color: #e0e0e0;
    --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-arabic: 'Cairo', sans-serif;
}

/* --- General Body and HTML Styles --- */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--dark-color);
    line-height: 1.6;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* --- Header Styles --- */
.main-header {
    background-color: var(--card-background);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.header-logo-wrapper {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    min-width: fit-content;
}

.logo-image {
    height: 50px;
    width: auto;
}

.logo-text-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

/* تعديل الشعار - نفس اللون والحجم، Academy مش سميكة */
.logo-english {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-blue);
    white-space: normal;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: left;
}

.logo-english .first-line {
    font-size: 22px; /* زيادة من 20px إلى 22px */
    font-weight: 700; /* سميك */
    color: var(--primary-blue); /* نفس اللون */
    display: block;
}

.logo-english .second-line {
    font-size: 22px; /* نفس حجم الأول - زيادة من 18px إلى 22px */
    font-weight: 400; /* مش سميك - تغيير من 500 إلى 400 */
    color: var(--primary-blue); /* نفس اللون - تغيير من البرتقالي للأزرق */
    display: block;
    margin-top: 2px;
}

.header-right-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
    justify-content: space-between;
    min-width: 0;
}

.main-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    overflow: visible;
    min-width: 0;
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
    justify-content: center;
    align-items: center;
    overflow: visible;
    min-width: 0;
}

.main-nav li {
    flex-shrink: 0;
    position: relative;
}

/* إضافة الفاصل الرأسي بعد كل عنصر ماعدا الأخير */
.main-nav li:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 16px;
    width: 1px;
    background-color: rgba(10, 77, 104, 0.2);
    transition: background-color 0.3s;
}

.main-nav li:hover:not(:last-child)::after {
    background-color: var(--secondary-orange);
    opacity: 0.5;
}

.main-nav a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 5px;
    transition: color .3s, background-color .3s;
    font-size: 15px;
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
    letter-spacing: 0.2px;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--secondary-orange);
    background-color: rgba(245, 124, 0, 0.05);
}

.btn-register-header {
    padding: 8px 20px;
    font-size: 15px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    font-weight: 600;
}

/* --- Mobile Navigation --- */
.mobile-nav-toggle {
    display: none;
    background: 0 0;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-blue);
    margin: 5px 0;
    transition: all .3s ease-in-out;
}

/* --- Hero Section --- */
.hero-section {
    padding: 80px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
    background-color: var(--primary-blue);
    width: 100%;
    box-sizing: border-box;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url(images/about-hero-bg.jpg);
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(10, 77, 104, .7);
    z-index: -1;
}

.hero-section h1 {
    font-size: 48px;
    margin-top: 0;
    margin-bottom: 15px;
    color: #fff;
}

.hero-section p {
    font-size: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, .9);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* --- General Section and Component Styles --- */
.section {
    padding: 80px 20px;
    width: 100%;
    box-sizing: border-box;
}

.section-title {
    text-align: center;
    font-size: 36px;
    color: var(--primary-blue);
    margin-bottom: 50px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: transform .2s, box-shadow .2s, background-color .3s, color .3s;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--secondary-orange);
    color: #fff;
}

.btn-primary:hover {
    background-color: #e07b00;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(245, 124, 0, .3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, .9);
    color: var(--primary-blue);
    border-color: transparent;
}

.btn-secondary:hover {
    background-color: #fff;
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 255, 255, .2);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .07);
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform .3s, box-shadow .3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .1);
}

.card-icon {
    font-size: 52px;
    margin-bottom: 15px;
    color: var(--secondary-orange);
}

.card h3 {
    font-size: 22px;
    color: var(--primary-blue);
    margin-top: 0;
    margin-bottom: 10px;
}

.card p {
    color: #555;
    line-height: 1.7;
}

/* --- Form Styles --- */
.form-section {
    background-color: var(--light-blue);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 0;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(10, 77, 104, .2);
}

/* --- تحسينات للشاشات المتوسطة --- */
@media (min-width: 993px) and (max-width: 1200px) {
    .main-header {
        padding: 10px 25px;
        gap: 15px;
    }
    
    .main-nav a {
        font-size: 14px;
        padding: 7px 14px;
        font-weight: 600;
    }
    
    .btn-register-header {
        padding: 8px 16px;
        font-size: 14px;
        font-weight: 600;
    }
    
    .logo-english .first-line {
        font-size: 20px; /* تقليل من 22px إلى 20px */
    }
    
    .logo-english .second-line {
        font-size: 20px; /* نفس الحجم - تقليل من 22px إلى 20px */
        font-weight: 400; /* مش سميك */
    }
    
    .logo-image {
        height: 45px;
    }
    
    .main-nav li:not(:last-child)::after {
        height: 14px;
    }
}

/* --- تحسينات للشاشات الكبيرة جداً --- */
@media (min-width: 1201px) and (max-width: 1400px) {
    .main-nav a {
        font-size: 15px;
        padding: 8px 15px;
        font-weight: 600;
    }
    
    .main-nav li:not(:last-child)::after {
        height: 15px;
    }
    
    .logo-english .first-line {
        font-size: 21px; /* تقليل طفيف من 22px إلى 21px */
    }
    
    .logo-english .second-line {
        font-size: 21px; /* نفس الحجم - تقليل طفيف من 22px إلى 21px */
        font-weight: 400; /* مش سميك */
    }
}

/* --- Responsive Styles --- */
@media (max-width: 992px) {
    html, body {
        width: 100vw;
        overflow-x: hidden;
        position: relative;
        left: 0;
        right: 0;
    }
    
    body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .main-header {
        padding: 10px 15px;
        gap: 10px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        left: 0;
        right: 0;
    }

    .header-right-content {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: #fff;
        box-shadow: -5px 0 15px rgba(0, 0, 0, .1);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 30px;
        transition: right .4s ease-in-out;
        gap: 30px;
        max-width: 280px;
        justify-content: flex-start;
        box-sizing: border-box;
    }

    .header-right-content.active {
        right: 0;
    }

    .main-nav {
        flex-grow: 0;
        width: 100%;
        justify-content: flex-start;
        box-sizing: border-box;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        white-space: normal;
        align-items: flex-start;
        padding: 0;
        margin: 0;
    }

    .main-nav li {
        width: 100%;
        position: relative;
    }
    
    .main-nav li:not(:last-child)::after {
        display: none;
    }
    
    .main-nav li:not(:last-child)::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 1px;
        background-color: rgba(0, 0, 0, 0.05);
    }

    .main-nav a {
        display: block;
        padding: 12px 0;
        font-size: 16px;
        white-space: normal;
        width: 100%;
        font-size: 15px;
        box-sizing: border-box;
        font-weight: 500;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .main-nav a:hover {
        background-color: rgba(245, 124, 0, 0.08);
    }

    .btn-register-header {
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 15px;
        white-space: normal;
        margin-left: 0;
        box-sizing: border-box;
        font-weight: 600;
    }

    .mobile-nav-toggle {
        display: block;
        order: 3;
        margin-left: 10px;
        flex-shrink: 0;
    }

    .mobile-nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .header-logo-wrapper {
        flex-grow: 1;
        min-width: auto;
        max-width: calc(100% - 60px);
    }
    
    /* تعديلات الشعار على الموبايل */
    .logo-english {
        line-height: 1;
    }
    
    .logo-english .first-line {
        font-size: 18px; /* زيادة من 16px إلى 18px */
        font-weight: 700; /* سميك */
    }
    
    .logo-english .second-line {
        font-size: 18px; /* نفس الحجم - زيادة من 14px إلى 18px */
        font-weight: 400; /* مش سميك */
        margin-top: 1px;
        color: var(--primary-blue); /* نفس اللون */
    }
    
    .logo-image {
        height: 40px;
    }
    
    .section {
        padding: 60px 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .hero-section {
        padding: 60px 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .container {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* --- تحسينات للشاشات الكبيرة --- */
@media (min-width: 993px) {
    .main-header {
        flex-wrap: nowrap;
    }
    
    .header-logo-wrapper {
        max-width: 250px;
    }
    
    .header-right-content {
        flex-wrap: nowrap;
        overflow: hidden;
    }
    
    .main-nav ul {
        flex-shrink: 1;
    }
    
    .main-nav li {
        padding: 0 2px;
    }
}

/* --- تحسينات للشاشات الصغيرة جداً --- */
@media (max-width: 480px) {
    .main-header {
        padding: 8px 12px;
        width: 100vw;
        max-width: 100vw;
        left: 0;
        right: 0;
    }
    
    .logo-image {
        height: 40px;
    }
    
    .logo-english .first-line {
        font-size: 16px; /* زيادة من 14px إلى 16px */
        font-weight: 700; /* سميك */
        line-height: 1;
    }
    
    .logo-english .second-line {
        font-size: 16px; /* نفس الحجم - زيادة من 12px إلى 16px */
        font-weight: 400; /* مش سميك */
        line-height: 1;
        margin-top: 1px;
        color: var(--primary-blue); /* نفس اللون */
    }
    
    .mobile-nav-toggle {
        margin-left: 8px;
    }
    
    .mobile-nav-toggle span {
        width: 20px;
        height: 2px;
    }
    
    .header-logo-wrapper {
        max-width: calc(100vw - 80px);
    }
}

/* --- تحسينات للشاشات 360px --- */
@media (max-width: 360px) {
    html, body {
        min-width: 320px;
    }
    
    .logo-english .first-line {
        font-size: 15px; /* زيادة من 13px إلى 15px */
        font-weight: 700; /* سميك */
    }
    
    .logo-english .second-line {
        font-size: 15px; /* نفس الحجم - زيادة من 11px إلى 15px */
        font-weight: 400; /* مش سميك */
        color: var(--primary-blue); /* نفس اللون */
    }
    
    .logo-image {
        height: 35px;
    }
    
    .mobile-nav-toggle span {
        width: 18px;
        height: 2px;
    }
    
    .main-header {
        padding: 8px 10px;
    }
}

/* --- تحسين الوضوح على الشاشات الكبيرة جداً --- */
@media (min-width: 1401px) {
    .main-nav a {
        font-size: 16px;
        padding: 8px 18px;
    }
    
    .btn-register-header {
        font-size: 16px;
        padding: 10px 22px;
    }
    
    .logo-english .first-line {
        font-size: 24px; /* زيادة من 22px إلى 24px */
        font-weight: 700; /* سميك */
    }
    
    .logo-english .second-line {
        font-size: 24px; /* نفس الحجم - زيادة من 22px إلى 24px */
        font-weight: 400; /* مش سميك */
    }
}

/* --- Floating Action Buttons (FABs) --- */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    transition: transform .2s ease, box-shadow .2s ease;
    overflow: hidden;
    background-color: #fff;
}

.social-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

/* --- Footer Styles --- */
.main-footer {
    background-color: var(--dark-color);
    color: #e0e0e0;
    padding: 60px 20px 20px;
    width: 100%;
    box-sizing: border-box;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--secondary-orange);
}

.footer-brand-container {
    margin-bottom: 15px;
}

.footer-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.footer-logo {
    height: 40px;
}

.footer-slogan {
    font-size: 13px;
    font-style: italic;
    color: #a0a0a0;
    margin: 5px 0 0;
    padding-left: 50px;
}

.footer-about-text {
    font-size: 15px;
    line-height: 1.7;
    color: #b0b0b0;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color .3s, padding-left .3s;
}

.footer-col a:hover {
    color: var(--secondary-orange);
    padding-left: 5px;
}

.footer-social-icons {
    display: flex;
    gap: 15px;
}

.footer-social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-block;
    transition: transform .3s;
}

.footer-social-icon:hover {
    transform: scale(1.1);
}

.footer-social-icon img {
    width: 100%;
    height: 100%;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    font-size: 14px;
    color: #888;
}

.footer-links-container {
    margin-top: 10px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links-container a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color .3s;
}

.footer-links-container a:hover {
    color: var(--secondary-orange);
}

/* --- Contact Modal Styles --- */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.contact-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.contact-modal.active .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s;
}

.modal-close-btn:hover {
    color: #333;
}

.modal-content h2 {
    color: var(--primary-blue);
    margin-top: 0;
    margin-bottom: 15px;
}

.modal-content p {
    color: #555;
    margin-bottom: 30px;
}

.contact-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--dark-color);
    transition: background-color 0.3s, transform 0.2s;
}

.contact-option:hover {
    background-color: var(--light-blue);
    transform: translateY(-2px);
}

.contact-option .icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
}

.contact-option .text-content {
    text-align: left;
}

.contact-option .text-content strong {
    display: block;
    font-size: 16px;
    color: var(--primary-blue);
}

.contact-option .text-content span {
    font-size: 14px;
    color: #777;
}

/* --- إصلاحات نهائية لمنع الهوامش البيضاء --- */
* {
    box-sizing: border-box;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

.main-header,
.hero-section,
.section,
.container,
.footer-grid,
.main-footer {
    box-sizing: border-box;
}

@media (max-width: 992px) {
    * {
        max-width: 100vw;
    }
    
    body > *:not(script):not(style) {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
}
