/* Shared Sin Fin navigation styles */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 10px 30px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Great Vibes', cursive;
  font-size: 1.8rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0;
  line-height: 1.1;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  position: relative;
}

.nav-home-link {
  color: var(--white);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
  font-weight: 400;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.nav-home-desktop {
  display: none;
}

.nav-home-link:hover {
  color: var(--gold);
}

.nav-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1.5px solid rgba(232, 180, 184, 0.72);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(183, 110, 121, 0.28), rgba(232, 180, 184, 0.1));
  box-shadow:
    0 0 16px rgba(232, 180, 184, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.nav-menu-toggle:hover {
  border-color: rgba(244, 217, 220, 0.95);
  box-shadow:
    0 0 20px rgba(232, 180, 184, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.nav-menu-toggle:active {
  transform: scale(0.94);
}

.nav-menu-toggle-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
  height: 16px;
}

.nav-menu-toggle-line {
  display: block;
  height: 2.5px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #E8B4B8, #D4AF37, #F4D9DC);
  box-shadow: 0 0 6px rgba(232, 180, 184, 0.45);
  transition: transform 0.28s ease, opacity 0.2s ease, width 0.28s ease;
}

.nav-menu-toggle-line:nth-child(2) {
  width: 72%;
  margin-left: auto;
}

.nav-menu.expanded .nav-menu-toggle-line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.nav-menu.expanded .nav-menu-toggle-line:nth-child(2) {
  opacity: 0;
  width: 0;
}

.nav-menu.expanded .nav-menu-toggle-line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1001;
}

.nav-vine-frame {
  display: none;
}

.nav-links {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  list-style: none;
  min-width: 210px;
  background: rgba(0, 0, 0, 0.98);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scaleY(0.95);
  transform-origin: top right;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.35s ease, visibility 0.3s ease, padding 0.3s ease;
  margin: 0;
  padding: 0;
}

.nav-menu.expanded .nav-links {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scaleY(1);
  max-height: 460px;
  padding: 8px 0;
}

.nav-links li {
  width: 100%;
}

.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
  font-weight: 400;
  display: block;
  width: 100%;
  padding: 10px 20px;
  text-align: right;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--gold);
}

.nav-links .nav-builder-link {
  background: linear-gradient(135deg, #800020, #a00028);
  color: var(--white) !important;
  border: 1px solid var(--gold);
  border-radius: 50px;
  margin: 6px 12px;
  padding: 10px 16px !important;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-align: center;
  transition: all 0.3s ease;
}

.nav-links .nav-builder-link:hover {
  color: var(--white) !important;
  background: linear-gradient(135deg, #a00028, #800020);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

.nav-links .nav-builder-link.is-active {
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.45);
}

.nav-builder-item {
  display: list-item;
}

@media (min-width: 769px) {
  .nav-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .nav-logo {
    grid-column: 1;
    justify-self: start;
  }

  .nav-menu {
    grid-column: 2;
    justify-self: center;
    flex-direction: row;
    align-items: center;
    gap: 25px;
  }

  .nav-dropdown {
    position: static;
  }

  .nav-links {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
    min-width: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .nav-links li {
    width: auto;
  }

  .nav-links a {
    display: inline-block;
    width: auto;
    padding: 4px 0;
    text-align: center;
  }

  .nav-links .nav-builder-link {
    margin: 0;
    padding: 6px 14px !important;
  }

  .nav-home-desktop {
    display: list-item;
  }

  .nav-menu-toggle {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .nav-menu-toggle {
    display: inline-flex !important;
    flex-shrink: 0;
    position: relative;
    z-index: 1002;
  }

  .nav-home-link {
    display: none;
  }

  .navbar {
    padding: 10px 16px;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
  }

  .nav-logo {
    font-size: 1.55rem;
  }

  .nav-dropdown {
    max-width: calc(100vw - 24px);
  }

  .nav-links {
    min-width: 0;
    width: max-content;
    max-width: calc(100vw - 24px);
  }

  .nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .nav-menu.expanded .nav-links {
    overflow: visible;
  }

  .nav-vine-frame {
    display: block;
    position: absolute;
    inset: -10px -12px -10px -12px;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  .nav-menu.expanded .nav-vine-frame {
    opacity: 1;
  }

  .nav-vine-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
  }

  .nav-vine-svg .vine-path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
  }

  .nav-vine-svg .vine-main {
    stroke: #3a6b34;
    stroke-width: 2.4;
  }

  .nav-vine-svg .vine-tendril {
    stroke: #4a8538;
    stroke-width: 1.4;
    opacity: 0.85;
  }

  .nav-vine-svg .vine-leaf {
    fill: #3d7a36;
    opacity: 0;
  }

  .nav-menu.expanded .nav-vine-svg .vine-path-1 {
    animation: navVineGrow 0.9s ease-out forwards;
  }

  .nav-menu.expanded .nav-vine-svg .vine-path-2 {
    animation: navVineGrow 0.85s ease-out 0.12s forwards;
  }

  .nav-menu.expanded .nav-vine-svg .vine-path-3 {
    animation: navVineGrow 0.9s ease-out 0.24s forwards;
  }

  .nav-menu.expanded .nav-vine-svg .vine-path-4 {
    animation: navVineGrow 0.85s ease-out 0.36s forwards;
  }

  .nav-menu.expanded .nav-vine-svg .vine-tendril-1 {
    animation: navVineGrow 0.7s ease-out 0.45s forwards;
  }

  .nav-menu.expanded .nav-vine-svg .vine-tendril-2 {
    animation: navVineGrow 0.7s ease-out 0.55s forwards;
  }

  .nav-menu.expanded .nav-vine-svg .vine-tendril-3 {
    animation: navVineGrow 0.7s ease-out 0.65s forwards;
  }

  .nav-menu.expanded .nav-vine-svg .vine-leaf-1 {
    animation: navLeafBloom 0.45s ease-out 0.5s forwards;
  }

  .nav-menu.expanded .nav-vine-svg .vine-leaf-2 {
    animation: navLeafBloom 0.45s ease-out 0.62s forwards;
  }

  .nav-menu.expanded .nav-vine-svg .vine-leaf-3 {
    animation: navLeafBloom 0.45s ease-out 0.74s forwards;
  }

  .nav-menu.expanded .nav-vine-svg .vine-leaf-4 {
    animation: navLeafBloom 0.45s ease-out 0.86s forwards;
  }

  .nav-vine-rose {
    position: absolute;
    width: 22px;
    height: 22px;
    opacity: 0;
    transform: scale(0);
    transform-origin: center;
    z-index: 4;
  }

  .nav-rose-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
  }

  .nav-vine-rose-1 { top: -6px; left: 18%; }
  .nav-vine-rose-2 { top: 28%; right: -8px; }
  .nav-vine-rose-3 { bottom: 22%; left: -8px; }
  .nav-vine-rose-4 { bottom: -6px; right: 20%; }

  .nav-menu.expanded .nav-vine-rose-1 {
    animation: navRoseBloom 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.55s forwards;
  }

  .nav-menu.expanded .nav-vine-rose-2 {
    animation: navRoseBloom 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.68s forwards;
  }

  .nav-menu.expanded .nav-vine-rose-3 {
    animation: navRoseBloom 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s forwards;
  }

  .nav-menu.expanded .nav-vine-rose-4 {
    animation: navRoseBloom 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.92s forwards;
  }

  @keyframes navVineGrow {
    to { stroke-dashoffset: 0; }
  }

  @keyframes navLeafBloom {
    from { opacity: 0; }
    to { opacity: 0.9; }
  }

  @keyframes navRoseBloom {
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 8px 14px;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
  }

  .nav-logo {
    font-size: 1.4rem;
  }
}

@media (hover: none) {
  .nav-links .nav-builder-link:hover {
    transform: none;
  }
}
