/*=============== CSS VARIABLES ===============*/
:root {
  --header-height: 3.5rem;
  /*========== Colors ==========*/
  --first-color: hsl(220, 68%, 54%);
  --first-color-lighten: hsl(220, 68%, 97%);
  --title-color: hsl(210, 25%, 97%);
  --text-color: hsl(0, 0%, 99%);
  /*========== Font and typography ==========*/
  --body-font: "Poppins", sans-serif;
  --normal-font-size: .938rem;
  --small-font-size: .813rem;
  --smaller-font-size: .75rem;
  /*========== Font weight ==========*/
  --font-medium: 500;
  --font-semi-bold: 600;
}

/*=============== HEADER ===============*/
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: transparent;
  transition: background-color 0.4s, box-shadow 0.4s, backdrop-filter 0.4s;
}

/* Header styles for inner pages */
.inner-page .header {
  background-color: rgba(9, 24, 37, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
  transition: background-color 0.4s, box-shadow 0.4s;
}

/* Header with background on scroll */
.header.scrolled,
.inner-page .header.scrolled {
  background-color: rgba(9, 24, 37, 0.98);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  transition: background-color 0.4s, box-shadow 0.4s, backdrop-filter 0.4s;
}

.nav__data {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  column-gap: 0.25rem;
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  transition: color 0.3s;
}

.nav__logo i {
  font-size: 1.25rem;
}

.nav__logo:hover {
  color: var(--first-color);
}

.nav__toggle {
  position: relative;
  width: 44px;
  height: 44px;
  display: none;
  cursor: pointer;
  z-index: 102;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.nav__toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/*=============== MOBILE NAVIGATION ===============*/
@media screen and (max-width: 1118px) {
  .nav__toggle {
    display: block !important;
    position: relative !important;
    visibility: visible !important;
  }

  .nav__toggle-menu, .nav__toggle-close {
    color: #fff !important;
    font-size: 1.5rem !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
    pointer-events: none !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 102 !important;
    display: block !important;
    visibility: visible !important;
  }

  /* Hide close button by default */
  .nav__toggle-close {
    opacity: 0 !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
    pointer-events: none !important;
  }

  .nav__menu {
    background-color: rgba(9, 24, 37, 0.98);
    position: fixed;
    left: 0;
    top: -100%;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    padding: 5rem 1.5rem 4rem;
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 101;
    backdrop-filter: blur(10px);
    display: block;
  }

  .nav__menu.show-menu {
    top: 0;
    opacity: 1;
    pointer-events: auto;
  }

  .nav__menu::-webkit-scrollbar {
    width: 0.5rem;
  }
  .nav__menu::-webkit-scrollbar-thumb {
    background-color: hsl(220, 12%, 70%);
  }

  .nav__toggle {
    display: block;
    z-index: 101;
    position: relative;
  }

  .nav__list {
    flex-direction: column;
  }

  /* Mobile menu hover effects - override the light hover color */
  .nav__link {
    color: #fff !important;
    background-color: transparent;
    border-bottom: 1px solid rgba(114, 161, 222, 0.2);
    transition: all 0.3s ease;
  }

  .nav__link:hover {
    background-color: rgba(114, 161, 222, 0.25) !important;
    color: #fff !important;
    transform: translateX(10px);
    border-bottom-color: rgba(114, 161, 222, 0.4);
  }

  /*=============== MOBILE DROPDOWN FIXES ===============*/
  .dropdown__container {
    background-color: rgba(9, 24, 37, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(114, 161, 222, 0.2);
    height: 0 !important;
    overflow: hidden !important;
    position: static !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0.5rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: height 0.4s ease, opacity 0.4s ease;
  }

  /* Show dropdown when .show-dropdown class is applied */
  .dropdown__item.show-dropdown .dropdown__container {
    height: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .dropdown__content {
    padding: 1rem;
    row-gap: 1rem;
  }

  .dropdown__group {
    padding-left: 0;
    margin: 0.5rem 0;
  }

  .dropdown__link {
    color: #fff !important;
    padding: 0.75rem 1rem;
    display: block;
    border-radius: 4px;
    transition: all 0.3s ease;
  }

  .dropdown__link:hover {
    color: #72a1de !important;
    background-color: rgba(114, 161, 222, 0.1);
  }

  .dropdown__title {
    color: #fff !important;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(114, 161, 222, 0.2);
  }

  .dropdown__icon {
    background-color: rgba(114, 161, 222, 0.15) !important;
    border: 1px solid rgba(114, 161, 222, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-bottom: 0.5rem;
  }

  .dropdown__arrow {
    transition: transform 0.4s;
  }

  .show-dropdown .dropdown__arrow {
    transform: rotate(180deg);
  }
}

/*=============== NAVIGATION LINKS ===============*/
.nav__link {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s;
}

.nav__link:hover {
  background-color: rgba(114, 161, 222, 0.15);
  color: var(--title-color);
}

/* Show menu - handled in media query above */

/* Show icon */
.show-icon .nav__toggle-menu {
  opacity: 0 !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
}

.show-icon .nav__toggle-close {
  opacity: 1 !important;
  transform: translate(-50%, -50%) rotate(0deg) !important;
  pointer-events: auto !important;
}

/*=============== DROPDOWN ===============*/
.dropdown__button {
  cursor: pointer;
}

.dropdown__arrow {
  font-size: 1.5rem;
  font-weight: initial;
  transition: transform 0.4s;
}

.dropdown__content, .dropdown__group, .dropdown__list {
  display: grid;
}

.dropdown__container {
  background-color: var(--first-color-lighten);
  height: 0;
  overflow: hidden;
  transition: height 0.4s;
}

.dropdown__content {
  row-gap: 1.75rem;
}

.dropdown__group {
  padding-left: 2.5rem;
  row-gap: 0.5rem;
}

.dropdown__group:first-child {
  margin-top: 1.25rem;
}

.dropdown__group:last-child {
  margin-bottom: 1.25rem;
}

.dropdown__icon i {
  font-size: 1.25rem;
  color: var(--first-color);
}

.dropdown__title {
  font-size: var(--small-font-size);
  font-weight: var(--font-semi-bold);
  color: var(--title-color);
}

.dropdown__list {
  row-gap: 0.25rem;
}

.dropdown__link {
  font-size: var(--smaller-font-size);
  font-weight: var(--font-medium);
  color: var(--text-color);
  transition: color 0.3s;
}

.dropdown__link:hover {
  color: var(--title-color);
}

/* Rotate dropdown icon */
.show-dropdown .dropdown__arrow {
  transform: rotate(180deg);
}

/*=============== DESKTOP DROPDOWN STYLES ===============*/
@media screen and (min-width: 1118px) {
  .nav {
    height: calc(var(--header-height) + 2rem);
    display: flex;
    justify-content: space-between;
  }
  .nav__toggle {
    display: none;
  }
  .nav__list {
    display: flex;
    column-gap: 3rem;
    height: 100%;
  }
  .nav li {
    display: flex;
  }
  .nav__link {
    padding: 0;
  }
  .nav__link:hover {
    background-color: initial;
  }

  .dropdown__button {
    column-gap: 0.25rem;
    pointer-events: none;
  }
  .dropdown__container {
    height: max-content;
    position: absolute;
    left: 0;
    background-color: rgba(9, 24, 37, 0.98) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(114, 161, 222, 0.2);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 1rem 0;
    right: 0;
    top: 6.5rem;
    background-color: var(--body-color);
    box-shadow: 0 6px 8px hsla(220, 68%, 12%, 0.05);
    pointer-events: none;
    opacity: 0;
    transition: top 0.4s, opacity 0.3s;
  }
  .dropdown__content {
    grid-template-columns: repeat(4, max-content);
    column-gap: 6rem;
    max-width: 1120px;
    margin-inline: auto;
    padding: 1rem 2rem;
  }
  .dropdown__group {
    padding: 2rem 0;
    align-content: baseline;
    row-gap: 1.25rem;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 1.5rem;
    transition: background-color 0.3s ease;
  }
  .dropdown__group:first-child, .dropdown__group:last-child {
    margin: 0;
  }
  .dropdown__list {
    row-gap: 0.75rem;
  }
  .dropdown__icon {
    width: 60px;
    height: 60px;
    background-color: var(--first-color-lighten);
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
  }
  .dropdown__icon i {
    font-size: 2rem;
  }
  .dropdown__title {
    font-size: var(--normal-font-size);
    color: #fff !important;
    margin-bottom: 1rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(114, 161, 222, 0.2);
  }
  .dropdown__link {
    font-size: var(--small-font-size);
  }
  .dropdown__link:hover {
    color: #72a1de !important;
    background-color: rgba(114, 161, 222, 0.1);
    padding: 0.5rem 1rem;
    margin: 0 -1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
  }
  .dropdown__item {
    cursor: pointer;
  }
  .dropdown__item:hover .dropdown__arrow {
    transform: rotate(180deg);
  }
  .dropdown__item.show-dropdown .dropdown__arrow {
    transform: rotate(180deg);
  }
  .dropdown__item:hover > .dropdown__container {
    top: 5.5rem;
    opacity: 1;
    pointer-events: initial;
    cursor: initial;
  }
  .dropdown__item.show-dropdown > .dropdown__container {
    top: 5.5rem;
    opacity: 1;
    pointer-events: initial;
    cursor: initial;
  }
}

/*=============== LOGO RESPONSIVE STYLES ===============*/
.nav__data > a > img {
  width: 120px;
  max-width: 100%;
  height: auto;
  padding: 5px 0;
}

@media screen and (max-width: 768px) {
  .nav__data > a > img {
    width: 100px;
  }
  
  .nav__data {
    padding: 0 1rem;
  }
}

@media screen and (max-width: 480px) {
  .nav__data > a > img {
    width: 80px;
  }
  
  .nav__data {
    padding: 0 0.75rem;
  }
  
  .nav__toggle {
    width: 40px;
    height: 40px;
  }
  
  .nav__toggle-menu, .nav__toggle-close {
    font-size: 1.25rem;
  }
}

/*=============== SCROLL TO TOP BUTTON ===============*/
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: rgba(114, 161, 222, 0.8);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.scroll-to-top:hover {
  background-color: rgba(114, 161, 222, 1);
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(114, 161, 222, 0.4);
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media screen and (max-width: 768px) {
  .scroll-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
    font-size: 1.25rem;
  }
}
