/* Base navbar styles */
.navbar {
  padding: 0.75rem 0;
  transition: all 0.3s ease;
  position: fixed;
  width: 100%;
  z-index: 1000;
  min-height: 70px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* Homepage-specific navbar style */
.homepage-navbar {
  position: fixed !important;
  background: transparent !important;
  box-shadow: none;
}

/* Scrolled state */
/* Disabled: scrolled background override; glass-nav will control look */
/* .navbar-scrolled was used previously for scroll-based changes and is now intentionally unused */

/* Default nav links (dark) */
.nav-link {
  position: relative;
  color: rgba(0, 0, 0, 0.65) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem !important;
  transition: color 0.2s ease;
  letter-spacing: 0.01em;
}

.nav-link:hover {
  color: rgba(0, 0, 0, 0.9) !important;
}

.nav-link.active {
  color: #000 !important;
  font-weight: 600;
}

/* Homepage-specific nav links (light) */
.homepage-navbar .nav-link {
  color: rgba(255, 255, 255, 0.75) !important;
}

.homepage-navbar .nav-link:hover {
  color: rgba(255, 255, 255, 1) !important;
}

.homepage-navbar .nav-link.active {
  color: #fff !important;
}

.homepage-navbar .navbar-brand-wallify {
  color: rgb(255, 255, 255);
}

/* Nav links scrolled state */
.navbar-scrolled .nav-link {
  color: rgba(0, 0, 0, 0.65) !important;
}

.navbar-scrolled .nav-link:hover {
  color: rgba(0, 0, 0, 0.9) !important;
}

.navbar-scrolled .nav-link.active {
  color: #000 !important;
}

.navbar-scrolled .hamburger-menu span {
  background-color: rgb(0, 0, 0) !important;
}

.btn-auth {
  color: white;
  background: #000000;
  border: 2px solid #000000;
}

/* Underline animation for nav links - Only on desktop */
@media (min-width: 992px) {
  .navbar-nav {
    gap: 0.25rem;
  }
  
  .nav-link {
    border-radius: 8px;
  }
  
  .nav-link:hover {
    background: rgba(0, 0, 0, 0.04);
  }
  
  .nav-link.active {
    background: rgba(0, 0, 0, 0.06);
  }
  
  .nav-link::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 6px;
    left: 50%;
    background-color: #55bcc9;
    transition: width 0.25s ease, left 0.25s ease;
    border-radius: 1px;
  }

  .nav-link:hover::after {
    width: calc(100% - 2.5rem);
    left: 1.25rem;
  }
  
  .nav-link.active::after {
    width: calc(100% - 2.5rem);
    left: 1.25rem;
    background-color: #55bcc9;
  }

  /* Homepage-specific styles */
  .homepage-navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .homepage-navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
  }
  
  .homepage-navbar .nav-link::after {
    background-color: #55bcc9;
  }

  /* Scrolled state */
  .navbar-scrolled .nav-link:hover {
    background: rgba(0, 0, 0, 0.04);
  }
  
  .navbar-scrolled .nav-link.active {
    background: rgba(0, 0, 0, 0.06);
  }
  
  .navbar-scrolled .nav-link::after {
    background-color: #55bcc9;
  }
}

.btn-auth:hover {
  background: #55bcc9;
  border-color: #55bcc9;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: white;
}

/* Auth buttons default (dark) */
.btn-outline-auth {
  color: #000000;
  border: 2px solid rgba(0, 0, 0, 0.2);
  background: transparent;
}

/* Homepage auth buttons (light) */
.homepage-navbar .btn-outline-auth {
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-outline-auth:hover {
  color: white;
  background: #55bcc9;
  border-color: #55bcc9;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Auth buttons styling */
.auth-buttons .btn {
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Auth buttons - scrolled state mode change */
.navbar-scrolled .btn-outline-auth {
  color: #000000;
  border: 2px solid rgba(0, 0, 0, 0.2);
  background: transparent;
}

.navbar-scrolled .btn-outline-auth:hover {
  color: white;
  background: #55bcc9;
  border-color: #55bcc9;
}

/* Logo styling */
.navbar-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  transition: transform 0.3s ease;
  position: absolute; /* Take logo out of normal flow */
  top: 50%; /* Center vertically */
  transform: translateY(-47%); /* Adjust for perfect centering */
}

/* Adjust the navbar-brand to accommodate the logo */
.navbar-brand {
  width: 100px; /* Match logo width */
  height: 60px; /* Keep navbar height reasonable */
  position: relative; /* For absolute positioning context */
}

/* Optional: Add a hover effect */
.navbar-logo:hover {
  transform: translateY(-50%) scale(1.05); /* Combine transformations */
}

/* Hide Wallify text by default (desktop) */
.navbar-brand-wallify {
  display: none; /* Hide by default */
  font-family: "Pacifico", cursive;
  color: rgb(0, 0, 0);
  font-weight: 500;
  font-size: 24px;
  transition: color 0.3s ease;
  margin-left: -35px;
  text-decoration: none;
}

.navbar-scrolled .navbar-brand-wallify {
  color: #000000;
}

.navbar-brand-wallify:hover {
  color: #55bcc9;
}

/* Show Wallify text only in mobile */
@media (max-width: 991.98px) {
  .navbar-brand-wallify {
    display: block; /* Show in mobile */
    font-size: 16px;
    margin-left: -13px;
  }
}

/* Hamburger menu styling */
.navbar-toggler {
  border: none;
  padding: 0;
  outline: none !important;
  box-shadow: none !important;
}

.hamburger-menu {
  width: 25px; /* Reduced from 30px */
  height: 18px; /* Reduced from 24px */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 2px; /* Reduced from 3px */
  background-color: black;
  transition: all 0.3s ease;
  position: absolute;
  left: 0;
  transform-origin: center;
}

/* Position the lines with less spacing */
.hamburger-menu span:nth-child(1) {
  top: 0;
}

.hamburger-menu span:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-menu span:nth-child(3) {
  bottom: 0;
}

/* X animation when menu is open */
.navbar-toggler[aria-expanded="true"] .hamburger-menu span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .hamburger-menu span:nth-child(2) {
  opacity: 0;
}

.navbar-toggler[aria-expanded="true"] .hamburger-menu span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Homepage hamburger (light) */
.homepage-navbar .hamburger-menu span {
  background-color: white;
}

/* Mobile dropdown styling */
@media (max-width: 991.98px) {
  /* Reduce navbar height */
  .navbar {
    min-height: 70px;
    padding: 0.25rem 0;
  }

  /* Adjust logo size */
  .navbar-logo {
    width: 90px;
    height: 90px;
  }

  /* Adjust brand container */
  .navbar-brand {
    width: 70px;
    height: 50px;
    margin-left: -25px;
  }

  /* Adjust Wallify text */
  .navbar-brand-wallify {
    font-size: 16px;
    margin-left: -13px;
  }

  /* Rest of your existing mobile styles... */
  .navbar-collapse {
    background: white;
    padding: 1rem;
    margin-top: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .navbar-collapse .nav-link {
    color: black !important;
    padding: 0.75rem 1rem !important;
  }

  .navbar-collapse .nav-link:hover,
  .navbar-collapse .nav-link.active {
    color: #55bcc9 !important;
  }

  /* Auth buttons mobile styling */
  .auth-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }

  .auth-buttons .btn {
    width: 200px;
    text-align: center;
    margin: 0 !important;
  }

  /* Fix login button colors in mobile */
  .auth-buttons .btn-outline-auth {
    color: black;
    border-color: black;
  }

  .btn-outline-auth.me-2 {
    margin-right: 0 !important;
  }

  .user-button {
    margin-right: 1rem; /* Add space between profile pic and hamburger */
  }

  .pfp-btn {
    width: 35px; /* Make profile pic slightly smaller on mobile */
    height: 35px;
  }
}

.user-button {
  display: flex;
  align-items: center;
}

.pfp-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
}

.pfp-btn:hover {
  transform: scale(1.1); /* Scale the image up by 10% */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add a subtle drop shadow */
}

.dropdown-item:hover {
  background-color: #55bcc9;
  color: white;
}

/* Theme toggle clean look */
#themeToggle {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
  color: inherit; /* inherit from navbar state */
  transition: transform 0.18s ease; /* float animation */
  will-change: transform;
}
#themeToggle.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#themeToggle:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Ensure theme toggle icon is white on homepage before scroll (transparent navbar) */
.homepage-navbar:not(.navbar-scrolled) #themeToggle,
.homepage-navbar:not(.navbar-scrolled) #themeToggle i {
  color: #ffffff !important;
}

/* Fine-tune icon alignment */
#themeToggle i {
  display: inline-block;
  line-height: 1; /* consistent vertical centering */
}
/* When showing the moon (light mode), nudge slightly down and right */
#themeToggle i.fa-moon {
  transform: translate(1px, 1px);
}
/* Keep sun (dark mode) visually centered */
#themeToggle i.fa-sun {
  transform: none;
}

/* Prevent hover color/background changes on theme toggle, but allow a subtle float */
#themeToggle:hover {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit !important; /* do not change on hover */
  transform: translateY(-2px); /* float up a bit */
}
#themeToggle:active {
  transform: translateY(-1px); /* gentle press feedback */
}

/* Transparent homepage navbar (light mode) -> make toggle white */
.homepage-navbar #themeToggle {
  color: #ffffff !important;
}

/* White navbar (default and scrolled) -> keep toggle black and no hover color change */
.navbar.bg-white #themeToggle,
.navbar-scrolled #themeToggle {
  color: #000000 !important;
}
.navbar.bg-white #themeToggle:hover,
.navbar-scrolled #themeToggle:hover {
  color: #000000 !important;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  #themeToggle {
    transition: none;
  }
  #themeToggle:hover,
  #themeToggle:active {
    transform: none;
  }
}

/* Ensure homepage remains transparent until scrolled in all themes */
.homepage-navbar.navbar-scrolled {
  background: white !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Theme toggle icon sizing */
#themeToggle i {
  display: inline-block;
  width: 1.4em; /* fixed width to avoid layout shift between icons */
  text-align: center;
  line-height: 1;
}

/* Make the moon a bit larger for better legibility in light mode */
#themeToggle i.fa-moon {
  font-size: 1.25em;
}

/* =============================
   Glass navbar: consistent frosted look in both themes
   ============================= */
.glass-nav {
  background: rgba(10, 10, 10, 0.45) !important;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.glass-nav .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
}
.glass-nav .nav-link:hover,
.glass-nav .nav-link.active {
  color: #ffffff !important;
}
.glass-nav .hamburger-menu span {
  background-color: #ffffff !important;
}
.glass-nav .navbar-brand-wallify {
  color: #ffffff !important;
}
.glass-nav #themeToggle,
.glass-nav #themeToggle i {
  color: #ffffff !important;
}
.glass-nav .btn-outline-auth {
  color: #ffffff;
  border-color: #ffffff;
}
.glass-nav .btn-outline-auth:hover {
  color: #000000;
  background: #ffffff;
  border-color: #ffffff;
}

@media (min-width: 992px) {
  .glass-nav .nav-link::after {
    background-color: rgba(255, 255, 255, 0.7) !important;
  }
  .glass-nav .nav-link:hover::after,
  .glass-nav .nav-link.active::after {
    background-color: #ffffff !important;
  }
}

@media (max-width: 991.98px) {
  .glass-nav .navbar-collapse {
    background: rgba(10, 10, 10, 0.45) !important;
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  }
  .glass-nav .navbar-collapse .nav-link {
    color: #ffffff !important;
  }
}
