/* Header Component Styles */

/* The placeholder div should be invisible */
#rand-header {
  display: contents;
}

/* Smooth fade-in animation to prevent blinking */
.rand-header {
  animation: headerFadeIn 1s ease-out;
}

@keyframes headerFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.rand-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #000628;
}

/* Container */
.rand-header__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 992px) {
  .rand-header__container {
    padding: 0 24px;
  }
}

/* Navigation Bar */
.rand-header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: relative;
}

@media (min-width: 992px) {
  .rand-header__nav {
    height: 72px;
  }
}

/* Logo */
.rand-header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.rand-header__logo-img {
  height: 24px;
  width: 126px;
  object-fit: contain;
}

/* Desktop Navigation - Centered */
.rand-header__desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
}

@media (min-width: 992px) {
  .rand-header__desktop-nav {
    display: flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Language Desktop - Right aligned */
.rand-header__lang-desktop {
  display: none;
}

@media (min-width: 992px) {
  .rand-header__lang-desktop {
    display: flex;
    align-items: center;
  }
}

/* Globe icon */
.rand-header__globe {
  flex-shrink: 0;
}

/* Nav Links */
.rand-header__nav-link {
  display: flex;
  align-items: center;
  padding: 4px 12px;
  color: #bec7d5;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.2s ease;
}

.rand-header__nav-link:hover {
  color: #ffffff;
}

/* Nav Buttons (Dropdowns) */
.rand-header__nav-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  color: #bec7d5;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.rand-header__nav-btn:hover {
  color: #ffffff;
}

.rand-header__chevron {
  transition: transform 0.2s ease;
}

.rand-header__dropdown.is-open .rand-header__chevron {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.rand-header__dropdown {
  position: relative;
}

.rand-header__dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  padding: 12px;
  background-color: #000628;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.rand-header__dropdown.is-open .rand-header__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.rand-header__dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: #bec7d5;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 6px;
  transition: color 0.2s ease;
}

.rand-header__dropdown-item:hover {
  color: #ffffff;
}

/* Language Dropdown */
.rand-header__dropdown--lang {
  /* Right-aligned via parent */
}

.rand-header__lang-btn {
  gap: 6px;
}

.rand-header__dropdown-menu--lang {
  right: 0;
  left: auto;
}

.rand-header__lang-item {
  gap: 6px;
}

.rand-header__lang-item--active {
  color: #ffffff;
}

.rand-header__lang-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Mobile Menu Button */
.rand-header__mobile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #ffffff;
}

@media (min-width: 992px) {
  .rand-header__mobile-btn {
    display: none;
  }
}

.rand-header__close-icon {
  display: none;
}

.rand-header.mobile-menu-open .rand-header__menu-icon {
  display: none;
}

.rand-header.mobile-menu-open .rand-header__close-icon {
  display: block;
}

/* Mobile Menu Overlay */
.rand-header__mobile-menu {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #000628;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow-y: auto;
}

.rand-header.mobile-menu-open .rand-header__mobile-menu {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 992px) {
  .rand-header__mobile-menu {
    display: none;
  }
}

.rand-header__mobile-menu-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  padding-bottom: 120px;
}

/* Mobile Navigation */
.rand-header__mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rand-header__mobile-link {
  display: block;
  padding: 8px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.rand-header__mobile-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Mobile Language Section */
.rand-header__mobile-lang {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rand-header__mobile-lang-label {
  padding: 8px;
  color: #bec7d5;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 1.96px;
  text-transform: uppercase;
}

.rand-header__mobile-lang-link {
  display: block;
  padding: 8px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.rand-header__mobile-lang-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Active language */
.rand-header__mobile-lang-link--active {
  color: #bec7d5;
}

/* Mobile CTA Button - Always visible on mobile with fade-in */
.rand-header__mobile-cta {
  position: fixed;
  bottom: 24px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 8px 24px;
  background-color: #2c52f5;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.5s ease;
  z-index: 1001;
  animation: ctaFadeIn 1s ease-out;
}

@keyframes ctaFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rand-header__mobile-cta:hover {
  background-color: #1e3fd4;
}

@media (min-width: 992px) {
  .rand-header__mobile-cta {
    display: none;
  }
}

/* Hide old navbar when new header is present */
#rand-header + .navbar,
#rand-header ~ .navbar {
  display: none !important;
}

/* Hide old fixed mobile buttons when new header is present */
#rand-header ~ .div-static-button {
  display: none !important;
}
