/* ============================================
   ALL CSS RULES USED IN components/Navbar.js
   ============================================ */

/* ========== BASE NAVBAR STYLES ========== */
.navbar {
  /* Fully transparent - no glass effect when not sticky */
  background: transparent;
  border-bottom: none;
  box-shadow: none;
  padding: 8px 20px;
  display: flex;
  align-items: center; /* Center items vertically */
  margin: 0 auto; /* Center the border horizontally */
  color: var(--color-text-invert);
  overflow-x: visible !important;
  position: relative;
  z-index: 1000;
  width: 100%;
}

.navbar ul {
  list-style-type: none;
  display: flex;
  justify-content: flex-end;
  padding: 0 20px !important; /* Horizontal padding, override any global ul, ol rules */
  margin: 0 !important; /* Override any global ul, ol rules */
  font-size: 14px;
  font-family: "Open Sans", sans-serif;
  font-weight: 300;
  letter-spacing: 1px;
  gap: 20px; /* Adds equal spacing between items */
  position: relative; /* Needed for the pseudo-element */
}

.navbar li {
  display: flex;
  align-items: center; /* Vertically center child elements */
  margin: 0 20px;
  padding: 0;
}

.navbar.sticky-scroll ul::before {
  opacity: 0; /* Makes the line invisible */
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.rtl .navbar-content {
  flex-direction: row-reverse;
}

/* ========== DESKTOP MENU ========== */
.desktop-menu {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  gap: 1.5rem;
  list-style: none;
  padding: 0 !important; /* Override any global ul, ol rules */
  margin: 0 !important; /* Override any global ul, ol rules */
}

.desktop-menu.ltr {
  direction: ltr;
  justify-content: flex-end;
}

.desktop-menu.rtl {
  direction: rtl;
  justify-content: flex-start;
}

/* ========== MAIN TITLE (Navigation Links) ========== */
.main-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  font-size:15px;
  font-weight: 300;
  font-family: "Open Sans", sans-serif;
  color: var(--color-text-white);
  text-decoration: none;
  transition: color 0.3s ease, cursor 0.3s ease;
  cursor: pointer;
  letter-spacing: 1.2px;
}

/* Lato font and uppercase for English navbar */
[lang="en"] .main-title,
[dir="ltr"] .main-title,
.ltr .main-title,
html[lang="en"] .main-title,
html[dir="ltr"] .main-title,
.navbar.ltr .main-title,
.navbar[dir="ltr"] .main-title {
  font-family: 'Lato', 'Open Sans', sans-serif;
  text-transform: uppercase;
}

.main-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  width: 0;
  height: 3px;
  transition: width 0.4s ease;
}

/* Non-sticky: white underline, starts from right (RTL) or left (LTR) */
.navbar:not(.sticky-scroll) .main-title::after {
  background-color: white;
}

/* RTL: underline starts from right */
.navbar.rtl:not(.sticky-scroll) .main-title::after,
.navbar:not(.sticky-scroll).rtl .main-title::after {
  right: 0;
  left: auto;
}

/* LTR: underline starts from left */
.navbar.ltr:not(.sticky-scroll) .main-title::after,
.navbar:not(.sticky-scroll).ltr .main-title::after {
  left: 0;
  right: auto;
}

.navbar:not(.sticky-scroll) .main-title:hover::after {
  width: 100%;
}

/* Sticky: black underline, starts from right (RTL) or left (LTR) */
.sticky-scroll .main-title::after {
  background-color: #333;
}

/* RTL: underline starts from right */
.navbar.rtl.sticky-scroll .main-title::after,
.navbar.sticky-scroll.rtl .main-title::after {
  right: 0;
  left: auto;
}

/* LTR: underline starts from left */
.navbar.ltr.sticky-scroll .main-title::after,
.navbar.sticky-scroll.ltr .main-title::after {
  left: 0;
  right: auto;
}

.sticky-scroll .main-title:hover::after {
  width: 100%;
}

/* Keep text white when not sticky, don't change on hover */
.navbar:not(.sticky-scroll) .main-title:hover {
  color: var(--color-text-white) !important;
}

/* ========== STICKY SCROLL ========== */
.sticky-scroll {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 100; /* Ensure it stays above all content */
  width: 100% !important;
  margin: 0 !important;
  /* Glassmorphism effect for sticky navbar */
  backdrop-filter: blur(10px); /* ✨ Blurs the background */
  -webkit-backdrop-filter: blur(10px); /* Safari support */
  background-color: rgb(255, 255, 255) !important; /* Semi-transparent white */
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);

}

/* Navbar at top - already has glass effect applied above */
/* The glass effect is now on both regular and sticky navbar */

.sticky-scroll .main-title {
  color: #021737;
  font-weight: 300 !important;
  transition: color 0.5s ease;
}

/* Text colors when at top (blue background) */
.navbar:not(.sticky-scroll) .main-title {
  color: var(--color-text-white);
}

.navbar:not(.sticky-scroll) .main-title:hover {
  color: var(--color-text-invert);
}

/* Hamburger icon color when at top */
.navbar:not(.sticky-scroll) .hamburger-icon {
  color: var(--color-text-white);
}

.navbar:not(.sticky-scroll) .close-icon {
  color: var(--color-text-white);
}

nav.sticky-scroll {
  padding: 2px 20px; /* Reduced padding for a compact sticky navbar */
  height: auto; /* Allow the height to adjust dynamically */
}

/* ========== MOBILE NAVBAR ========== */
.mobile-navbar {
  display: none; /* Hide the mobile navbar */
}

/* ========== MOBILE MENU ICON ========== */
.mobile-menu-icon {
  display: none; /* Initially hide the mobile menu icon */
  cursor: pointer;
}

.menu-icon {
  display: flex;
  align-items: center; /* Vertically center-align items */
}

.hamburger-icon {
  font-size: 32px;
  cursor: pointer;
  font-family: "Open Sans", sans-serif;
  color: rgb(241, 241, 241);
  padding-bottom: 10px;
  transition: color 0.3s ease;
}

.close-icon {
  font-size: 23px;
  cursor: pointer;
  color: var(--color-text-white); /* Customize the color as needed */
  padding-bottom: 0px;
  transition: color 0.3s ease;
}

/* Hamburger/close icon when sticky */
.sticky-scroll .hamburger-icon {
  color: #333;
}

.sticky-scroll .close-icon {
  color: #333;
}

/* ========== MOBILE MENU ========== */
.mobile-menu {
  font-family: "Open Sans", sans-serif;
  list-style-type: none;
  display: none; /* Initially hide the mobile menu items */
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  background-color: #f6f8fd !important;
  /* Add styling for the mobile menu items */
}

/* Lato font and uppercase for English mobile menu */
[lang="en"] .mobile-menu,
[dir="ltr"] .mobile-menu,
.ltr .mobile-menu,
html[lang="en"] .mobile-menu,
html[dir="ltr"] .mobile-menu {
  font-family: 'Lato', 'Open Sans', sans-serif;
}

[lang="en"] .navbar-mobile-items,
[dir="ltr"] .navbar-mobile-items,
.ltr .navbar-mobile-items,
html[lang="en"] .navbar-mobile-items,
html[dir="ltr"] .navbar-mobile-items {
  font-family: 'Lato', 'Open Sans', sans-serif;
  text-transform: uppercase;
}

.mobile-menu.open {
  display: flex !important;
  opacity: 1 !important;
  transform: translateX(0) !important;
  background-color: #f6f8fd !important;
}

/* Ensure transition works when closing (when .open is removed) */
.mobile-menu:not(.open) {
  opacity: 0;
  transform: translateX(100%);
}

.mobile-menu ul {
  display: flex;
  flex-direction: column;
  padding: 0 !important; /* Override any global ul, ol rules */
  margin: 0 !important; /* Override any global ul, ol rules */
  width: 90%;
  padding-right: 20px;
  gap: 5px;
}

.mobile-menu ul.ltr {
  align-items: flex-start;
  text-align: left;
  padding-left: 20px;
}

.mobile-menu ul.rtl {
  align-items: flex-end;
  text-align: right;
  padding-right: 20px;
}

.mobile-menu ul.rtl a {
  text-align: right;
  margin-right: 20px;
}

.mobile-menu ul.ltr a {
  text-align: left;
  margin-left: 20px;
}

.mobile-menu li {
  margin-bottom: 25px;
  width: 100%;
  text-align: right;
}

.mobile-menu a {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 20px;
  width: 100%;
  display: block;
}

/* Lato font and uppercase for English mobile menu links */
[lang="en"] .mobile-menu a,
[dir="ltr"] .mobile-menu a,
.ltr .mobile-menu a,
html[lang="en"] .mobile-menu a,
html[dir="ltr"] .mobile-menu a {
  font-family: 'Lato', 'Open Sans', sans-serif;
  text-transform: uppercase;
}

.mobile-menu a:hover {
  color: var(--color-accent-light);
}

.mobile-menu.open {
  overflow: hidden;
  height: 100vh;
}

.mobile-menu .submenu li {
  margin-bottom: 0;
  margin-top: 8px;
  position: relative;
  left: -9%;
}

/* ========== NAVBAR MOBILE ITEMS ========== */
.navbar-mobile-items {
  box-sizing: border-box;
  font-size: 20px;
  color: white;
  font-weight: bold;
  text-align: left;
  text-transform: uppercase;
  font-family: "Open Sans", sans-serif;
  font-weight: 500;
  letter-spacing: 2px;
}

/* ========== LOGO CONTAINER ========== */
.logo-container {
  display: flex;
  align-items: center;
}

.logo-item {
  display: flex;
  align-items: center;
}

/* ========== ADDITIONAL LOGOS ========== */
.additional-logos {
  display: flex;
  flex-direction: column;
  padding-top: 10%;
}

.mobile-menu .additional-logos {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-top: 20px;
}

/* ========== CONTACT LINK ========== */
.contact-link {
  display: none;
}

.mobile-menu .contact-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-top: 40px;
}

/* Call Us Button */
.call-us-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: #091b36;
  color: #ffffff !important;
  text-decoration: none;
  font-size: 16px;
  font-weight: 300;
  font-family: "Noto Sans Hebrew", "Open Sans", sans-serif;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 99, 173, 0.3);
  width: 100%;
  max-width: 200px;
  border: none;
  cursor: pointer;
  text-align: center;
}

.call-us-button:hover {
  background-color: #004a7a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 99, 173, 0.4);
}

.call-us-button:active {
  transform: translateY(0);
}

.call-us-button:focus-visible {
  outline: 3px solid rgba(0, 99, 173, 0.5);
  outline-offset: 2px;
}

.call-us-button .phone-icon {
  display: block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* Keep icon + label on one row: .mobile-menu a { display:block; width:100% } would otherwise break flex */
.mobile-menu a.call-us-button {
  display: inline-flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: auto !important;
  max-width: 260px;
}

.call-us-button #call-us-text {
  white-space: nowrap;
}

/* Lato font for English Call Us button */
[lang="en"] .call-us-button,
[dir="ltr"] .call-us-button,
.ltr .call-us-button {
  font-family: 'Lato', 'Open Sans', sans-serif;
}

.contact-link.rtl {
  direction: rtl;
  text-align: right;
}

.contact-link.ltr {
  direction: ltr;
  text-align: left;
}

/* ========== FOOTER ICONS ROW ========== */
.footer-icons-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 8px 0px;
}

.mobile-menu .footer-icons-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* ========== ICON SVG ========== */
.icon-svg {
  width: 20px;
  height: 20px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: opacity 0.3s ease;
}

.icon-svg:hover {
  opacity: 0.7;
}

.icon-svg.linkedin {
  background-image: url("https://img.icons8.com/?size=100&id=8808&format=png&color=414141");
}

.icon-svg.instagram {
  background-image: url("https://img.icons8.com/?size=100&id=32309&format=png&color=414141");
}

.icon-svg.facebook {
  background-image: url("https://img.icons8.com/?size=100&id=8818&format=png&color=414141");
}

.mobile-menu .icon-svg {
  width: 30px;
  height: 22px;
}

/* ========== LANGUAGE TOGGLE ========== */
.language-toggle-item {
  flex-grow: 1;
  display: flex;
}

.language-toggle-item {
  display: flex;
  flex-grow: 1;
  align-items: center;
  justify-content: flex-end;
}

.language-toggle-container {
  margin-inline-start: auto; /* pushes it to the edge */
}

.language-toggle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.mobile-menu .language-toggle-container {
  margin-inline-start: 0;
  margin-inline-end: 0;
  display: flex;
  justify-content: center;
  padding-top: 20px;
}

.language-toggle-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 9999px;
  padding: 4px;
  width: 92px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.navbar.sticky-scroll .language-toggle-button {
  background-color: rgba(0, 99, 173, 0.1);
  border: 1px solid rgba(0, 99, 173, 0.2);
}

.language-toggle-button:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.navbar.sticky-scroll .language-toggle-button:hover {
  background-color: rgba(0, 99, 173, 0.2);
  border-color: rgba(0, 99, 173, 0.3);
}

.language-toggle-button:hover .label-left,
.language-toggle-button:hover .label-right {
  color: var(--color-text-white);
}

.navbar.sticky-scroll .language-toggle-button:hover .label-left,
.navbar.sticky-scroll .language-toggle-button:hover .label-right {
  color: var(--color-primary);
}

.mobile-menu .language-toggle-button {
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 99, 173, 0.2);
}

.mobile-menu .language-toggle-button:hover {
  background-color: rgba(0, 99, 173, 0.1);
}

.mobile-menu .label-left,
.mobile-menu .label-right {
  color: var(--color-primary);
}

.mobile-menu .language-toggle-button:hover .label-left,
.mobile-menu .language-toggle-button:hover .label-right {
  color: var(--color-primary);
}

.toggle-indicator {
  position: absolute;
  top: 4px;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.toggle-indicator.left {
  left: 4px;
}

.toggle-indicator.right {
  left: 56px;
}

.globe-icon {
  color: var(--color-primary);
  transition: color 0.3s ease;
}

.label-left,
.label-right {
  position: absolute;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-white);
  z-index: 1;
  transition: color 0.3s ease;
}

.navbar.sticky-scroll .label-left,
.navbar.sticky-scroll .label-right {
  color: var(--color-primary);
}

.label-left {
  left: 8px;
  padding-left: 35px; /* Space to avoid overlap with toggle indicator when on left */
}

.label-right {
  right: 8px;
  padding-right: 35px; /* Space to avoid overlap with toggle indicator when on right */
}

/* ========== VISIBILITY UTILITIES ========== */
.hidden {
  opacity: 0;
  transition: opacity 0.3s;
}

.visible {
  opacity: 1;
  transition: opacity 0.3s;
}

/* ========== RTL/LTR UTILITIES ========== */
/* RTL and LTR classes are used as modifiers throughout the stylesheet */

/* ========== BODY MENU OPEN ========== */
body.menu-open {
  overflow: hidden;
}

/* ============================================
   MEDIA QUERIES
   ============================================ */

/* ========== @media screen and (max-width: 970px) ========== */
@media screen and (max-width: 970px) {
  .sticky-scroll {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
  }

  .additional-logos {
    display: flex;
    flex-direction: column;
    padding-top: 10%;
  }

  .desktop-menu {
    display: none; /* Hide the desktop menu on small screens */
  }

  .desktop-menu.ltr {
    display: none; /* Hide the desktop menu on small screens */
  }

  .desktop-menu.rtl {
    display: none; /* Hide the desktop menu on small screens */
  }

  .contact-link {
    display: none;
  }

  .mobile-menu .icon-svg {
    width: 30px;
    height: 22px;
  }

  .mobile-menu .contact-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0;
  }

  .navbar {
    flex-direction: column; /* Stack items vertically */
    align-items: flex-start; /* Align items to the left */
    padding: 0px; /* Increase padding for better spacing */
    border-top: 0px solid rgb(176, 176, 176);
    top: 10px; /* Adjust the value as needed */
    z-index: 100; /* Ensure a high z-index value */
    width: 100%;
  }

  .mobile-menu {
    position: fixed;
    top: 65px;
    width: 100%;
    background-color: #f6f8fd !important;
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    direction: rtl;
    padding-top: 30px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  }

  .mobile-menu.open {
    display: flex !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
    overflow-y: auto;
    background-color: #f6f8fd !important;
  }

  .mobile-menu ul {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    width: 90%;
    padding-right: 20px;
    gap: 5px;
  }

  .mobile-menu-icon {
    position: relative; /* Changed from absolute to relative for flexbox layout */
    color: rgb(176, 176, 176);
    z-index: 3;
    display: block;
  }

  .mobile-navbar {
    top: 0px;
    left: 0;
    right: 0;
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: transparent; /* Transparent when at top */
    width: 100%;
    height: 65px;
    z-index: 9998;
    color: var(--color-accent-dark);
    padding: 0 20px;
    box-sizing: border-box;
    transition: background-color 0.3s ease; /* Smooth transition */
  }
  
  .mobile-navbar .logo-container {
    flex: 0 0 auto;
  }
  
  .mobile-navbar .mobile-menu-icon {
    flex: 0 0 auto;
  }
  
  /* RTL support - swap logo and hamburger positions */
  .mobile-navbar.rtl {
    flex-direction: row-reverse;
  }

  .mobile-menu ul.ltr {
    align-items: flex-start;
    text-align: left;
    padding-left: 20px;
  }

  /* RTL (Hebrew) */
  .mobile-menu ul.rtl {
    align-items: flex-end;
    text-align: right;
    padding-right: 20px;
  }

  .sticky-scroll .mobile-navbar {
    top: 0 !important; /* Keep at top when sticky, no shift */
    left: 0 !important;
    right: 0 !important;
    padding: 0 20px !important; /* Ensure consistent padding when sticky */
    margin: 0 !important;
    background-color: #ffffff !important; /* White background when sticky */
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  }
  
  .sticky-scroll .mobile-navbar .logo-container {
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
  }
  
  /* Remove parent navbar padding on mobile when sticky to prevent logo shift */
  nav.sticky-scroll {
    padding: 0 !important;
  }

  .sticky-scroll .mobile-menu.open {
    top: 64px;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .mobile-menu.open {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Fill viewport below navbar; avoid 100vh + top overlap on iOS */
    top: 65px;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto !important;
    min-height: calc(100vh - 65px);
    min-height: calc(100dvh - 65px);
    max-height: none;
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    background-color: #f6f8fd !important;
  }
  
  .mobile-menu {
    background-color: #f6f8fd !important;
  }

  .mobile-menu li {
    margin-bottom: 25px;
    width: 100%;
    text-align: right;
  }

  .mobile-menu a {
    color: black;
    text-decoration: none;
    font-size: 16px;
    width: 100%;
    display: block;
  }

  .mobile-menu ul.rtl a {
    text-align: right;
  }

  .mobile-menu ul.ltr a {
    text-align: left;
  }

  .mobile-menu a:hover {
    color: var(--color-accent-light);
  }

  body.menu-open {
    overflow: hidden;
  }

  .mobile-menu .submenu li {
    margin-bottom: 0;
    margin-top: 8px;
    position: relative;
    left: -9%;
  }

  .mobile-menu .additional-logos {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-top: 20px;
  }

  .mobile-menu .footer-icons-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 100%;
  }

  .mobile-menu .language-toggle-container {
    margin-inline-start: 0;
    margin-inline-end: 0;
    display: flex;
    justify-content: center;
    padding-top: 20px;
  }

  .mobile-menu .language-toggle-button {
    background-color: var(--white);
  }

  .language-toggle-button:hover {
    background-color: var(--color-accent-dark);
  }
}

/* ========== @media (max-width: 400px) ========== */
@media (max-width: 400px) {
  .hamburger-icon {
    font-size: 28px;
  }

  .close-icon {
    font-size: 23px;
  }

  .mobile-menu.open {
    min-height: calc(100dvh - 65px);
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    background-color: #f6f8fd !important;
  }

  .mobile-menu .contact-link {
    padding-bottom: 10px;
  }
  
  .call-us-button {
    font-size: 14px;
    padding: 10px 20px;
    max-width: 180px;
  }

  .mobile-menu a.call-us-button {
    max-width: min(260px, calc(100vw - 48px));
  }
  
  .call-us-button .phone-icon {
    width: 18px;
    height: 18px;
  }

  .mobile-menu .submenu li {
    margin-bottom: 0;
    margin-top: 8px;
    position: relative;
    left: -30px;
  }

  .navbar-mobile-items {
    font-size: 18px;
    letter-spacing: 2.5px;
  }

  .mobile-menu a {
    font-size: 18px;
  }
}

/* ============================================
   END OF NAVBAR CSS
   ============================================ */

