/* ================================================================== */
/* Header */
/* ================================================================== */
header, footer {
  background-color: rgb(137, 58, 150);
  color: rgb(255, 255, 255);
  padding: 0.5rem;
  text-align: center;
}

header {
  height: 70px; /* IMPORTANT for the fixed header */
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  position: fixed; /* IMPORTANT for the fixed header */
  z-index: 5; /* IMPORTANT for the fixed header */
  border-bottom: 1px solid rgb(255, 255, 255);
}

.logo {
  width: 30%;
  display: flex;
  flex-direction: row;
  justify-content: left;
  align-items: center;
  gap: 0.5rem;
}

.logo img {
  width: 3rem;
  height: auto;
}

.logo div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.logo h4 {
  font-weight: lighter;
}

/* ================================================================== */
/* Navigation */
/* ================================================================== */
nav {
  display: flex;
  background-color: transparent;
  align-items: center;
  gap: 2rem;
}

nav a {
  color: white;
  padding: 14px 20px;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

nav .dropdown {
  position: relative;
  display: inline-block;
}

/* Add dropdown indicator (caret) */
nav .dropdown > a::after {
  content: "▼";
  font-size: 0.7em;
  margin-left: 6px;
  vertical-align: middle;
  transition: transform 0.3s ease;
}

nav .dropdown:hover > a::after {
  transform: rotate(180deg);
}

nav .dropdown-content {
  display: none;
  position: absolute;
  background-color: rgba(137, 58, 150, 0.95); /* Semi-transparent background */
  min-width: unset; /* Remove the fixed min-width */
  white-space: nowrap; /* Prevent text from wrapping */
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
  z-index: 1;
  border-radius: 0 0 8px 8px; /* Rounded corners at bottom */
  overflow: hidden; /* Ensure content respects border radius */

  /* Animation properties */
  transform-origin: top center;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

nav .dropdown-content a {
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
  font-size: 0.85rem;
  color: rgb(255, 255, 255);
  transition: background-color 0.2s ease, padding-left 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav .dropdown-content a:last-child {
  border-bottom: none;
}

nav .dropdown:hover .dropdown-content {
  display: block;
  transform: scaleY(1);
  opacity: 1;
  animation: dropdownFadeIn 0.3s ease forwards;
}

@keyframes dropdownFadeIn {
  0% {
    transform: scaleY(0.7);
    opacity: 0;
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

nav .dropdown:hover > a {
  background-color: rgb(191, 12, 204);
  border-radius: 4px 4px 0 0; /* Rounded corners at top */
}

nav .dropdown-content a:hover {
  background-color: rgb(0, 117, 255);
  color: rgb(255, 255, 255);
  padding-left: 20px; /* Slight indent on hover */
}

/* ================================================================== */
/* Mobile Menu Toggle Button */
/* ================================================================== */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 10px;
  transition: all 0.3s linear;
}

.mobile-menu-toggle.active span:first-child {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:last-child {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ================================================================== */
/* Mobile Navigation Menu */
/* ================================================================== */
.nav-menu {
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  background-color: rgb(137, 58, 150);
  flex-direction: column;
  padding: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 5;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
  display: none; /* Hide on desktop by default */
}

.nav-menu.active {
  max-height: 500px;
  padding: 1rem 0;
}

.mobile-dropdown {
  width: 100%;
  text-align: left;
}

.mobile-dropdown a {
  color: white;
  padding: 12px 20px;
  text-decoration: none;
  display: block;
  font-size: 1rem;
}

.mobile-dropdown-content {
  display: none;
  background-color: rgba(255, 255, 255, 0.1);
  padding-left: 20px;
}

.mobile-dropdown-content a {
  padding: 10px 20px;
  font-size: 0.9rem;
}

.mobile-dropdown:hover .mobile-dropdown-content,
.mobile-dropdown:focus .mobile-dropdown-content,
.mobile-dropdown:active .mobile-dropdown-content {
  display: block;
}

/* ================================================================== */
/* Language switcher */
/* ================================================================== */
.language-selector {
}

.language-selector #language-form {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.language-selector select {
  background-color: transparent;
  color: rgb(255, 255, 255);
  font-weight: bolder;
  direction: rtl;
}

.language-selector select option {
  color: rgb(255, 255, 255);
  background-color: rgb(137, 58, 150);
  font-weight: bolder;
}


.language-selector img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: block;
}

/* ================================================================== */
/* Footer */
/* ================================================================== */
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1em;
  width: 100%;
  background: linear-gradient(
          180deg,
          rgb(137, 58, 150),
          rgb(159, 158, 159)
  );
}

footer a {
  color: rgb(255, 255, 255);
  text-decoration: none;
}

#phone-mail,
#social-media,
#government-logos,
#map {
  width: 100%;
  display: flex;
  align-items: center;
}

#phone-mail {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
}

#phone-mail span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

footer span img {
  width: 1.25rem;
  height: auto;
}

#map {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

#social-media {
  justify-content: center;
}

#social-media a img {
  width: 1.5rem;
  height: auto;
  margin: 0.5rem;
}

#government-logos {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

#government-logos img {
  height: 3.5rem;
  width: auto;
  margin: 0.5rem 0;
  flex-shrink: 1;
}

/* ================================================================== */
/* Media queries */
/* ================================================================== */

/* Desktop WIDE */
/* ================================================================== */
/*@media only screen and (min-width: 1025px) {*/
/*  !* Empty rule for the moment *!*/
/*}*/

/* Tablet portrait mode */
/* ================================================================== */
@media only screen and (min-width: 481px) and (max-width: 775px) {
  /* HEADER */
  /* ---------------------------------- */
  .logo div {
    display: none;
  }

  nav {
    gap: 0.5rem;
  }

  .language-selector {
    /* Keep default row direction */
  }

  .language-selector select {
    /* No order needed */
  }
}

/* Smartphones */
/* ================================================================== */
@media only screen and (max-width: 480px) {
  /* HEADER */
  /* ---------------------------------- */
  header {
    height: 70px; /* Keep the same height as desktop for the header */
    flex-wrap: wrap;
  }

  .logo {
    width: 50%;
  }

  .logo div {
    display: none;
  }

  .logo img {
    width: 4rem;
  }

  /* Hide desktop navigation */
  nav {
    display: none;
  }

  /* Show mobile menu toggle button */
  .mobile-menu-toggle {
    display: flex;
    order: 3;
  }

  /* Mobile menu display */
  .nav-menu.active {
    display: flex;
  }

  /* Adjust language selector */
  .language-selector {
    /* Keep default row direction */
    order: 2;
    width: 30%;
  }

  .language-selector select {
    /* No order needed */
  }

  /* FOOTER */
  /* ---------------------------------- */
  #phone-mail {
    flex-direction: column;
    gap: 0.5em;
  }

  #map {
    flex-direction: column;
    gap: 0.5em;
  }

  #government-logos {
    flex-direction: column;
    gap: 0;
  }
}
