/* ----------------------------- */
/* Custom Fonts */

/* IBM Plex Sans - English / Latin */
@font-face {
  font-family: "IBMPlexSans";
  src: url("../assets/fonts/IBMPlexSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "IBMPlexSans";
  src: url("../assets/fonts/IBMPlexSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

/* IBM Plex Sans Arabic */
@font-face {
  font-family: "IBMPlexSansArabic";
  src: url("../assets/fonts/IBMPlexSansArabic-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "IBMPlexSansArabic";
  src: url("../assets/fonts/IBMPlexSansArabic-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

/* ----------------------------- */
/* Apply fonts globally to all elements */
body,
html,
nav,
header,
footer,
button,
select,
option,
input,
textarea,
.off-screen-menu,
.language-switcher,
a,
p,
span,
li {
  font-family: "IBMPlexSansArabic", "IBMPlexSans", "Whitney", sans-serif;
}

/* Optional: Headings use Whitney */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Whitney", sans-serif;
}

/* Base styles */
body {
  background-color: rgb(127, 127, 127);
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Ensures full viewport height */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
  text-decoration: none;
  user-select: none; /* Prevent text selection */
}

a {
  color: white;
  transition: color 0.3s ease;
  user-select: none; /* Prevent link text selection */
  -webkit-user-drag: none; /* Prevent link dragging */
}

a:visited {
  color: rgb(0, 0, 0);
}

a:hover {
  color: #181818;
}

img {
  user-select: none; /* Prevent image selection */
  -webkit-user-drag: none; /* Prevent image dragging */
}

/* Off-screen-menu */
.off-screen-menu {
  background-color: rgb(115, 115, 115);
  height: 100vh;
  width: 100%;
  max-width: 450px;
  position: fixed;
  top: 0;
  right: -450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 3rem;
  transition: 0.3s ease;
  z-index: 10; /* Set z-index for the menu to ensure it's above footer */
}

.off-screen-menu.active {
  right: 0;
}

/* Navigation */
nav {
  padding: 1rem;
  display: flex;
  background-color: rgb(115, 115, 115);
}
/* Navbar layout */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px; /* space between language selector and hamburger */
  position: relative; /* to stack child elements properly */
}

.language-switcher {
  margin: 0;
  position: relative;
  z-index: 1000; /* ensures it stays on top of off-screen menu */
}

.ham-menu {
  position: relative;
  z-index: 900; /* lower than the selector */
}

/* Hamburger menu */
.ham-menu {
  height: 50px;
  width: 40px;
  margin-left: auto;
  position: relative;
  z-index: 11; /* Ensure hamburger is above footer */
}

.ham-menu span {
  height: 5px;
  width: 100%;
  background-color: #ffffff;
  border-radius: 25px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: 0.3s ease;
}

.ham-menu span:nth-child(1) {
  top: 25%;
}

.ham-menu span:nth-child(3) {
  top: 75%;
}

.ham-menu.active span {
  background-color: white;
}

.ham-menu.active span:nth-child(1) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

.ham-menu.active span:nth-child(2) {
  opacity: 0;
}

.ham-menu.active span:nth-child(3) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Icon with Text Animation */
.icon-container {
  position: relative;
  display: flex;
  align-items: center;
  margin: 1px;
  cursor: pointer;
  overflow: hidden;
  user-select: none; /* Prevent text selection in icon-container */
}

.icon {
  width: 50px;
  height: auto;
  transition: transform 0.3s ease;
  -webkit-user-drag: none; /* Prevent icon dragging */
}

.text {
  margin-left: 2px;
  transform: translateX(-100%); /* Hide text initially */
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.icon-container:hover .text {
  transform: translateX(0);
  opacity: 1; /* Show text on hover */
}

img {
  position: relative;
  z-index: 1; /* Keep the image on top */
}

/* Footer Styles */
footer {
  margin-top: auto; /* Ensures footer stays at the bottom */
  background-color: #363636;
  color: white; /* Ensure all text is white */
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
  z-index: 5; /* Ensure footer is below the hamburger menu */
  position: relative; /* To apply z-index properly */
}

footer a {
  color: white; /* Make links white by default */
  font-weight: bold;
  transition: color 0.3s ease;
  user-select: none; /* Prevent link text selection */
  -webkit-user-drag: none; /* Prevent link dragging */
}

footer a:visited {
  color: white; /* Keep visited links white */
}

footer a:hover {
  color: #007bff; /* Hover effect with a blue color */
}

footer p {
  margin: 0.5rem 0;
  color: white; /* Ensure paragraphs are white */
  user-select: none; /* Prevent text selection */
}

footer p:last-child {
  margin-top: 1rem;
  font-size: 0.85rem;
  opacity: 0.8; /* Subtle emphasis for the last line */
  color: white; /* Ensure this text is white as well */
}

/* Language Selector Wrapper */
.language-switcher {
  position: relative;
  display: inline-block;
  font-family: inherit; /* inherit global fonts */
  z-index: 1000;
}

/* Button styled like fullscreen button */
.lang-btn {
  background-color: rgb(115, 115, 115);
  color: white;
  border: 2px solid white;
  border-radius: 8px; /* full rounded corners by default */
  padding: 7px 12px; /* slightly smaller than hamburger */
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    background 0.3s,
    color 0.3s,
    border-radius 0.3s;
  min-width: 70px;
  width: auto;
}

/* Remove bottom corners when dropdown is open */
.language-switcher.open .lang-btn {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none; /* merges with dropdown */
}

/* Arrow inside button */
.lang-btn .arrow {
  font-size: 10px;
  margin-left: 4px;
  transition: transform 0.3s;
}

/* Hover effect on button */
.lang-btn:hover {
  background-color: white;
  color: black;
}

/* Dropdown menu attached to button with slide animation */
.lang-options {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  width: 100%;
  background-color: rgb(115, 115, 115);
  border: 2px solid white;
  border-top: none;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000;

  /* Slide animation */
  max-height: 0;
  transform: translateY(-10px);
  visibility: hidden; /* hide completely when closed */
  pointer-events: none; /* prevent clicks when closed */
  transition:
    max-height 0.3s ease,
    transform 0.3s ease,
    visibility 0s 0.3s;
}

.language-switcher.open .lang-options {
  max-height: 500px; /* enough to fit all options */
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition:
    max-height 0.3s ease,
    transform 0.3s ease,
    visibility 0s 0s;
}

/* Dropdown items */
.lang-options li {
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.2s,
    color 0.2s;
  font-size: 14px;
  color: white;
}

.lang-options li:hover {
  background-color: white;
  color: black;
}
