/*  ------------ header nav ----------- */
header {
  width: 1140px;
  max-width: 80%;
  margin: auto;
  height: 50px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 100;
}

nav {
  position: relative;
  top: 20px;
  left: 0;
  width: 100%;
  height: 100%;
  height: 70px;

  z-index: 99;
}
nav .navbar {
  height: 100%;
  max-width: 1250px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: auto;
  padding: 0 50px;
}
.navbar .logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.navbar .logo img {
  vertical-align: middle;
  width: 70px;
  height: auto;
}

.sidebar-logo img {
  vertical-align: middle;
  width: 70px;
  height: auto;
}
nav .navbar .nav-links {
  line-height: 70px;
  height: 100%;
}

nav .navbar .links {
  display: flex;
}

nav .navbar .links li {
  position: relative;
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0 14px;
}

nav .navbar .links li a {
  height: 100%;
  text-decoration: none;
  white-space: nowrap;
  color: #fff;
  transition: var(--transition);
  font-size: 15px;
  font-weight: 500;
}

nav .navbar .links li a:hover,
nav .navbar .links li a.active {
  color: var(--primary-color);
}

/* Arrow Styling - All Levels */
nav .navbar .links li .arrow {
  height: 100%;
  width: 22px;
  line-height: inherit;
  text-align: center;
  display: inline-block;
  color: #fff;
  transition: all 0.3s ease;
  transform: rotate(0deg);
}

.navbar .links li .sub-menu .more-arrow,
.navbar .links li .sub-menu .more-more-arrow {
  height: 100%;
  width: 22px;
  line-height: inherit;
  text-align: center;
  display: inline-block;
  color: var(--text-color);
  transition: all 0.3s ease;
  transform: rotate(0deg);
}

html[dir="rtl"] .navbar .links li .sub-menu .more-arrow,
html[dir="rtl"] .navbar .links li .sub-menu .more-more-arrow {
  transform: rotate(180deg);
}
/* First Level Arrow */
.links li:hover .first-arrow {
  transform: rotate(90deg);
}

/* Second Level Arrow */
.links li .sub-menu .more:hover .more-arrow {
  transform: rotate(90deg);
}

html[dir="rtl"] .links li .sub-menu .more:hover .more-arrow {
  transform: rotate(90deg);
}

/* Third Level Arrow */
.links li .sub-menu .more-more:hover .more-more-arrow {
  transform: rotate(90deg);
}

html[dir="rtl"] .links li .sub-menu .more-more:hover .more-more-arrow {
  transform: rotate(90deg);
}

/* Arrow Hover Effects for All Levels */
.links li .arrow:hover,
.links li .sub-menu .more-arrow:hover,
.links li .sub-menu .more-more-arrow:hover {
  color: var(--primary-color);
}

/* Common Submenu Styles */
nav .navbar .links li .sub-menu,
.navbar .links li .sub-menu .more-sub-menu,
.navbar .links li .sub-menu .more-sub-sub-menu {
  position: absolute;
  background: var(--background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 0 0 4px 4px;
  display: none;
  z-index: 2;
  transition: all 0.3s ease;
  min-width: 180px;
}

/* First Level Submenu */
nav .navbar .links li .sub-menu {
  top: 70px;
  left: 0;
  line-height: 40px;
}

nav .navbar .links li:hover .more-menu,
nav .navbar .links li:hover .js-sub-menu {
  display: block;
}

/* Second Level Submenu */
.navbar .links li .sub-menu .more-sub-menu {
  top: 0;
  left: 100%;
  border-radius: 0 4px 4px 4px;
}

/* Third Level Submenu */
.navbar .links li .sub-menu .more-sub-sub-menu {
  top: 0;
  left: 100%;
  border-radius: 0 4px 4px 4px;
}

/* Adjust submenu positioning for RTL layout */
html[dir="rtl"] .navbar .links li .sub-menu .more-sub-menu,
html[dir="rtl"] .navbar .links li .sub-menu .more-sub-sub-menu {
  left: auto;
  right: 100%;
  border-radius: 4px 0 4px 4px;
}

/* Show Submenus on Hover */
.links li .sub-menu .more:hover .more-sub-menu,
.links li .sub-menu .more-more:hover .more-sub-sub-menu {
  display: block;
}

/* Submenu Items Styling */
.navbar .links li .sub-menu li {
  padding: 0 22px;
  border-bottom: 1px solid var(--border-color);
}

.navbar .links li .sub-menu a {
  color: var(--text-color);
  font-size: 15px;
  font-weight: 500;
  display: block;
  padding: 8px 0;
}

.navbar .links li .sub-menu a:hover,
.navbar .links li .sub-menu a.active {
  color: var(--primary-color);
}

/* Span container for all menu levels */
.navbar .links li span,
.navbar .links li .sub-menu li span,
.navbar .links li .sub-menu .more-sub-menu li span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

/* Arrow alignment for all levels */
.navbar .links li .arrow,
.navbar .links li .sub-menu .more-arrow,
.navbar .links li .sub-menu .more-more-arrow {
  line-height: inherit;
  height: 40px;
  display: flex;
  align-items: center;
}

/* Added hover effect for menu items */
.navbar .links li:hover {
  background-color: rgba(var(--primary-color-rgb), 0.05);
}

/* Main level arrow alignment */
nav .navbar .links > li > span {
  display: flex;
  align-items: center;
}

/* search-box */
.navbar .search-box {
  position: relative;
  height: 40px;
  width: 40px;
}
.navbar .search-box i {
  position: absolute;
  height: 100%;
  width: 100%;
  line-height: 40px;
  text-align: center;
  font-size: 22px;
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
.navbar .search-box .input-box {
  position: absolute;
  right: calc(100% - 40px);
  top: 80px;
  height: 60px;
  width: 300px;
  background: var(--background);
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
}
.navbar.showInput .search-box .input-box {
  top: 65px;
  opacity: 1;
  pointer-events: auto;
  background: var(--background);
}
.search-box .input-box::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  background: var(--background);
  right: 10px;
  top: -6px;
  transform: rotate(45deg);
}
.search-box .input-box input {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 4px;
  transform: translate(-50%, -50%);
  height: 35px;
  width: 280px;
  outline: none;
  padding: 0 15px;
  font-size: 16px;
  border: none;
}
.navbar .nav-links .sidebar-logo {
  display: none;
}
.navbar .bx-menu {
  display: none;
}
@media (max-width: 920px) {
  header {
    max-width: 100%;
    padding: 0 10px;
  }
  nav .navbar {
    max-width: 100%;
    padding: 0;
  }

  nav .navbar .logo a {
    font-size: 27px;
  }
  nav .navbar .links li {
    padding: 0 10px;
    white-space: nowrap;
  }
  nav .navbar .links li a {
    font-size: 15px;
    color: var(--text-color);
  }
  nav .navbar .links li .arrow {
    color: var(--text-color);
  }
}
@media (max-width: 768px) {
  .navbar .bx-menu {
    display: block;
  }
  nav .navbar .nav-links {
    position: fixed;
    top: 0;
    left: -100%;
    display: block;
    max-width: 270px;
    width: 100%;
    background: var(--background);
    line-height: 40px;
    padding: 20px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.5s ease;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
    z-index: 1000;
  }
  .navbar .nav-links .sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar-logo .logo-name {
    font-size: 25px;
    color: var(--text-color);
  }
  .sidebar-logo i {
    font-size: 25px;
    color: var(--text-color);
  }
  .navbar .bx-menu {
    font-size: 25px;
    color: white;
  }
  nav .navbar .links {
    display: block;
    margin-top: 20px;
  }

  /* Adjust submenu positioning for RTL layout */
  html[dir="rtl"] .navbar .links li .sub-menu .more-sub-menu,
  html[dir="rtl"] .navbar .links li .sub-menu .more-sub-sub-menu {
    left: auto;
    right: 0;
    border-radius: 4px 0 4px 4px;
  }

  nav .navbar .links li {
    display: block;
    position: relative;
  }

  /* Common Submenu Styles */
  nav .navbar .links li .sub-menu,
  .navbar .links li .sub-menu .more-sub-menu,
  .navbar .links li .sub-menu .more-sub-sub-menu {
    position: relative;
    top: 0;
    box-shadow: none;
    display: none;
    left: 0;
  }

  .navbar .links li .sub-menu.active,
  .navbar .links li .sub-menu .more-sub-menu.active,
  .navbar .links li .sub-menu .more-sub-sub-menu.active {
    display: block;
  }

  .navbar .links li .arrow {
    cursor: pointer;
    padding-left: 5px;
  }
}

@media (max-width: 370px) {
  nav .navbar .nav-links {
    max-width: 100%;
  }

  html[dir="rtl"] .navbar .links li .sub-menu .more-sub-menu,
  html[dir="rtl"] .navbar .links li .sub-menu .more-sub-sub-menu {
    left: auto;
    right: 0;
    border-radius: 4px 0 4px 4px;
  }
}
/* ------------------------------ */
/* toggles */
.toggles {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Theme Toggle in Navigation */
.theme-toggle-nav {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
}
.theme-toggle-nav:hover {
  color: var(--primary-color);
}
.theme-toggle-nav i {
  font-size: 1.2rem;
}

/* Language Toggle Container */
.language-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
}
.switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 34px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.sliderLanguage {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--primary-color);
  border-radius: 34px;
  transition: 0.4s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  font-size: 0.9rem;
}
.language-text {
  text-decoration: none;
  color: var(--text-color);
  font-weight: bold;
  pointer-events: none;
}
.language-text.en {
  pointer-events: auto;
}
.language-text.ar {
  pointer-events: auto;
}
input:checked + .sliderLanguage .language-text.en {
  pointer-events: none;
}
input:checked + .sliderLanguage .language-text.ar {
  pointer-events: auto;
}
.sliderLanguage a:hover {
  text-decoration: underline;
}
.sliderLanguage:before {
  position: absolute;
  content: "";
  height: 28px;
  width: 28px;
  left: 4px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}
input:checked + .sliderLanguage {
  background-color: var(--primary-color);
}
input:checked + .sliderLanguage:before {
  transform: translateX(45px);
}
@media (max-width: 480px) {
  .switch {
    width: 60px;
    height: 26px;
  }
  .sliderLanguage {
    font-size: 0.8rem;
    padding: 0 8px;
  }
  .sliderLanguage:before {
    height: 22px;
    width: 22px;
    bottom: 2px;
    left: 3px;
  }
  input:checked + .sliderLanguage:before {
    transform: translateX(32px);
  }
}

@media (max-width: 768px) {
  .switch {
    width: 70px;
    height: 30px;
  }
  .sliderLanguage {
    font-size: 0.85rem;
    padding: 0 9px;
  }
  .sliderLanguage:before {
    height: 25px;
    width: 25px;
    bottom: 3px;
    left: 4px;
  }
  input:checked + .sliderLanguage:before {
    transform: translateX(38px);
  }
}

@media (min-width: 992px) {
  .switch {
    width: 80px;
    height: 34px;
  }
  .sliderLanguage {
    font-size: 0.9rem;
  }
  .sliderLanguage:before {
    height: 28px;
    width: 28px;
  }
  input:checked + .sliderLanguage:before {
    transform: translateX(45px);
  }
}

/*search */
.openBtn {
  background: none;
  border: none;
  padding: 10px 15px;
  font-size: 20px;
  cursor: pointer;
  color: #fff;
}
.openBtn:hover {
  color: var(--primary-color);
}
.overlay {
  height: 100%;
  width: 100%;
  display: none;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: rgb(0, 0, 0);
  background-color: rgba(0, 0, 0, 0.9);
}
.overlay-content {
  position: relative;
  top: 46%;
  width: 80%;
  text-align: center;
  margin-top: 30px;
  margin: auto;
}
.overlay .closebtn {
  position: absolute;
  top: 20px;
  right: 45px;
  font-size: 60px;
  cursor: pointer;
  color: white;
}
.overlay .closebtn:hover {
  color: #ccc;
}
.overlay input[type="text"] {
  padding: 15px;
  font-size: 17px;
  border: none;
  float: left;
  width: 80%;
  background: white;
}
.overlay input[type="text"]:hover {
  background: #f1f1f1;
}
.overlay button {
  float: left;
  width: 20%;
  padding: 15px;
  background: #ddd;
  font-size: 17px;
  border: none;
  cursor: pointer;
}
.overlay button:hover {
  background: #bbb;
}

.cta-buttons a {
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
}
.cta-buttons a[dir="rtl"] {
  font-family: "Almarai", "Arial", sans-serif;
}
/* ***************************************************** */
/* carousel */
.carousel {
  height: 100vh;
  margin-top: -50px;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

.carousel .list .item {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  opacity: 0; /* Hide all slides initially */
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s;
}
.carousel .list .item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel .list .item::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.8); /* Semi-transparent black overlay */
  z-index: 1;
}

.carousel .list .item .content {
  position: absolute;
  top: 20%;
  width: 1140px;
  max-width: 80%;
  left: 50%;
  transform: translateX(-50%);
  padding-right: 30%;
  box-sizing: border-box;
  color: #fff;
  text-shadow: 0 5px 10px #0004;
  z-index: 2;
}
.carousel .list .item .author {
  font-weight: bold;
  letter-spacing: 10px;
}
.carousel .list .item .title,
.carousel .list .item .topic {
  font-size: 4.3em;
  font-weight: bold;
  line-height: 1.3em;
}
.carousel .list .item .topic {
  color: #f1683a;
}

/* Laptop (1024px and below) */
@media (max-width: 1024px) {
  .carousel .list .item .content {
    max-width: 90%;
    padding-right: 20%;
  }

  .carousel .list .item .title,
  .carousel .list .item .topic {
    font-size: 3.6em;
  }
}

/* Tablet (768px and below) */
@media (max-width: 768px) {
  .carousel .list .item .content {
    max-width: 95%;
    padding: 0 10%;
  }

  .carousel .list .item .title,
  .carousel .list .item .topic {
    font-size: 3em;
  }

  .carousel .list .item .author {
    letter-spacing: 5px;
  }
}

/* Phone (480px and below) */
@media (max-width: 480px) {
  .carousel .list .item .content {
    max-width: 100%;
    padding: 0 5%;
  }

  .carousel .list .item .title,
  .carousel .list .item .topic {
    font-size: 2em;
  }

  .carousel .list .item .author {
    letter-spacing: 2px;
  }

  .content .cta-buttons .btn {
    width: 40%;
  }
  .cta-buttons a {
    padding: 0.7rem 1rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 375px) {
  .cta-buttons {
    display: flex;
    flex-direction: column;
  }
  .cta-buttons a {
    padding: 0.3rem 1rem;
    font-size: 0.75rem;
  }
}
/* thumbail */
.thumbnail {
  position: absolute;
  bottom: 50px;
  left: 50%;
  width: max-content;
  z-index: 10;
  display: flex;
  gap: 20px;
}
.thumbnail .item {
  width: 150px;
  height: 220px;
  flex-shrink: 0;
  position: relative;
}
.thumbnail .item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}
.thumbnail .item .content {
  color: #f1683a;
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
}
.thumbnail .item .content .title {
  font-weight: 600;
}

/* arrows */
.arrows {
  position: absolute;
  top: 83%;
  right: 56%;
  z-index: 99;
  width: 300px;
  max-width: 30%;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}
.arrows button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #eee4;
  border: none;
  color: #fff;
  font-family: monospace;
  font-weight: bold;
  transition: 0.5s;
}
.arrows button:hover {
  background-color: #fff;
  color: #000;
}

/* animation */
.carousel .list .item:nth-child(1) {
  z-index: 3;
  opacity: 1; /* Ensure the first slide is visible initially */
  visibility: visible;
}

/* animation text in first item */

.carousel .list .item:nth-child(1) .content .author,
.carousel .list .item:nth-child(1) .content .title,
.carousel .list .item:nth-child(1) .content .topic,
.carousel .list .item:nth-child(1) .content .des,
.carousel .list .item:nth-child(1) .content .cta-buttons {
  transform: translateY(50px);
  filter: blur(20px);
  opacity: 0;
  animation: showContent 0.5s 1s linear 1 forwards;
}
@keyframes showContent {
  to {
    transform: translateY(0px);
    filter: blur(0px);
    opacity: 1;
  }
}
.carousel .list .item:nth-child(1) .content .title {
  animation-delay: 1.2s !important;
}
.carousel .list .item:nth-child(1) .content .topic {
  animation-delay: 1.4s !important;
}
.carousel .list .item:nth-child(1) .content .des {
  animation-delay: 1.6s !important;
}
.carousel .list .item:nth-child(1) .content .cta-buttons {
  animation-delay: 1.8s !important;
}
/* create animation when next click */
.carousel.next .list .item:nth-child(1) img {
  width: 150px;
  height: 220px;
  position: absolute;
  bottom: 50px;
  left: 50%;
  border-radius: 30px;
  animation: showImage 0.5s linear 1 forwards;
}
@keyframes showImage {
  to {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

.carousel.next .thumbnail .item:nth-last-child(1) {
  overflow: hidden;
  animation: showThumbnail 0.5s linear 1 forwards;
}
.carousel.prev .list .item img {
  z-index: 100;
}
@keyframes showThumbnail {
  from {
    width: 0;
    opacity: 0;
  }
}
.carousel.next .thumbnail {
  animation: effectNext 0.5s linear 1 forwards;
}

@keyframes effectNext {
  from {
    transform: translateX(150px);
  }
}

/* running time */

.carousel .time {
  position: absolute;
  z-index: 1000;
  width: 0%;
  height: 3px;
  background-color: #f1683a;
  left: 0;
  top: 0;
}

.carousel.next .time,
.carousel.prev .time {
  animation: runningTime 3s linear 1 forwards;
}
@keyframes runningTime {
  from {
    width: 100%;
  }
  to {
    width: 0;
  }
}

/* prev click */

.carousel.prev .list .item:nth-child(2) {
  z-index: 2;
}

.carousel.prev .list .item:nth-child(2) img {
  animation: outFrame 0.5s linear 1 forwards;
  position: absolute;
  bottom: 0;
  left: 0;
}
@keyframes outFrame {
  to {
    width: 150px;
    height: 220px;
    bottom: 50px;
    left: 50%;
    border-radius: 20px;
  }
}

.carousel.prev .thumbnail .item:nth-child(1) {
  overflow: hidden;
  opacity: 0;
  animation: showThumbnail 0.5s linear 1 forwards;
}
.carousel.next .arrows button,
.carousel.prev .arrows button {
  pointer-events: none;
}
.carousel.prev .list .item:nth-child(2) .content .author,
.carousel.prev .list .item:nth-child(2) .content .title,
.carousel.prev .list .item:nth-child(2) .content .topic,
.carousel.prev .list .item:nth-child(2) .content .des,
.carousel.prev .list .item:nth-child(2) .content .cta-buttons {
  animation: contentOut 1.5s linear 1 forwards !important;
}

@keyframes contentOut {
  to {
    transform: translateY(-150px);
    filter: blur(20px);
    opacity: 0;
  }
}
