@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&display=swap');

/* Navbar Container */
.navbar {
  background: var(--primary-color);
  align-items: center;
  margin-bottom: 0;
  padding: 0;
  display: flex;
  position: sticky;
  top: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
  height: 90px;
  flex-shrink: 0;
  z-index: 1000;
}


/* Main Container */
.navbar-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 2000px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Reduced gap for tighter spacing between hamburger and search */
  justify-self: start;
}

.nav-center {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 1.75rem;
  /* Standardized gap */
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  /* Standardized gap */
  justify-self: end;
}


/* Logo Group */
.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  z-index: 101;
  position: relative;
}

.logo {
  width: 80px;
  height: auto;
  transition: transform 0.5s ease;
}

/* Center Navigation */
.nav-center {
  justify-self: center;
  /* Centrera i mittenkolumnen */
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-right {
  justify-self: end;
  /* placera själva kolumnen längst till höger */
  display: flex;
  align-items: center;
  /* vertikal centrering */
  gap: 1.5rem;
  height: 100%;
  position: relative;
  /* undvik att göra barn absolut-positionerade */
}

.nav-links {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  gap: 1.75rem;
  /* Standardized gap between links */
}

.nav-links li {
  position: relative;
  height: auto;
  display: flex;
  align-items: center;
}

/* Separator removed as requested */
.nav-links li:not(:last-child)::after {
  display: none;
}

.nav-links li a {
  display: flex;
  align-items: center;
  color: var(--nav-text);
  text-decoration: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  position: relative;
}

/* Animated hover underline */
.nav-links li a::after {
  content: "";
  position: absolute;
  bottom: -10px;
  /* Adjusted shadow position for cleaner look */
  left: 0;
  right: 0;
  height: 2px;
  background: var(--nav-hover);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-links li a:hover::after,
.nav-links li.current-menu-item a::after {
  transform: scaleX(1);
}

.nav-links li a:hover {
  color: var(--nav-hover);
  font-weight: 700;
}

.nav-links li.current-menu-item a {
  color: var(--nav-hover);
  font-weight: 700;
}

/* Right Side Controls */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  /* Standardized gap */
  z-index: 101;
  height: 100%;
}

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--nav-text);
  padding: 0.5rem;
  transition: all 0.3s ease;
  display: flex;
  /* Flex is set, visibility handled by Tailwind utility classes in JSX */
  align-items: center;
  height: 100%;
}

/* Hamburger Menu */
.hamburger-persistent {
  display: flex;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 2200;
  /* Higher than sidebar and overlay */
}

.hamburger-persistent span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--nav-text);
  transition: all 0.3s ease;
}

.hamburger-persistent.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-persistent.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-persistent.open span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* RESTORED STYLES */
.profile-icon-container {
  display: flex;
  align-items: center;
}

.nav-icon {
  color: var(--nav-text);
  stroke: var(--nav-text);
  transition: all 0.3s ease;
}

.nav-icon:hover {
  color: var(--nav-hover);
  stroke: var(--nav-hover);
}

/* Theme Toggle Internals */
.theme-toggle .relative {
  position: relative;
}

.theme-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-toggle .w-14 {
  width: 3.5rem;
}

.theme-toggle .h-7 {
  height: 1.75rem;
}

.theme-toggle .rounded-full {
  border-radius: 9999px;
}

.theme-toggle .bg-gray-400 {
  background-color: var(--toggle-bg-inactive, #9ca3af);
}

.theme-toggle .bg-blue-600 {
  background-color: var(--accent, #888888);
}

.theme-toggle .transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.theme-toggle .absolute {
  position: absolute;
}

.theme-toggle .left-1 {
  left: 0.25rem;
}

.theme-toggle .top-1 {
  top: 0.25rem;
}

.theme-toggle .bg-white {
  background-color: white;
}

.theme-toggle .w-5 {
  width: 1.25rem;
}

.theme-toggle .h-5 {
  height: 1.25rem;
}

.theme-toggle .flex.items-center.justify-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle .text-xs {
  font-size: 0.75rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.theme-toggle .transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Mobile Sidebar Menu */
.mobile-menu {
  position: fixed;
  top: 0 !important;
  left: -360px;
  width: 360px;
  max-width: 85vw;
  height: 100vh;
  background: var(--primary-color);
  z-index: 2100;
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex !important;
  flex-direction: column;
}

.mobile-menu.active {
  transform: translateX(360px);
}

.mobile-menu-content {
  padding: 90px 2rem 2rem 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
}

.mobile-menu li {
  margin-bottom: 1rem;
}

.mobile-menu a {
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--nav-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.mobile-menu a:hover {
  color: var(--nav-hover);
}

/* Overlay / Backdrop */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive Styles */

/* At screens >= 1400px: show desktop links, hide hamburger and mobile search */
@media (min-width: 1400px) {
  .hamburger-persistent {
    display: none;
  }

  .mobile-search-container {
    display: none;
  }
}

/* At screens < 1400px: hide desktop links, show hamburger and mobile search */
@media (max-width: 1399px) {
  .desktop-links {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .navbar-container {
    padding: 0 1rem;
  }

  .nav-right {
    gap: 0.75rem;
  }

  .logo {
    width: 60px;
  }
}

@media (max-width: 576px) {
  .navbar-container {
    padding: 0 0.75rem;
  }

  .nav-right {
    gap: 0.5rem;
  }

  .logo {
    width: 55px;
  }

  /* Hide theme toggle in navbar only on very small screens - still accessible via hamburger menu */
  /* Theme toggle is now always visible */
}

/* Ensure no overflow on all devices */
body,
html {
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
}