/* Modern and Fresh Navbar Styles */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: var(--backdrop-filter);
  border-bottom: 1px solid var(--paper-border);
  transition: all 0.4s ease;
  padding: 0;
  box-shadow: var(--shadow-sm);
  /* Add relative positioning to make absolute positioning work within navbar */
  position: fixed;
}

.navbar.scrolled {
  background: var(--nav-bg);
  box-shadow: var(--shadow-md);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.8rem 2rem;
  transition: padding 0.3s ease;
}

/* Logo styling with refreshed look */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.logo-img {
  height: 36px; /* Adjust based on your logo size */
  width: auto;
  transition: all 0.3s ease;
}
.logo-text {
  font-weight: 800;
  color: var(--ink-dark);
  font-size: 1.8rem;
  letter-spacing: -0.5px;
  transition: all 0.3s ease;

}

/* Hover effects */
.logo:hover .logo-img {
  transform: rotate(-5deg) scale(1.1);
}
.logo:hover .logo-text {
  color: var(--accent-warm);
  transform: translateY(-2px);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .logo-img {
    height: 28px;
  }
  
  .logo-text {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .logo-img {
    height: 24px;
  }
  
  .logo-text {
    font-size: 1.2rem;
  }
}
.beta-tag {
  position: relative;
  top: -8px;
  right: 0;
  font-size: 0.6rem;
  background: var(--accent-warm);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.5px;
}

/* Navigation Left Section with enhanced menu */
.nav-left {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

/* Tools Menu with Modern Dropdown */
.tools-menu {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  position: relative;
}

.menu-item-wrapper {
  position: relative;
}

.tools-link {
  position: relative;
  text-decoration: none;
  color: var(--ink-medium);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  transition: all 0.25s ease;
  cursor: pointer;
}

.tools-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-warm);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.tools-link:hover {
  color: var(--ink-dark);
}

.tools-link:hover::after {
  transform: scaleX(1);
}

.tools-link.active {
  color: var(--accent-warm);
  font-weight: 600;
}

/* Dropdown for Tools */
.tools-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--paper-cream);
  border-radius: 12px;
  box-shadow: var(--shadow-elevation);
  padding: 1rem;
  min-width: 220px;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  border: 1px solid var(--paper-border);
  margin-top: 0.75rem;
}

.menu-item-wrapper:hover .tools-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: var(--ink-medium);
  text-decoration: none;
}

.dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink-dark);
  transform: translateX(3px);
}

.dropdown-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-warm);
}

.dropdown-item-text {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Navigation Right Section with enhanced styling */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-credits {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.04);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  transition: all 0.2s ease;
  border: 1px solid var(--paper-border);
  margin-right: 21px;
}

.user-credits:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.credits-label {
  font-size: 0.85rem;
  color: var(--ink-light);
  font-weight: 500;
}

.credits-value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink-dark);
}

/* Sign Up Button */
.sign-up-btn {
  padding: 0.6rem 1.2rem;
  background: var(--accent-warm);
  color: white;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.sign-up-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px var(--accent-glow);
}

/* Profile Container with enhanced styling */
.profile-container {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  transition: transform 0.2s ease;
}



#profile-pic {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}

#profile-pic:hover {
  border-color: var(--accent-warm);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Profile Dropdown */
.profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%; /* Position below the profile icon */
  background: var(--paper-cream);
  border-radius: 14px;
  box-shadow: var(--shadow-elevation);
  padding: 1.25rem;
  min-width: 280px;
  z-index: 1000;
  border: 1px solid var(--paper-border);
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-dropdown.show {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.profile-info {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--paper-border);
}

.user-name {
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--ink-dark);
  font-size: 1.1rem;
}

.user-email {
  font-size: 0.85rem;
  color: var(--ink-light);
}

.stats-section {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--paper-border);
}

.stats-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stats-label {
  font-size: 0.75rem;
  color: var(--ink-light);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stats-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink-dark);
}

.dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-medium);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.menu-item:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink-dark);
  transform: translateY(-1px);
}

.menu-icon {
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
}

.invite-icon {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="20" y1="8" x2="20" y2="14"></line><line x1="23" y1="11" x2="17" y2="11"></line></svg>');
}

.logout {
  width: 100%;
  padding: 0.75rem;
  border: none;
  background: #ff4444;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.logout:hover {
  background: #ff0000;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Invite Modal Styles */
.invite-modal {
  display: none;
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(8px);
  background-color: rgba(0,0,0,0.4);
}

.invite-modal-content {
  background-color: var(--paper-cream);
  margin: 15% auto;
  padding: 2rem;
  border-radius: 16px;
  width: 80%;
  max-width: 500px;
  position: relative;
  box-shadow: var(--shadow-elevation);
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 24px;
  cursor: pointer;
  color: var(--ink-light);
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: var(--ink-dark);
}

.invite-link-container {
  display: flex;
  margin: 15px 0;
}

#invite-link {
  flex-grow: 1;
  padding: 12px;
  border: 1px solid var(--paper-border);
  border-radius: 8px 0 0 8px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.8);
}

#copy-link {
  padding: 12px 16px;
  background: var(--accent-warm);
  color: white;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

#copy-link:hover {
  background: #00afb2;
}

.invite-success {
  display: none;
  color: #28a745;
  text-align: center;
  margin-top: 10px;
  font-weight: 600;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 1002;
}

.hamburger-icon {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.hamburger-icon span,
.hamburger-icon span::before,
.hamburger-icon span::after {
  position: absolute;
  width: 24px;
  height: 3px;
  background: var(--ink-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-icon span {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hamburger-icon span::before,
.hamburger-icon span::after {
  content: '';
  left: 0;
}

.hamburger-icon span::before {
  top: -8px;
}

.hamburger-icon span::after {
  top: 8px;
}

.mobile-menu-toggle.active .hamburger-icon span {
  background: transparent;
}

.mobile-menu-toggle.active .hamburger-icon span::before {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-icon span::after {
  transform: translateY(-8px) rotate(-45deg);
}

/* Full-Page Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: var(--paper-cream);
  z-index: 1001;
  padding: 5rem 2rem 2rem;
  overflow-y: auto;
  transition: right 0.4s ease;
  backdrop-filter: blur(8px);
}

.mobile-menu.show {
  display: block;
  right: 0;
}

/* Style the tools menu and nav-right inside the mobile menu */
.mobile-menu .tools-menu,
.mobile-menu .nav-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 1.5rem;
}

.mobile-menu .tools-menu {
  margin-bottom: 2rem;
}

.mobile-menu .tools-link {
  font-size: 1.2rem;
  padding: 0.75rem 1rem;
  width: 100%;
  color: var(--ink-dark);
  border-bottom: 1px solid var(--paper-border);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
}

.mobile-menu.show .tools-link {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu .tools-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu .tools-link:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu .tools-link:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu .tools-link:nth-child(4) { transition-delay: 0.4s; }

/* Tools Dropdown in Mobile Menu */
.mobile-menu .menu-item-wrapper {
  width: 100%;
}

.mobile-menu .tools-dropdown {
  position: static;
  width: 100%;
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0.5rem 1rem;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0);
  display: none;
  transition: none;
}

.mobile-menu .menu-item-wrapper.active .tools-dropdown {
  display: block;
  opacity: 1;
  visibility: visible;
}

.mobile-menu .dropdown-item {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--ink-medium);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
}

.mobile-menu.show .dropdown-item {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu .dropdown-item:nth-child(1) { transition-delay: 0.5s; }
.mobile-menu .dropdown-item:nth-child(2) { transition-delay: 0.6s; }
.mobile-menu .dropdown-item:nth-child(3) { transition-delay: 0.7s; }
.mobile-menu .dropdown-item:nth-child(4) { transition-delay: 0.8s; }

.mobile-menu .dropdown-item:hover {
  transform: none; /* Remove hover effect on mobile */
  background: rgba(0, 0, 0, 0.05);
}

/* Nav-Right in Mobile Menu */
.mobile-menu .nav-right {
  gap: 1rem;
}

.mobile-menu .user-credits {
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.02);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  transition-delay: 0.9s;
}

.mobile-menu.show .user-credits {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu .sign-up-btn {
  width: 100%;
  text-align: center;
  padding: 0.75rem;
  font-size: 1rem;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  transition-delay: 1s;
}

.mobile-menu.show .sign-up-btn {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu .profile-container {
  width: 100%;
}

.mobile-menu .profile-container #profile-pic {
  width: 44px;
  height: 44px;
}

.mobile-menu .profile-dropdown {
  position: static;
  width: 100%;
  transform: none;
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  transition-delay: 1.1s;
}

.mobile-menu.show .profile-dropdown {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu .profile-dropdown.show {
  transform: none;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
  .navbar {
      padding: 0.75rem 0;
  }

  .nav-content {
      padding: 0 1rem;
      flex-wrap: wrap;
      position: relative;
  }

  .nav-left {
      flex-grow: 1;
      justify-content: space-between;
      align-items: center;
  }

  /* Show the hamburger menu on mobile */
  .mobile-menu-toggle {
      display: block;
  }

  /* Hide the tools menu and nav-right by default on mobile */
  .tools-menu,
  .nav-right {
      display: none;
  }

  .logo {
      font-size: 1.4rem;
  }
}

@media screen and (max-width: 480px) {
  .nav-content {
      padding: 0 0.75rem;
  }

  .logo {
      font-size: 1.2rem;
  }
  /* Adjust profile icon size in mobile menu */
.mobile-menu .profile-container #profile-pic {
  width: 36px;
  height: 36px;
}
}
.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.8rem 2rem;
  transition: padding 0.3s ease;
  position: relative; /* Ensure positioning context for profile-container */
}

/* Ensure profile icon size is consistent */
.profile-container #profile-pic {
  width: 36px;
  height: 36px;
}

/* Remove profile-container styles from mobile menu (no longer needed) */
.mobile-menu .profile-container,
.mobile-menu .profile-container #profile-pic,
.mobile-menu .profile-dropdown,
.mobile-menu.show .profile-dropdown {
  display: none; /* Remove any lingering styles */
}

/* Adjust nav-content layout on mobile to include profile icon */
@media screen and (max-width: 768px) {
  .nav-content {
      padding: 0 1rem;
      flex-wrap: wrap;
      position: relative;
      justify-content: space-between;
  }

  .nav-left {
      flex-grow: 1;
      justify-content: flex-start;
      align-items: center;
  }

  .mobile-menu-toggle {
      margin-left: auto;
      margin-right: 0.5rem; /* Space between hamburger and profile icon */
  }

  .profile-container {
    position: static; /* Revert to flex item */
    transform: none; /* Remove absolute positioning transform */
    display: flex;
    align-items: center;
}
  .profile-container #profile-pic {
      width: 32px;
      height: 32px;
  }

  .profile-dropdown {
      top: 50px; /* Adjust dropdown position on mobile */
      right: 0;
  }
}

@media screen and (max-width: 480px) {
  .profile-container #profile-pic {
      width: 30px;
      height: 30px;
  }

  .profile-dropdown {
      top: 48px;
  }
}
