@import url("./root.css");

header {
  display: flex;
  position: sticky;
  top: 0;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  z-index: 101;
  box-sizing: border-box;
  /* width: 98vw; */
  height: 10vh;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--gradient-bg);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  pointer-events: none;
}

header.scrolled::before {
  opacity: 1;
}

.mobile_menu_container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile_menu a {
  text-decoration: none;
}

#logo_icon {
  width: 120px;
  border-right: 1px solid var(--color-blue-400);
  padding-right: 5%;
  margin-right: 5%;
}

#desktop_menu {
  display: none;
}

.logo_container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50px;
}

#burger_menu {
  width: 25px;
  height: 30px;
  position: relative;
}

#burger_menu span {
  display: block;
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: var(--color-blue-500);
  border-radius: 4px;
  left: 0;
}

.lang_dropdown {
  position: relative;
  display: inline-block;
  font-family: inherit;
}

.lang_btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: inherit;
  font-size: 16px;
  transition: background-color 0.2s;
}

.lang_btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.lang_btn .arrow {
  font-size: 10px;
  margin-left: 4px;
  color: #666;
}

.flag-icon {
  width: 24px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
  background-color: #ddd;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

.lang_menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 8px 0;
  margin: 4px 0 0 0;
  min-width: 140px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.lang_menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang_menu li {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #333;
  font-size: 15px;
  transition: background 0.2s;
}

.lang_menu li:hover {
  background: #f4f4f4;
}

.desktop_lang {
  display: none;
}

.mobile_lang {
  display: inline-block;
}

.mobile_lang > .lang_btn > .lang_name {
  display: none;
}

body.menu-open {
  overflow: hidden;
}

.mobile_menu {
  background: no-repeat var(--gradient-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: fixed;
  width: 95vw;
  height: 90vh;
  padding: 0% 2.5%;
  left: 0;
  transform: translateX(-100%);
  transition: transform 0.8s ease-in-out;
}

.mobile_menu > nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-basis: 60%;
  gap: 6%;
  text-align: center;
}

.mobile_menu > nav > a {
  font-size: 18px;
}

.mobile_menu > nav > button {
  font-size: 18px;
  margin-top: 10%;
}

.contact_info_container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  background-color: var(--color-white);
  margin: 2.5%;
  flex: 1;
  border-radius: 16px;
}

/* Pozycje startowe dwóch linii */
#burger_menu span:nth-child(1) {
  top: 31%;
}
#burger_menu span:nth-child(2) {
  top: 71%;
}

/* ANIMACJE DLA KLASY .open (Zamiana w X) */
#burger_menu.open span:nth-child(1) {
  animation: flyXTop 0.8s forwards ease-in-out;
}
#burger_menu.open span:nth-child(2) {
  animation: flyXBottom 0.8s forwards ease-in-out;
}

/* ANIMACJE DLA KLASY .close (Powrót do burgera) */
#burger_menu.close span:nth-child(1) {
  animation: backBurgerTop 0.8s forwards ease-in-out;
}
#burger_menu.close span:nth-child(2) {
  animation: backBurgerBottom 0.8s forwards ease-in-out;
}

/* ANIMACJA MENU MOBILNE */
.mobile_menu.open {
  display: flex;
  transform: translateX(0);
  visibility: visible;
}

section:not(.mobile_menu) {
  transition: transform 0.8s ease-in-out;
}

section.shifted {
  transform: translateX(100vw);
}

/* --- Animacje w X --- */
@keyframes flyXTop {
  0% {
    top: 30%;
    transform: rotate(0deg);
  }
  40% {
    top: -50%;
    transform: rotate(180deg);
  }
  100% {
    top: 30%;
    transform: rotate(405deg);
  }
}

@keyframes flyXBottom {
  0% {
    top: 70%;
    transform: rotate(0deg);
  }
  40% {
    top: 150%;
    transform: rotate(-180deg);
  }
  100% {
    top: 30%;
    transform: rotate(-405deg);
  }
}

/* --- Animacje powrotne --- */
@keyframes backBurgerTop {
  0% {
    top: 30%;
    transform: rotate(405deg);
  }
  40% {
    top: -50%;
    transform: rotate(180deg);
  }
  100% {
    top: 30%;
    transform: rotate(0deg);
  }
}

@keyframes backBurgerBottom {
  0% {
    top: 30%;
    transform: rotate(-405deg);
  }
  40% {
    top: 150%;
    transform: rotate(-180deg);
  }
  100% {
    top: 70%;
    transform: rotate(0deg);
  }
}

@media screen and (min-width: 1024px) {
  header {
    gap: 20px;
  }

  header::before {
    opacity: 1;
  }

  #burger_menu {
    display: none;
  }

  .mobile_lang {
    display: none;
  }

  .desktop_lang {
    display: inline-block;
  }

  #desktop_menu {
    display: flex;
    align-items: center;
    flex: 4;
    justify-content: space-between;
  }

  #desktop_menu > nav {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .desktop_menu_right {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  #desktop_menu a {
    text-decoration: none;
  }

  #desktop_menu > .contact_btn {
    margin-right: 20px;
  }

  .logo_container {
    justify-content: flex-start;
  }

  #logo_icon {
    width: 240px;
    padding-right: 10px;
    margin-right: 10px;
  }

  #iso_logo {
    width: 50px;
    height: 50px;
  }
}

@media screen and (min-width: 1300px) {
  header::before {
    opacity: 0;
  }

  header {
    padding: 0 25px;
  }
}

@media screen and (min-width: 2000px) {
  header {
    padding: 0 75px;
  }
}
