/* ========================================   KLEM & KEYS REALTY - PROFESSIONAL NAVBAR STYLES   Fixed transparent navbar with scroll transitions======================================== */

/* Base Navbar */

#mainNavbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  padding: 1.25rem 0;
  background: transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: none;
}

/* Scrolled State - Glass morphism effect */

#mainNavbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 5px 30px rgba(11, 45, 77, 0.08);
  padding: 0.75rem 0;
}

/* Logo Container */

.navbar-brand {
  position: relative;
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0;
  transition: all 0.4s ease;
}

.navbar-brand img {
  height: 48px;
  width: auto;
  transition: all 0.4s ease;
}

#mainNavbar.scrolled .navbar-brand img {
  height: 42px;
}

/* Dual Logo System */

.logo-transparent {
  opacity: 1;
  position: relative;
}

.logo-solid {
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

#mainNavbar.scrolled .logo-transparent {
  opacity: 0;
}

#mainNavbar.scrolled .logo-solid {
  opacity: 1;
}

/* Navigation Items */

.navbar-nav {
  flex-wrap: nowrap;
}

.navbar-nav .nav-link {
  position: relative;
  font-weight: 500;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  white-space: nowrap;
}

#mainNavbar.scrolled .navbar-nav .nav-link {
  color: var(--blue-dark);
  text-shadow: none;
}

/* Nav Icons */

.nav-icon {
  font-size: 16px;
  margin-right: 8px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}

/* Hover Effects */

.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold-primary);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

.navbar-nav .nav-link:hover {
  color: var(--gold-primary);
  background: rgba(184, 146, 59, 0.08);
}

.navbar-nav .nav-link:hover::after {
  width: 65%;
}

.navbar-nav .nav-link:hover .nav-icon {
  transform: translateY(-2px);
  color: var(--gold-primary);
}

#mainNavbar.scrolled .navbar-nav .nav-link:hover {
  color: var(--gold-primary);
  background: rgba(184, 146, 59, 0.08);
}

/* Active State */

.navbar-nav .nav-link.active {
  color: var(--gold-primary);
  font-weight: 600;
  background: rgba(184, 146, 59, 0.1);
}

.navbar-nav .nav-link.active::after {
  width: 65%;
}

.navbar-nav .nav-link.active .nav-icon {
  color: var(--gold-primary);
}

/* CTA Button */

.btn-navbar-cta {
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  background: var(--gold-primary);
  color: var(--white);
  border: 2px solid var(--gold-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(184, 146, 59, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-navbar-cta:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: var(--white);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(11, 45, 77, 0.35);
}

.btn-navbar-cta i {
  font-size: 16px;
}

/* Mobile Toggle Button */

.navbar-toggler {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

.navbar-toggler:hover {
  background: rgba(255, 255, 255, 0.2);
}

#mainNavbar.scrolled .navbar-toggler {
  background: rgba(11, 45, 77, 0.05);
}

#mainNavbar.scrolled .navbar-toggler:hover {
  background: rgba(11, 45, 77, 0.1);
}

/* Toggler Icon */

.navbar-toggler-icon {
  width: 26px;
  height: 26px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  transition: all 0.3s ease;
}

#mainNavbar.scrolled .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(11, 45, 77, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile Menu Header (injected by JS) */

.mobile-menu-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-gray);
  margin: 0 0 1rem 0;
}

.mobile-menu-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--blue-dark);
  margin: 0;
}

.mobile-menu-close {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: var(--off-white);
  color: var(--text-dark);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mobile-menu-close:hover {
  background: var(--gold-primary);
  color: var(--white);
  transform: rotate(90deg);
}

/* Mobile Overlay */

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1020;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

/* ========================================   MOBILE STYLES (Right-side slide menu)======================================== */

/* Mobile menu panel */

@media (max-width: 991px) {
  #navbarContent {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 85vw;
    height: 100vh;
    background: var(--white);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 1025;
    padding: 0;
  }
}

@media (max-width: 991px) {
  #navbarContent.show {
    transform: translateX(0);
  }
}

/* Show mobile menu header */

@media (max-width: 991px) {
  .mobile-menu-header {
    display: flex;
  }
}

/* Mobile navigation list */

@media (max-width: 991px) {
  .navbar-nav {
    width: 100%;
    padding: 0 1.5rem 2rem;
    gap: 0.5rem;
  }
}

@media (max-width: 991px) {
  .navbar-nav .nav-item {
    width: 100%;
  }
}

@media (max-width: 991px) {
  .navbar-nav .nav-link {
    width: 100%;
    color: var(--text-dark);
    text-shadow: none;
    padding: 1rem 1.25rem;
    margin: 0;
    border-radius: 10px;
    font-size: 15px;
    border-left: 3px solid transparent;
    justify-content: flex-start;
  }
}

@media (max-width: 991px) {
  .navbar-nav .nav-link:hover {
    background: var(--off-white);
    color: var(--blue-dark);
    border-left-color: var(--gold-primary);
  }
}

@media (max-width: 991px) {
  .navbar-nav .nav-link::after {
    display: none;
  }
}

@media (max-width: 991px) {
  .navbar-nav .nav-link.active {
    background: var(--off-white);
    color: var(--gold-primary);
    border-left-color: var(--gold-primary);
    font-weight: 600;
  }
}

@media (max-width: 991px) {
  .nav-icon {
    width: 24px;
    margin-right: 14px;
    font-size: 18px;
  }
}

/* Mobile CTA button */

@media (max-width: 991px) {
  .btn-navbar-cta {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    justify-content: center;
    font-size: 15px;
  }
}

/* Adjust navbar padding on mobile */

@media (max-width: 991px) {
  #mainNavbar {
    padding: 1rem 0;
  }
}

@media (max-width: 991px) {
  #mainNavbar.scrolled {
    padding: 0.75rem 0;
  }
}

/* Extra small devices */

@media (max-width: 576px) {
  #navbarContent {
    width: 300px;
  }
}

@media (max-width: 576px) {
  .navbar-brand img {
    height: 42px;
  }
}

@media (max-width: 576px) {
  #mainNavbar.scrolled .navbar-brand img {
    height: 38px;
  }
}

/* Large screens - tighter spacing */

@media (min-width: 992px) and (max-width: 1199px) {
  .navbar-nav {
    gap: 0.5rem;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .navbar-nav .nav-link {
    padding: 0.625rem 0.75rem;
    font-size: 14px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .nav-icon {
    font-size: 15px;
    margin-right: 6px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .btn-navbar-cta {
    padding: 0.7rem 1.5rem;
    font-size: 13px;
  }
}

/* Prevent body scroll when mobile menu is open */

body.mobile-menu-open {
  overflow: hidden;
}

/* Smooth scrolling for entire page */

html {
  scroll-behavior: smooth;
}

/* ========================================   HIDE NAV ICONS ON LARGE SCREENS   Show only in sidebar/mobile menu======================================== */

/* Target only the main navbar, not admin sidebar */

#mainNavbar .nav-icon {
  /*Default: show icons;*/
  display: inline-flex;
}

/* Hide only on desktop (≥ 992px) */

@media (min-width: 992px) {
  #mainNavbar .nav-icon {
    display: none !important;
  }
}

/* Adjust spacing for navbar links without icons */

@media (min-width: 992px) {
  #mainNavbar .navbar-nav .nav-link {
    padding: 0.625rem 1rem;
  }
}

/* Keep icons visible in mobile menu */

@media (max-width: 991px) {
  #mainNavbar .nav-icon {
    display: inline-flex !important;
    margin-right: 14px;
    font-size: 18px;
  }
}

/* ========================================   HIDE LEFT BORDER ON ACTIVE MENU (LARGE SCREENS ONLY)======================================== */

/* Remove left border on active links for desktop */

@media (min-width: 992px) {
  #mainNavbar .navbar-nav .nav-link.active {
    border-left: none !important;
  }
}

/* Keep the underline effect instead */

@media (min-width: 992px) {
  #mainNavbar .navbar-nav .nav-link.active::after {
    width: 65% !important;
  }
}

/* Keep left border for mobile menu */

@media (max-width: 991px) {
  #mainNavbar .navbar-nav .nav-link.active {
    border-left: 3px solid var(--gold-primary) !important;
  }
}

/* Hide the underline on mobile since we have left border */

@media (max-width: 991px) {
  #mainNavbar .navbar-nav .nav-link.active::after {
    display: none !important;
  }
}

