/* --- Global Styles & Variables --- */
:root {
    --bg-dark: #121212;
    --bg-secondary: #1E1E1E;
    --primary-yellow: #EAB308;
    --text-light: #E5E7EB;
    --text-secondary: #9CA3AF;
    --font-family-en: 'Poppins', sans-serif;
    --font-family-ar: 'Cairo', sans-serif; 
}

html {
    scroll-behavior: smooth;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family-en);
    background-color: var(--bg-dark);
    color: var(--text-light);
    transition: all 0.3s ease;
}

section, footer {
    scroll-margin-top: 70px; 
}


/* --- Header & Navigation --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent; 
    transition: background-color 0.3s ease; 
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    height: 70px;
    /* direction: ltr; */ /* <-- I have removed this line */
}
.nav-logo {
    font-family: var(--font-family-ar); 
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-yellow);
    text-decoration: none;
    z-index: 1001; 
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.navbar-left {
    display: flex;
    align-items: center;
    gap: 30px; 
    position: relative; 
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 70px;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-link:hover { color: var(--primary-yellow); }

.nav-link-button {
    background-color: transparent;
    color: var(--primary-yellow); 
    border: 2px solid var(--primary-yellow); 
    padding: 8px 20px;
    border-radius: 8px; 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 1rem; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-link-button:hover {
    background-color: var(--primary-yellow); 
    color: var(--bg-dark); 
}

.desktop-controls { display: flex; align-items: center; gap: 20px; }
.nav-social { display: flex; align-items: center; gap: 20px; }

.nav-social a { 
    position: relative; 
    display: inline-block; 
    color: var(--text-light); 
    font-size: 1.2rem; 
    transition: color 0.3s ease; 
}

.nav-social a:hover { color: var(--primary-yellow); }

.social-tooltip {
    position: absolute;
    bottom: -35px; 
    left: 50%;
    transform: translateX(-50%); 
    background-color: var(--primary-yellow);
    color: var(--bg-dark);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap; 
    opacity: 0; 
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
}

.nav-social a:hover .social-tooltip {
    opacity: 1;
    visibility: visible;
}

.social-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 5px 5px;
    border-style: solid;
    border-color: transparent transparent var(--primary-yellow) transparent;
}

.lang-switcher button,
.lang-switcher-mobile button {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    font-family: inherit;
    justify-content: center; 
}

.lang-switcher button:hover,
.lang-switcher-mobile button:hover {
    color: var(--primary-yellow);
}

.lang-switcher-mobile { display: none; }

.hamburger {
  display: flex;          
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 38px;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  margin-left: 16px;      
  z-index: 1002;
}

.bar {
  display: block;
  width: 22px;
  height: 3px;
  margin: 3px 0;
  background-color: var(--text-light);
  transition: all 0.25s ease;
}

.nav-menu {
  display: none;          
}

@media (min-width: 769px) {
    .nav-menu.active {
      display: block;
      position: absolute;
      top: 55px;  
      left: 40px;    /* <-- تم التعديل هنا (يمكنك تغيير هذه القيمة) */
      background-color: rgba(18,18,18,0.98);
      padding: 12px 16px;
      border-radius: 10px;
      box-shadow: 0 8px 30px rgba(0,0,0,0.6);
      min-width: 180px;
      z-index: 1001;
    }

    /* --- THIS IS THE ADDED FIX --- */
    body[dir="rtl"] .nav-menu.active {
      left: auto; 
      right: 0;   
    }
    /* --- END OF FIX --- */
}

.nav-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu .nav-item { margin: 0; padding: 0; }
.nav-menu .nav-link {
  display: block;
  padding: 8px 6px;
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  border-radius: 6px;
}
.nav-menu .nav-link:hover { background: rgba(255,255,255,0.03); color: var(--primary-yellow); }

@media (max-width: 768px) {
  .nav-menu { 
    display: flex; 
  }
  .nav-menu.active { left: 0; right: initial; } 
}

/* --- Hero, Mission, Cards, etc. --- */
.hero { height: 100vh; padding: 0; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.slideshow-container { height: 100%; width: 100%; position: absolute; top: 0; left: 0; }
.slide { display: none; height: 100%; width: 100%; position: absolute; top: 0; left: 0; display: flex; justify-content: center; align-items: center; text-align: center; background-size: cover; background-position: center; background-repeat: no-repeat; }
#slide1 { background-image: linear-gradient(rgba(18, 18, 18, 0.8), rgba(18, 18, 18, 0.8)), url('photo/background.jpeg'); }
#slide2 { background-image: linear-gradient(rgba(18, 18, 18, 0.8), rgba(18, 18, 18, 0.8)), url('photo/2.jpeg'); }
#slide3 { background-image: linear-gradient(rgba(18, 18, 18, 0.8), rgba(18, 18, 18, 0.8)), url('photo/3.jpeg'); }
.hero-content { padding: 0 5%; position: relative; z-index: 2; }

.hero-content h1 { 
    font-size: 3rem; 
    max-width: 800px; 
    margin: 0 auto 20px auto; 
    color: var(--text-light); 
}

.hero-content h1 .highlight-yellow {
    color: var(--primary-yellow);
}

.hero-content p { font-size: 1.1rem; margin-bottom: 30px; }
.cta-button { background-color: var(--primary-yellow); color: var(--bg-dark); padding: 15px 30px; text-decoration: none; font-weight: 600; border-radius: 8px; transition: transform 0.3s ease; display: inline-block; }
.cta-button .fa-arrow-right { margin-left: 8px; }
.cta-button:hover { transform: scale(1.05); }

.hero-buttons-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.fade { animation-name: fade; animation-duration: 1.5s; }
@keyframes fade { from {opacity: .4} to {opacity: 1} }
.dots-container { text-align: center; position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 3; }
.dot { cursor: pointer; height: 15px; width: 15px; margin: 0 5px; background-color: #717171; border-radius: 50%; display: inline-block; transition: background-color 0.6s ease; }
.active, .dot:hover { background-color: var(--primary-yellow); }
main > section:not(.hero) { background-color: var(--bg-dark); }

section {
    padding: 70px 5%;
}

h2 { font-size: 2.25rem; text-align: center; margin-bottom: 1rem; }
p { color: var(--text-secondary); line-height: 1.6; }
.subtitle { text-align: center; max-width: 600px; margin: 0 auto 40px auto; }
.mission-items-container { display: flex; justify-content: space-around; gap: 30px; text-align: center; width: 100%; }
.mission-item .icon-circle { width: 60px; height: 60px; background-color: rgba(234, 179, 8, 0.1); border-radius: 50%; margin: 0 auto 20px auto; display: flex; justify-content: center; align-items: center; color: var(--primary-yellow); font-size: 1.5rem; }
.mission-item h3 { margin-bottom: 10px; color: var(--text-light); }
.cards-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 40px; }
.card { position: relative; border-radius: 12px; overflow: hidden; height: 400px; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover img { transform: scale(1.1); }
.card-overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px; background: linear-gradient(to top, rgba(18, 18, 18, 1), rgba(18, 18, 18, 0)); }
.card-overlay h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary-yellow);
}
.what-we-offer { background-color: var(--bg-secondary); }
.offer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.offer-item { background-color: #2a2a2a; padding: 30px; border-radius: 12px; }
.offer-item i { font-size: 2rem; color: var(--primary-yellow); margin-bottom: 15px; }
.offer-item h3 { font-size: 1.4rem; margin-bottom: 10px; }

/* === MODIFIED: Contact Section Styles === */
.contact-section-container {
    /* This overrides the default 'section' padding */
    padding: 0;
}

/* NEW: Grid container for the two panels */
.contact-grid {
    display: grid;
    /* UPDATED: Swapped column sizes. Form (1.1fr) is now on the left. */
    grid-template-columns: 1.1fr 1fr; /* Left col, Right col */
    align-items: stretch; /* Make columns equal height */
    
    background-color: var(--bg-secondary); /* <-- Background is here */
}

/* NEW: Left panel ("Get in Touch") */
.get-in-touch-panel {
    /* UPDATED: Swapped padding. This is now the RIGHT panel. */
    padding: 70px 5% 70px 40px; /* T, R, B, L */

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* MODIFIED: Align text left inside panels */
.get-in-touch-panel h2,
.form-container h1 {
    text-align: left;
}

.get-in-touch-panel .subtitle,
.form-container .subtitle {
    text-align: left;
    margin: 0 auto 30px 0; /* Remove auto horizontal margin */
}

/* MODIFIED: .form-container (now the right panel) */
.form-container {
    /* UPDATED: Swapped padding. This is now the LEFT panel. */
    padding: 70px 40px 70px 5%; /* T, R, B, L */
    height: 100%; /* Stretches to match left panel */
}

.form-container h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

/* MODIFIED: .contact-container (inside left panel) */
.get-in-touch-panel .contact-container {
    display: flex;
    flex-direction: column; /* Stack contact boxes */
    gap: 20px;
    margin-top: 40px;
    justify-content: flex-start;
}

/* MODIFIED: .contact-box (inside left panel) */
.get-in-touch-panel .contact-box {
    background-color: var(--bg-dark); /* Darker box */
    padding: 20px;
    border-radius: 12px;
    flex-basis: auto; /* Remove fixed basis */
    display: flex;
    align-items: center;
    gap: 20px;
}

.get-in-touch-panel .contact-box i {
    font-size: 1.8rem;
    color: var(--primary-yellow);
    margin-bottom: 0;
}

.get-in-touch-panel .contact-box h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.get-in-touch-panel .contact-box a {
    color: var(--text-secondary);
    text-decoration: none;
}

/* Styles for the footer, which also uses .get-in-touch */
footer.get-in-touch {
    text-align: center; 
    padding-top: 20px; 
    padding-bottom: 20px;
}

footer.get-in-touch .contact-container {
    display: flex; 
    justify-content: center; 
    gap: 30px; 
    margin-top: 60px;
}

footer.get-in-touch .contact-box {
    background-color: var(--bg-secondary); 
    padding: 30px 40px; 
    border-radius: 12px; 
    flex-basis: 300px;
}


/* --- Form Element Styles (Unchanged) --- */
.form-section {
    /* === MODIFIED: Reduced height === */
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    /* === MODIFIED: Reduced height === */
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative; /* Added for error message positioning if needed */
}

.form-group label {
    font-weight: 600;
    /* === MODIFIED: Reduced height === */
    margin-bottom: 5px;
    color: var(--text-light);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    /* === MODIFIED: Reduced height === */
    padding: 8px 10px; /* V, H */
    border-radius: 8px;
    border: 1px solid var(--text-secondary);
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.3);
}

.form-group textarea {
    resize: vertical;
    /* === MODIFIED: Reduced height === */
    min-height: 80px;
}



.form-submit-btn {
    width: 100%;
    /* === MODIFIED: Reduced height === */
    margin-top: 20px;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
}

/* --- NEW VALIDATION STYLES --- */
.error-message {
    color: #E53E3E; /* Red error color */
    font-size: 0.875rem;
    margin-top: 5px;
    display: none; /* Hidden by default */
}

.form-group.error .error-message {
    display: block; /* Show error message */
}

.form-group.error input,
.form-group.error textarea {
    border-color: #E53E3E; /* Red border for error */
}

.form-group.success input,
.form-group.success textarea {
    border-color: #38A169; /* Green border for success */
}
/* === END OF NEW STYLES === */


/* --- Responsive & RTL Section --- */
@media (max-width: 992px) {
    .mission-items-container { flex-direction: column; }

    /* NEW: Stack contact grid on tablets */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* MODIFIED: Adjust padding for stacked layout */
    .get-in-touch-panel {
        /* UPDATED: This is now the BOTTOM panel when stacked */
        padding: 40px 5% 70px 5%; /* T, R, B, L */
        border-right: none;
        border-bottom: 1px solid var(--bg-dark);
    }

    .form-container {
         /* UPDATED: This is now the TOP panel when stacked */
        padding: 70px 5% 40px 5%; /* T, R, B, L */
    }


    .get-in-touch-panel h2,
    .get-in-touch-panel .subtitle,
    .form-container h1,
    .form-container .subtitle {
        text-align: center; /* Re-center headings when stacked */
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    /* Hamburger and desktop controls visibility */
    .desktop-controls { display: none; }
    .hamburger { display: block; }

    .lang-switcher {
        display: none;
    }

    /* --- MOBILE NAV MENU STYLING (The Burger Menu Panel) --- */
    .nav-menu {
        position: fixed;
        left: -100%; 
        top: 70px; 
        height: auto; 
        gap: 0;
        flex-direction: column;
        justify-content: flex-start; 
        width: 100%;
        max-width: 220px; 
        padding: 20px 0 20px 30px; 
        align-items: flex-start;
        box-shadow: 2px 2px 10px rgba(0,0,0,0.5); 
        background-color: var(--bg-dark);
        transition: 0.3s;
        z-index: 1000;
        border-bottom-right-radius: 10px;
    }

    .nav-menu.active {
        left: 0; 
    }
    
    .nav-menu .nav-item {
        margin-bottom: 20px; 
        list-style: none; 
        width: 100%;
    }

    .nav-menu .nav-link,
    .nav-menu .nav-link-button {
        font-size: 1.2rem; 
        color: var(--text-light); 
        padding: 5px 0;
        display: block;
    }
    
    .nav-menu .nav-link-button {
        border: none;
        background: none;
        color: var(--text-light);
    }

    .lang-switcher-mobile {
        display: block; 
        margin-top: 20px; 
        padding-top: 20px; 
        border-top: 1px solid var(--bg-secondary); 
    }
    
    .lang-switcher-mobile button {
        font-size: 1.2rem; 
        font-weight: 600; 
        padding: 5px 0;
        width: 100%;
        justify-content: flex-start; 
        gap: 10px; 
        color: var(--text-secondary); 
    }

    .lang-switcher-mobile button:hover {
        color: var(--primary-yellow); 
    }
    
    .hero-content h1 {
        font-size: 2.25rem; 
        margin-bottom: 25px;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 35px;
    }

    .cta-button {
        padding: 12px 24px; 
        font-size: 0.9rem;
    }

    .hero-buttons-container {
        gap: 15px; 
    }

    /* --- NEW: Form Responsive Styles --- */
    /* MODIFIED: Reduce padding for small mobile */
    .get-in-touch-panel {
        /* UPDATED: This is the BOTTOM panel */
        padding: 30px 5% 50px 5%;
    }
    .form-container {
        /* UPDATED: This is the TOP panel */
        padding: 50px 5% 30px 5%;
    }
    
    .form-container h1 {
        font-size: 1.8rem;
    }
    /* --- END NEW --- */


} 

/* RTL Styles */
body[dir="rtl"] { 
   font-family: var(--font-family-ar);  
    text-align: right; 
}
body[dir="rtl"] .cta-button .fa-arrow-right { 
    transform: scaleX(-1); 
    margin-left: 0; 
    margin-right: 8px; 
}

/* --- NEW: RTL Form Styles --- */
body[dir="rtl"] .form-group label {
    text-align: right;
}

/* NEW: RTL Grid Panel Styles */
body[dir="rtl"] .get-in-touch-panel {
    border-right: none;
    /* UPDATED: This is now the LEFT panel in RTL, so it gets outer padding on the left */
    padding: 70px 40px 70px 5%; /* T, R, B, L */
}

/* MODIFIED: RTL Padding */
body[dir="rtl"] .form-container {
    /* UPDATED: This is now the RIGHT panel in RTL, so it gets outer padding on the right */
    padding: 70px 5% 70px 40px; /* T, R, B, L */
}


body[dir="rtl"] .get-in-touch-panel h2,
body[dir="rtl"] .form-container h1,
body[dir="rtl"] .get-in-touch-panel .subtitle,
body[dir="rtl"] .form-container .subtitle {
    text-align: right;
    margin: 0 0 30px auto;
}

/* --- END NEW --- */

@media (max-width: 992px) {
    /* RTL adjustments for stacked mobile view */
    body[dir="rtl"] .get-in-touch-panel {
        border-left: none; /* Remove side border */
        border-bottom: 1px solid var(--bg-dark); /* Keep bottom border */
        /* UPDATED: This is the BOTTOM panel when stacked in RTL */
        padding: 40px 5% 70px 5%;
    }

    body[dir="rtl"] .form-container {
        /* UPDATED: This is the TOP panel when stacked in RTL */
        padding: 70px 5% 40px 5%;
    }

    body[dir="rtl"] .get-in-touch-panel h2,
    body[dir="rtl"] .get-in-touch-panel .subtitle,
    body[dir="rtl"] .form-container h1,
    body[dir="rtl"] .form-container .subtitle {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    body[dir="rtl"] .nav-menu { 
        left: initial; 
        right: -100%; 
        align-items: flex-end; 
        padding-left: 0; 
        padding-right: 30px; 
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 10px;
    }
    body[dir="rtl"] .nav-menu.active { 
        left: initial; 
        right: 0; 
    }

    body[dir="rtl"] .lang-switcher-mobile button {
        justify-content: flex-end; 
    }

    body[dir="rtl"] .mission-items-container { 
        flex-direction: column; 
    }

    /* MODIFIED: RTL Padding small mobile */
    body[dir="rtl"] .get-in-touch-panel {
        /* UPDATED: This is the BOTTOM panel */
        padding: 30px 5% 50px 5%;
    }
    body[dir="rtl"] .form-container {
        /* UPDATED: This is the TOP panel */
        padding: 50px 5% 30px 5%;
    }
}