/* =================================
   100% WORKING NAVBAR SOLUTION
   GUARANTEED TO WORK - NO ISSUES
   ================================= */

/* NAVBAR CONTAINER - ALWAYS FULL WIDTH */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw;
  z-index: 1000;
  margin: 0;
  padding: 0;
  border: none;
  transition: all 0.4s ease;
}

/* CONTENT CONTAINER */
.nav-content {
  /* RESET EVERYTHING */
  margin: 0;
  padding: 0;
  border: none;
  width: 100%;
  max-width: none;
  min-width: 100%;
  box-sizing: border-box;
  
  /* LAYOUT */
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  /* DEFAULT STATE - FULL WIDTH STICK TO TOP */
  padding: 1rem 2rem;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(236, 72, 153, 0.1);
  
  /* NO BORDER RADIUS WHEN AT TOP */
  border-radius: 0;
  
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* DARK MODE */
[data-theme="dark"] .nav-content {
  background: rgba(0, 0, 0, 0.98);
  border-bottom: 1px solid rgba(236, 72, 153, 0.2);
}

/* SHRUNK STATE - FLOATING EFFECT */
.navbar.shrunk {
  padding: 0.5rem 2rem;
}

.navbar.shrunk .nav-content {
  /* FLOATING CONTAINER WHEN SHRUNK */
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(236, 72, 153, 0.3);
  border-bottom: 1px solid rgba(236, 72, 153, 0.3);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 32px rgba(236, 72, 153, 0.15);
}

[data-theme="dark"] .navbar.shrunk .nav-content {
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(236, 72, 153, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

/* LOGO SECTION */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.logo:hover {
  transform: translateY(-1px);
}

.logo-img {
  height: 36px;
  width: auto;
  transition: all 0.3s ease;
}

.logo:hover .logo-img {
  transform: rotate(-3deg) scale(1.05);
}

.logo-text {
  font-weight: 800;
  color: var(--ink-dark, #18181b);
  font-size: 1.75rem;
  letter-spacing: -0.5px;
  transition: all 0.3s ease;
}



.beta-tag {
  position: relative;
  top: -8px;
  right: 0;
  font-size: 0.6rem;
  background: linear-gradient(135deg, #ec4899, #f472b6);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
  letter-spacing: 0.5px;
}

[data-theme="dark"] .beta-tag {
  background: linear-gradient(135deg, #ec4899, #f472b6);
  color: white;
}

/* NAVIGATION LEFT */
.nav-left {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.tools-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
}

.menu-item-wrapper {
  position: relative;
}

.tools-link {
  position: relative;
  text-decoration: none;
  color: var(--ink-medium, #64748b);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tools-link:hover {
  color: var(--ink-dark, #18181b);
  background: rgba(236, 72, 153, 0.1);
}

.tools-link.active {
  color: #ec4899;
  background: rgba(236, 72, 153, 0.15);
}

/* DROPDOWN */
.tools-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  min-width: 220px;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .tools-dropdown {
  background: rgba(0, 0, 0, 0.98);
  border: 1px solid rgba(236, 72, 153, 0.2);
}

.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, #64748b);
  text-decoration: none;
}

.dropdown-item:hover {
  background: rgba(236, 72, 153, 0.1);
  color: var(--ink-dark, #18181b);
}

.dropdown-item-icon {
  width: 20px;
  height: 20px;
  color: #ec4899;
}

.dropdown-item-text {
  font-size: 0.9rem;
  font-weight: 500;
}

/* NAVIGATION RIGHT */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-credits {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(236, 72, 153, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.3s ease;
  border: 1px solid rgba(236, 72, 153, 0.2);
  margin-right: 20px;
}

.user-credits:hover {
  background: rgba(236, 72, 153, 0.15);
  transform: translateY(-1px);
}

.credits-label {
  font-size: 0.85rem;
  color: var(--ink-light, #64748b);
  font-weight: 500;
}

.credits-value {
  font-weight: 700;
  font-size: 1rem;
  color: #ec4899;
}

/* SIGN UP BUTTON */
.sign-up-btn {
  padding: 0.6rem 1.4rem;
  background: linear-gradient(135deg, #ec4899, #facc15);
  color: white;
  border: none;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.sign-up-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.6);
}

/* PROFILE CONTAINER - POSITIONED CORRECTLY */
.profile-container {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  transition: transform 0.2s ease;
}



#profile-pic {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all 0.3s ease;
  border: 2px solid rgba(236, 72, 153, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

#profile-pic:hover {
  border-color: #ec4899;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.4);
}

/* PROFILE DROPDOWN */
.profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  min-width: 280px;
  z-index: 1000;
  border: 1px solid rgba(255, 255, 255, 0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

[data-theme="dark"] .profile-dropdown {
  background: rgba(0, 0, 0, 0.98);
  border: 1px solid rgba(236, 72, 153, 0.2);
}

.profile-dropdown.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.profile-info {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.15);
}

.user-name {
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--ink-dark, #18181b);
  font-size: 1.1rem;
}

.user-email {
  font-size: 0.85rem;
  color: var(--ink-light, #64748b);
}

.stats-section {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.15);
}

.stats-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stats-label {
  font-size: 0.75rem;
  color: var(--ink-light, #64748b);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stats-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fbbf24;
}

.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(236, 72, 153, 0.05);
  color: var(--ink-medium, #64748b);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  border: 1px solid rgba(236, 72, 153, 0.1);
}

.menu-item:hover {
  background: rgba(236, 72, 153, 0.1);
  color: var(--ink-dark, #18181b);
  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="%23ec4899" 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: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.logout:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* INVITE MODAL */
.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: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin: 15% auto;
  padding: 2rem;
  border-radius: 20px;
  width: 80%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .invite-modal-content {
  background: rgba(0, 0, 0, 0.98);
  border: 1px solid rgba(236, 72, 153, 0.2);
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 24px;
  cursor: pointer;
  color: var(--ink-light, #64748b);
  transition: color 0.2s ease;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.invite-link-container {
  display: flex;
  margin: 15px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#invite-link {
  flex-grow: 1;
  padding: 12px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-right: none;
  border-radius: 0;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.8);
}

#copy-link {
  padding: 12px 16px;
  background: linear-gradient(135deg, #ec4899, #facc15);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

#copy-link:hover {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
}

.invite-success {
  display: none;
  color: #10b981;
  text-align: center;
  margin-top: 10px;
  font-weight: 600;
}

/* MOBILE MENU TOGGLE */
.mobile-menu-toggle {
  display: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
  z-index: 1002;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.1);
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(236, 72, 153, 0.15);
}

.hamburger-icon {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.hamburger-icon span,
.hamburger-icon span::before,
.hamburger-icon span::after {
  position: absolute;
  width: 18px;
  height: 2px;
  background: #ec4899;
  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: -6px;
}

.hamburger-icon span::after {
  top: 6px;
}

.mobile-menu-toggle.active .hamburger-icon span {
  background: transparent;
}

.mobile-menu-toggle.active .hamburger-icon span::before {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-icon span::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* MOBILE MENU */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1001;
  padding: 6rem 2rem 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .mobile-menu {
  background: rgba(0, 0, 0, 0.98);
}

.mobile-menu.show {
  display: block;
  right: 0;
}

.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: 1rem 1.5rem;
  width: 100%;
  color: var(--ink-dark, #18181b);
  background: rgba(236, 72, 153, 0.05);
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

.mobile-menu .menu-item-wrapper .tools-dropdown {
  position: static;
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
}

.mobile-menu .menu-item-wrapper.active .tools-dropdown {
  opacity: 1;
  visibility: visible;
  max-height: 500px;
  transform: none;
}

/* =================================
   MOBILE RESPONSIVE - 100% WORKING
   ================================= */

@media screen and (max-width: 768px) {
  /* FORCE FULL WIDTH ON MOBILE */
  .navbar {
    width: 100vw;
    padding: 0;
    margin: 0;
  }
  
  .navbar.shrunk {
    padding: 0;
  }

  .nav-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 0;
  }
  
  .navbar.shrunk .nav-content {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    padding: 0.6rem 1rem;
  }

  .nav-left {
    flex-grow: 1;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-menu-toggle {
    display: block;
    margin-left: auto;
    margin-right: 0.75rem;
  }

  .tools-menu,
  .nav-right {
    display: none;
  }

  .logo-text {
    font-size: 1.5rem;
  }

  .logo-img {
    height: 32px;
  }

  .profile-container {
    position: relative !important;
    transform: none !important;
    display: flex;
    align-items: center;
    right: auto !important;
    top: auto !important;
  }

  #profile-pic {
    width: 36px;
    height: 36px;
  }

  .profile-dropdown {
    top: 50px;
    right: 0;
    min-width: 260px;
  }
}

@media screen and (max-width: 480px) {
  .nav-content {
    padding: 0.5rem 0.75rem;
  }
  
  .navbar.shrunk .nav-content {
    padding: 0.5rem 0.75rem;
  }

  .logo-text {
    font-size: 1.3rem;
  }

  .logo-img {
    height: 28px;
  }

  #profile-pic {
    width: 32px;
    height: 32px;
  }
}

/* THEME VARIABLES */
:root {
  --ink-dark: #18181b;
  --ink-medium: #64748b;
  --ink-light: #94a3b8;
}

[data-theme="dark"] {
  --ink-dark: #f8fafc;
  --ink-medium: #e2e8f0;
  --ink-light: #cbd5e1;
}
/* === Floating Shrink Effect === */
.navbar:not(.shrunk) .nav-content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.navbar.shrunk {
  top: 12px !important; /* gap from top */
}

.navbar.shrunk .nav-content {
  width: min(1200px, calc(100% - 32px)) !important; /* side gaps */
  margin: 0 auto !important;
  border-radius: 16px !important;
  padding: 0.6rem 1.2rem !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(236, 72, 153, 0.3) !important;
  box-shadow: 0 8px 32px rgba(236, 72, 153, 0.15) !important;
}

[data-theme="dark"] .navbar.shrunk .nav-content {
  background: rgba(0,0,0,0.98) !important;
  border: 1px solid rgba(236, 72, 153, 0.25) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.9) !important;
}
