/* Header */
.main-header {
  padding: 0.7rem 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgb(29 39 61);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-text {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--color-accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.logo img {
  width: 200px;
}

.main-header .logo img {
  transition: width 0.3s ease;
}

.main-header.sticky .logo img {
  width: 180px !important;
}

.main-nav ul {
  display: flex;
  gap: 0.5rem;
}


/* .mobile-only-nav removed */

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-white);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001;
}

/* Full Desktop Nav Styles */
@media (min-width: 1280px) {
  .main-nav a {
    position: relative;
    padding: 10px 20px;
    margin: 0px 1px;
  }

  .main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent-gold);
    transition: width 0.3s ease;
  }

  .main-nav a:hover,
  .main-nav a:hover::after,
  .main-nav a.active-link,
  .main-nav a.active-link::after {
    width: 100%;
    color: var(--color-accent-gold);
  }

  .main-nav a:focus-visible {
    outline: 2px solid var(--color-accent-gold);
    outline-offset: 4px;
    border-radius: 4px;
    color: var(--color-accent-gold);
  }

  /* .mobile-only-item removed */
  .mobile-only-item {
    display: none;
  }
}

@keyframes slideUpFade {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideRightFade {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Logo Animation (Up from bottom) */
.main-header .logo {
  opacity: 0;
  animation: slideUpFade 0.6s ease-out forwards;
  animation-delay: 0.2s;
}

/* Menu Animation (Left to Right Staggered) */
.main-nav li {
  opacity: 0;
  /* Initially hidden */
  animation: slideRightFade 0.5s ease-out forwards;
  /* Delays set below */
}

.main-nav li:nth-child(1) {
  animation-delay: 0.4s;
}

.main-nav li:nth-child(2) {
  animation-delay: 0.45s;
}

.main-nav li:nth-child(3) {
  animation-delay: 0.5s;
}

.main-nav li:nth-child(4) {
  animation-delay: 0.55s;
}

.main-nav li:nth-child(5) {
  animation-delay: 0.6s;
}

.main-nav li:nth-child(6) {
  animation-delay: 0.65s;
}

.main-nav li:nth-child(7) {
  animation-delay: 0.7s;
}

.main-nav li:nth-child(8) {
  animation-delay: 0.75s;
}

.main-nav li:nth-child(9) {
  animation-delay: 0.8s;
}

/* Header Actions Animation (Left to Right after Menu) */
.header-actions a {
  opacity: 0;
  animation: slideRightFade 0.5s ease-out forwards;
}

.header-actions a:nth-child(1) {
  animation-delay: 0.9s;
}

.header-actions a:nth-child(2) {
  animation-delay: 1.0s;
}

/* Header Actions Icons */
.icon-link {
  font-size: 1.2rem;
  color: var(--color-text-white);
  transition: color 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.icon-link:hover {
  color: var(--color-accent-gold);
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Responsive Design */
@media (max-width: 1279px) {

  /* Navigation */
  .main-header .logo img {
    width: 160px;
  }

  .main-header.sticky .logo img {
    width: 140px !important;
  }

  .main-header .btn-primary {
    display: none;
  }

  .mobile-only-nav {
    display: block;
  }

  .mobile-only-item {
    display: block;
  }

  .header-actions {
    display: none;
  }

  .mobile-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
  }

  .menu-dots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 24px;
    height: 24px;
    transition: transform 0.4s ease;
  }

  .menu-dots span {
    width: 4px;
    height: 4px;
    background-color: var(--color-text-white);
    border-radius: 50%;
    transition: all 0.4s ease;
  }

  /* Hover Effect */
  .mobile-toggle:hover .menu-dots span {
    background-color: var(--color-accent-gold);
  }

  /* Open State - Transform to X */
  .mobile-toggle.open .menu-dots {
    transform: rotate(45deg);
  }

  /* Center dot stays */
  .mobile-toggle.open .menu-dots span:nth-child(5) {
    background-color: var(--color-accent-gold);
    transform: scale(1.2);
  }

  /* Form the X shape */
  /* Top Left, Top Right, Bottom Left, Bottom Right remain visible */
  .mobile-toggle.open .menu-dots span:nth-child(1),
  .mobile-toggle.open .menu-dots span:nth-child(3),
  .mobile-toggle.open .menu-dots span:nth-child(7),
  .mobile-toggle.open .menu-dots span:nth-child(9) {
    background-color: var(--color-accent-gold);
  }

  /* Adjust positions to form perfect cross if needed, but grid rotation handles most of it. 
     To make it cleaner, we can hide the others */
  .mobile-toggle.open .menu-dots span:nth-child(2),
  .mobile-toggle.open .menu-dots span:nth-child(4),
  .mobile-toggle.open .menu-dots span:nth-child(6),
  .mobile-toggle.open .menu-dots span:nth-child(8) {
    opacity: 0;
    transform: scale(0);
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 90%;
    height: 100vh;
    background: rgba(5, 10, 20, 0.98);
    backdrop-filter: blur(15px);
    padding: 6rem 2rem;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
  }

  .mobile-toggle {
    transition: transform 0.4s ease;
  }

  .mobile-toggle.open {
    transform: rotate(180deg);
  }

  @keyframes fallOut {
    from {
      opacity: 0;
      transform: translateY(-20px) translateX(20px);
    }

    to {
      opacity: 1;
      transform: translateY(0) translateX(0);
    }
  }

  .main-nav.active {
    right: 0;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  .main-nav ul li,
  .mobile-only-nav {
    opacity: 0;
  }

  .main-nav.active ul li,
  .main-nav.active .mobile-only-nav {
    animation: fallOut 0.5s ease forwards;
  }

  .main-nav.active ul li:nth-child(1) {
    animation-delay: 0.1s;
  }

  .main-nav.active ul li:nth-child(2) {
    animation-delay: 0.2s;
  }

  .main-nav.active ul li:nth-child(3) {
    animation-delay: 0.3s;
  }

  .main-nav.active ul li:nth-child(4) {
    animation-delay: 0.4s;
  }

  .main-nav.active ul li:nth-child(5) {
    animation-delay: 0.5s;
  }

  .main-nav.active ul li:nth-child(6) {
    animation-delay: 0.6s;
  }

  .main-nav.active ul li:nth-child(7) {
    animation-delay: 0.7s;
  }

  .main-nav.active ul li:nth-child(8) {
    animation-delay: 0.8s;
  }

  .main-nav.active ul li:nth-child(9) {
    animation-delay: 0.9s;
  }

  .main-nav.active .mobile-only-nav {
    animation-delay: 1.0s;
  }

  .main-nav a {
    font-size: var(--fs-md);
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.8rem 0;
    color: var(--color-text-gray);
    transition: all 0.3s ease;
  }

  .main-nav a:hover,
  .main-nav a.active-link {
    color: var(--color-accent-gold);
    padding-left: 10px;
    border-bottom-color: var(--color-accent-gold);
    background: rgba(255, 255, 255, 0.05);
  }

  .main-nav a:focus-visible {
    outline: 2px solid var(--color-accent-gold);
    outline-offset: -2px;
    color: var(--color-accent-gold);
    padding-left: 10px;
    background: rgba(255, 255, 255, 0.05);
  }
}