*[data-lang="ar"] {
  font-family: "Tajawal", sans-serif;
}

[data-lang] {
  display: none;
}

[data-lang="en"] {
  display: block;
}

html[dir="rtl"] [data-lang="ar"] {
  display: block;
}

html[dir="rtl"] [data-lang="en"] {
  display: none;
}

.page-content {
  display: none;
}

.page-content.active {
  display: block;
}

.nav-link {
  position: relative;
  text-decoration: none; /* remove default underline */
  color: #000; /* adjust if needed */
}

.nav-link > span {
  opacity: 0.4;
}

/* underline pseudo-element */
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0; /* position at text bottom */
  width: 0;
  height: 2px;
  background-color: currentColor; /* underline same color as text */
  transition: width 0.3s ease-in-out;
}

/* animate when active */
.nav-link.active::after {
  width: 100%;
}

.nav-link.active > span {
  opacity: 1;
}
/* Fix for Bootstrap navbar in RTL */
html[dir="rtl"] .navbar-nav {
  padding-right: 0;
}

html[dir="rtl"] .me-auto {
  margin-right: 0 !important;
  margin-left: auto !important;
}

html[dir="rtl"] .ms-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}
/* Language toggle button */
.lang-toggle {
  width: 30px;
  height: 30px;
  padding: 0.15rem;
  box-shadow: 0 0 7px rgba(0, 0, 0, 0.3);
  background-color: white;
}

.lang-toggle:hover {
  background-color: rgb(246, 246, 246);
}

body {
  transition: background 0.5s ease;
  min-height: 100vh;
}

/* Home page backgrounds */
body.home-en {
  background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.5) 0%,
      /* Lighter at top */ rgba(255, 255, 255, 1) 70% /* Stronger at bottom */
    ),
    url("/welcome_page_screenshots/bg-en.png") no-repeat center;
  background-size: 100% 130%;
}

body.home-ar {
  background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.5) 0%,
      /* Lighter at top */ rgba(255, 255, 255, 1) 70% /* Strongest at bottom */
    ),
    url("/welcome_page_screenshots/bg-ar.png") no-repeat center;
  background-size: 100% 130%;
}

@media (max-width: 768px) {
  body.home-en,
  body.home-ar {
    background-size: cover; /* Scale image to cover screen */
    background-position: top center; /* Adjust focus point if needed */
  }
}

#home {
  padding-top: 10vh;
}

.points-container {
  margin: 0 auto;
  text-align: center;
}

.active-point-header {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #333;
  min-height: 3rem; /* Prevents layout shift when changing headers */
}

.navigation-row {
  margin-bottom: 2rem;
  position: relative;
  display: flex;
  justify-content: center;
  position: relative;
  width: 100%;
}

.points-navigation {
  display: block ruby;
  gap: 0.6rem;
}

.point-content {
  display: none;
  line-height: 1.6;
  text-align: center;
  padding: 0 1rem;
}

.point-content.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

.point-bullet {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid #333;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
  align-self: center;
}

.point-bullet.active {
  background: #000;
  transform: scale(1.2);
}

.learn-more-btn {
  background: #000;
  color: white;
  border: none;
  padding: 0.2rem 0.8rem;
  border-radius: 30px;
  font-size: smaller;
  cursor: pointer;
  transition: background 0.3s ease;
}

.learn-more-btn:hover {
  background: #191919;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.btn-black {
  width: 15rem;
  background-color: #000;
  color: white;
  border: 1px solid #000;
}

.btn-black:hover {
  background: #191919;
  color: white;
}

.btn-outline-black {
  width: 15rem;
  border: 1px solid #000;
  color: #000;
  background-color: transparent;
}

.btn-outline-black:hover {
  background-color: #000;
  color: white;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  color: #333;
}

/* Offcanvas Custom Styles */
.offcanvas-nav {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
}

.offcanvas-nav li {
  margin-bottom: 1.5rem;
}

.offcanvas-nav a {
  color: #333;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.offcanvas-nav a.active {
  color: #000;
  border-bottom-color: #000;
}

/* Mobile Responsive Styles */
@media (max-width: 991px) {
  .mobile-menu-btn {
    display: block;
  }

  .navbar-toggler {
    display: none;
  }

  .collapse.navbar-collapse {
    display: none !important;
  }

  /* Fix logo centering on mobile only */
  .navbar-brand {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
  }

  /* Ensure mobile menu button doesn't interfere */
  .mobile-menu-btn {
    z-index: 1;
    position: relative;
  }

  /* Ensure language toggle stays on right */
  .ms-auto {
    z-index: 1;
    position: relative;
  }
}

/* Desktop - keep original centering */
@media (min-width: 992px) {
  .position-absolute.start-50.translate-middle-x {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
  #home {
    padding-top: 5vh;
  }

  .active-point-header {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  .navigation-row {
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .points-navigation {
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .point-bullet {
    width: 0.8rem;
    height: 0.8rem;
    /* Add minimum touch target for mobile */
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.1rem;
  }

  .point-bullet::before {
    content: "";
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    border: 2px solid #333;
    background: transparent;
    transition: all 0.3s ease;
  }

  .point-bullet.active::before {
    background: #000;
    transform: scale(1.2);
  }

  .learn-more-btn {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    margin-top: 0.5rem;
  }

  .point-content {
    font-size: 0.9rem;
    padding: 0 0.5rem;
  }

  .btn-black,
  .btn-outline-black {
    width: 40%;
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  .navbar {
    padding-top: 2rem !important;
  }

  .navbar-brand img {
    width: 100px;
    height: 28px;
  }

  .lang-toggle {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }
}

@media (max-width: 576px) {
  .active-point-header {
    font-size: 1.2rem;
  }

  .points-navigation {
    gap: 0.3rem;
  }

  .point-bullet {
    min-width: 28px;
    min-height: 28px;
  }

  .point-bullet::before {
    width: 0.6rem;
    height: 0.6rem;
  }

  .btn-black,
  .btn-outline-black {
    width: 45%;
    font-size: 0.8rem;
  }

  .point-content {
    font-size: 0.85rem;
  }

  /* Make contact info stack on very small screens */
  .w-100.d-flex.justify-content-center.gap-5:last-child {
    flex-direction: column;
    gap: 0.5rem !important;
    align-items: center;
  }

  .w-100.d-flex.justify-content-center.gap-5:last-child p {
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
  }
}

/* Ensure proper touch targets on mobile while keeping original visual style */
@media (max-width: 768px) {
  .point-bullet {
    border: none;
    background: transparent;
    width: auto;
    height: auto;
  }
}

/* About Page Styles - Updated for better image display */
#about .point-content {
  text-align: left;
  padding: 0;
  margin-bottom: 1.5rem;
}

#about .point-content p {
  margin-bottom: 1rem;
}

/* Updated About Page Layout */
#about .row {
  min-height: 100vh;
}

/* Left Column - Text Content */
#about .col-md-4 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Right Column - Image Container */
#about .col-md-8 {
  padding: 0;
  position: relative;
  max-height: 100vh;
  overflow: hidden;
}

/* Image Styles - Modified to show only top-left corner */
#about img {
  width: 105%; /* Make image larger than container */
  height: 110%; /* Make image larger than container */
  display: block;
  border: 2px solid black;
  border-radius: 1rem;
  object-fit: contain;
}

@media (max-width: 1000px) {
  #about img {
    width: 100%;
  }
}

html[dir="ltr"] #about img {
  /* transform: translate(0, 0) scale(1); */
  object-position: top left;
}

html[dir="ltr"] #about .col-md-8 {
  border-top-left-radius: 1rem;
}

html[dir="rtl"] #about img {
  /* transform: translate(50%, 0) scale(1); */
  object-position: top right;
}

html[dir="rtl"] #about .col-md-8 {
  border-top-right-radius: 1rem;
}
/* For RTL layout */
html[dir="rtl"] #about .point-content {
  text-align: right;
}

/* For RTL, show top-right corner instead */
html[dir="rtl"] #about img {
  object-position: top right;
}

/* Mobile responsive */
@media (max-width: 768px) {
  #about .row {
    min-height: auto;
  }

  #about .col-md-4 {
    min-height: auto;
    padding: 2rem 1rem;
  }

  #about .col-md-8 {
    min-height: 400px;
    order: -1; /* Show image first on mobile */
  }

  #about .point-content {
    text-align: center;
  }

  html[dir="rtl"] #about .point-content {
    text-align: center;
  }
}

/* Extra small screens */
@media (max-width: 576px) {
  #about .col-md-4 {
    padding: 1.5rem 1rem;
  }

  #about .col-md-8 {
    min-height: 300px;
  }

  #about img {
    min-height: 600px; /* Adjust for smaller screens */
    width: 100%;
  }
}

.btn-about-next,
.btn-about-prev {
  border-radius: 6rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-about-next:hover,
.btn-about-prev:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* About screens animation */
#about .col-md-8 {
  position: relative;
}

#about .col-md-8::before {
  position: absolute;
  top: 0;
  left: -75%;
  z-index: 2;
  display: block;
  content: "";
  width: 50%;
  height: 100%;
  background: -webkit-linear-gradient(
    left,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 100%
  );
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 100%
  );
  -webkit-transform: skewX(-25deg);
  transform: skewX(-25deg);
}

#about .col-md-8:hover::before {
  -webkit-animation: shine 0.75s;
  animation: shine 0.75s;
}

/* About header title wrapper */
.about-title-wrapper {
  flex: 1;
  min-width: 0;
  text-align: start;
  overflow: hidden;
}

.about-header {
  align-items: flex-start !important;
  gap: 1rem;
  width: 100%;
}

.about-title-wrapper span {
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.2;
  max-width: 100%;
}

/* Ensure proper alignment for RTL */
html[dir="rtl"] .about-title-wrapper {
  text-align: start;
}

/* Mobile responsive for about titles */
@media (max-width: 768px) {
  .about-title-wrapper span {
    font-size: 1.5rem !important;
  }

  .about-header {
    gap: 0.5rem;
  }
}
@-webkit-keyframes shine {
  100% {
    left: 125%;
  }
}

@keyframes shine {
  100% {
    left: 125%;
  }
}

/* Mobile responsive improvements for About section */
@media (max-width: 991px) {
  #about .row {
    flex-direction: column;
  }

  #about .col-lg-4 {
    width: 100%;
    padding: 1.5rem 1rem;
    min-height: auto;
    order: 2; /* Text comes after image */
  }

  #about .col-lg-8 {
    width: 100%;
    max-height: 50vh;
    min-height: 300px;
    order: 1; /* Image comes first */
    margin-bottom: 1.5rem;
  }

  #about img {
    object-fit: contain; /* Better for mobile - fills container */
    object-position: center top; /* Focus on top content */
    height: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  #about img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
  }

  /* Zoom container for mobile */
  .zoom-container {
    position: relative;
    overflow: hidden;
  }
}

@media (max-width: 768px) {
  /* Home page improvements */
  #home .points-container {
    padding: 0 0.5rem;
  }

  /* About page specific */
  #about .col-lg-8 {
    max-height: 40vh;
    min-height: 250px;
  }

  .about-title-wrapper span {
    font-size: 1.2rem !important;
  }

  #about .point-content {
    text-align: start;
    font-size: 0.9rem;
    padding: 0;
  }

  html[dir="rtl"] #about .point-content {
    text-align: start;
  }

  /* Make buttons container more compact */
  .about-header .d-flex.gap-2 {
    gap: 0.25rem !important;
  }

  .btn-about-next,
  .btn-about-prev {
    padding: 0.25rem;
  }

  .btn-about-next svg,
  .btn-about-prev svg {
    width: 28px;
    height: 28px;
  }

  /* Login/Register buttons on about page */
  #about .btn-black,
  #about .btn-outline-black {
    width: 45%;
    font-size: 0.85rem;
    padding: 0.4rem;
  }

  /* Support page improvements */
  #support .col-lg-8 {
    width: 100%;
    padding: 0 1rem;
  }

  #support .card-body .row {
    flex-direction: column;
    gap: 1.5rem !important;
  }

  #support .col-md-4 {
    width: 100%;
  }

  #support h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  /* About page for very small screens */
  .about-title-wrapper span {
    font-size: 1rem !important;
  }

  #about .col-lg-8 {
    max-height: 35vh;
    min-height: 200px;
  }

  #about .point-content {
    font-size: 0.85rem;
  }

  .btn-about-next svg,
  .btn-about-prev svg {
    width: 24px;
    height: 24px;
  }

  /* Navigation bullets even smaller */
  #about .point-bullet {
    min-width: 24px;
    min-height: 24px;
  }

  #about .point-bullet::before {
    width: 0.5rem;
    height: 0.5rem;
  }

  /* Support page contact cards stack better */
  #support .d-flex.align-items-center {
    flex-direction: column;
    text-align: center;
  }

  #support .m-3 {
    margin: 0.5rem !important;
  }

  #support h5 {
    font-size: 1rem;
  }

  #support a {
    font-size: 0.9rem;
  }
}

/* Improve touch targets on all mobile devices */
@media (max-width: 991px) {
  .point-bullet {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }

  .btn-about-next,
  .btn-about-prev,
  .learn-more-btn {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Better spacing for mobile footer */
  footer .w-100.d-flex {
    font-size: 0.8rem;
    gap: 1rem !important;
  }
}

/* Landscape orientation improvements */
@media (max-width: 991px) and (orientation: landscape) {
  #about .col-lg-8 {
    max-height: 60vh;
  }

  #home {
    padding-top: 3vh;
  }
}

/* Prevent text selection on interactive elements (better mobile UX) */
.point-bullet,
.btn-about-next,
.btn-about-prev,
.learn-more-btn,
.nav-link {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Smooth scrolling for better mobile experience */
html {
  scroll-behavior: smooth;
}

/* Better image loading on mobile */
#about img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Improve navbar on mobile */
@media (max-width: 991px) {
  .navbar {
    padding-top: 1.5rem !important;
    padding-bottom: 1rem;
  }

  .navbar .container {
    padding: 0 1rem;
  }
}

/* Fix for very small mobile screens (iPhone SE, etc) */
@media (max-width: 375px) {
  .about-title-wrapper span {
    font-size: 0.9rem !important;
  }

  #about .btn-black,
  #about .btn-outline-black {
    width: 48%;
    font-size: 0.75rem;
    padding: 0.35rem;
  }

  .navbar-brand img {
    width: 80px !important;
    height: 22px !important;
  }
}
