/* ========================= */
/*       GLOBAL RESET        */
/* ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========================= */
/*        HEADER NAV         */
/* ========================= */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
  z-index: 1000;
  box-shadow: 0 0 20px rgba(0, 204, 255, 0.25);
  animation: fadeDown 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: all 0.4s ease;
}

.navbar.scrolled {
  padding: 10px 40px;
  background: rgba(0, 0, 0, 0.95);
  box-shadow: 0 0 30px rgba(0, 204, 255, 0.4);
}

@keyframes fadeDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #00e5ff;
  font-weight: bold;
  font-size: 1.4rem;
  text-shadow: 0 0 8px #00e5ff;
  transition: all 0.3s ease;
}

.logo:hover {
  text-shadow: 0 0 15px #00e5ff;
  transform: scale(1.02);
}

.logo-img {
  height: 40px;
  filter: drop-shadow(0 0 6px #00f7ff);
  animation: pulseLogo 2.5s infinite ease-in-out;
  transition: all 0.3s ease;
}

@keyframes pulseLogo {
  0%, 100% { 
    transform: scale(1); 
    filter: drop-shadow(0 0 6px #00f7ff); 
  }
  50% { 
    transform: scale(1.05); 
    filter: drop-shadow(0 0 12px #00f7ff); 
  }
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-links li {
  position: relative;
}

.nav-links li a {
  text-decoration: none;
  color: white;
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  transition: all 0.3s ease;
  padding: 8px 0;
}

.nav-links li a::before {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  background: linear-gradient(to right, #00eaff, #00bfff);
  bottom: 0;
  left: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  border-radius: 4px;
  opacity: 0;
}

.nav-links li a::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #00eaff, #00bfff);
  bottom: 0;
  left: 0;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
  border-radius: 4px;
}

.nav-links li a:hover {
  color: #00eaff;
  text-shadow: 0 0 8px rgba(0, 234, 255, 0.6);
}

.nav-links li a:hover::before {
  width: 100%;
  opacity: 1;
}

.nav-links li a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ========================= */
/*      AUTH LINK STYLING    */
/* ========================= */
/* Base styling for the auth link - UPDATED TO MATCH NAVBAR */
#authLink {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 50px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  background: linear-gradient(135deg, rgba(0, 234, 255, 0.15) 0%, rgba(0, 150, 255, 0.15) 100%);
  border: 1px solid rgba(0, 234, 255, 0.2);
  color: #ffffff;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.3px;
  box-shadow: 
      0 4px 6px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-shadow: 0 0 5px rgba(0, 234, 255, 0.5);
}

/* Icon styling - UPDATED TO MATCH NAVBAR THEME */
#authLink i {
  font-size: 1rem;
  transition: all 0.3s ease;
  color: #00e5ff;
  text-shadow: 0 0 5px rgba(0, 229, 255, 0.7);
}

/* Text styling */
#authText {
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

/* Hover effects - UPDATED TO MATCH NAVBAR THEME */
#authLink:hover {
  transform: translateY(-2px);
  box-shadow: 
      0 10px 20px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 0 15px rgba(0, 234, 255, 0.4);
  background: linear-gradient(135deg, rgba(0, 234, 255, 0.25) 0%, rgba(0, 150, 255, 0.25) 100%);
  border-color: rgba(0, 234, 255, 0.4);
  color: #ffffff;
}

#authLink:hover i {
  transform: scale(1.1) rotate(5deg);
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.9);
}

#authLink:hover #authText {
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(0, 234, 255, 0.8);
}

/* Active/click effect */
#authLink:active {
  transform: translateY(0);
  transition: all 0.1s ease;
  box-shadow: 
      0 2px 4px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Pulsing animation for attention - UPDATED TO MATCH NAVBAR THEME */
@keyframes pulse-glow {
  0% {
      box-shadow: 
          0 4px 6px rgba(0, 0, 0, 0.2),
          inset 0 1px 0 rgba(255, 255, 255, 0.1),
          0 0 0 0 rgba(0, 234, 255, 0.5);
  }
  70% {
      box-shadow: 
          0 4px 6px rgba(0, 0, 0, 0.2),
          inset 0 1px 0 rgba(255, 255, 255, 0.1),
          0 0 0 10px rgba(0, 234, 255, 0);
  }
  100% {
      box-shadow: 
          0 4px 6px rgba(0, 0, 0, 0.2),
          inset 0 1px 0 rgba(255, 255, 255, 0.1),
          0 0 0 0 rgba(0, 234, 255, 0);
  }
}

/* Add pulsing animation on page load for attention */
#authLink {
  animation: pulse-glow 2.5s ease-in-out 1s 2;
}

/* Ripple effect on click */
#authLink::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 234, 255, 0.3);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.5s, opacity 0.5s;
}

#authLink:active::after {
  transform: scale(4);
  opacity: 0;
  transition: 0s;
}

/* ========================= */
/*     MOBILE MENU           */
/* ========================= */
.hamburger {
  display: none;
  cursor: pointer;
  z-index: 1001;
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: #00e5ff;
  transition: all 0.3s ease;
  box-shadow: 0 0 5px #00e5ff;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 70%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: right 0.5s cubic-bezier(0.77, 0.2, 0.05, 1);
  box-shadow: -5px 0 30px rgba(0, 204, 255, 0.3);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu ul {
  list-style: none;
  width: 100%;
  padding: 0 30px;
}

.mobile-menu li {
  margin: 25px 0;
  opacity: 0;
  transform: translateX(20px);
}

.mobile-menu li a {
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  display: block;
  padding: 10px 15px;
  border-radius: 5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.mobile-menu li a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 230, 255, 0.2), transparent);
  transition: all 0.5s ease;
}

.mobile-menu li a:hover {
  background: rgba(0, 204, 255, 0.1);
  color: #00e5ff;
  text-shadow: 0 0 10px #00e5ff;
}

.mobile-menu li a:hover::before {
  left: 100%;
}

/* Mobile menu auth link styling */
.mobile-menu #authLink {
  margin-top: 20px;
  width: 80%;
  justify-content: center;
  padding: 12px 20px;
  font-size: 1.1rem;
}

/* ========================= */
/*   RESPONSIVE DESIGN       */
/* ========================= */
@media (max-width: 1200px) {
  .navbar {
    padding: 14px 30px;
  }
  
  .nav-links {
    gap: 12px;
  }
  
  #authLink {
    padding: 8px 18px;
  }
}

@media (max-width: 992px) {
  .hamburger {
    display: block;
  }
  
  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  
  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  .nav-links {
    display: none;
  }
  
  .mobile-menu.active li {
    animation: fadeInRight 0.5s ease forwards;
  }
  
  @keyframes fadeInRight {
    from {
      opacity: 0;
      transform: translateX(20px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  .mobile-menu li:nth-child(1) { animation-delay: 0.1s; }
  .mobile-menu li:nth-child(2) { animation-delay: 0.2s; }
  .mobile-menu li:nth-child(3) { animation-delay: 0.3s; }
  .mobile-menu li:nth-child(4) { animation-delay: 0.4s; }
  .mobile-menu li:nth-child(5) { animation-delay: 0.5s; }
  .mobile-menu li:nth-child(6) { animation-delay: 0.6s; }
}

@media (max-width: 768px) {
  .navbar {
    padding: 12px 20px;
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .logo-img {
    height: 35px;
  }
  
  /* Adjust hover effects for touch devices */
  @media (hover: none) {
    #authLink:hover {
      transform: none;
    }
    
    #authLink:active {
      transform: scale(0.98);
    }
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 10px 15px;
  }
  
  .logo {
    font-size: 1.1rem;
    gap: 8px;
  }
  
  .logo-img {
    height: 30px;
  }
  
  .mobile-menu {
    width: 85%;
  }
  
  .mobile-menu ul {
    padding: 0 20px;
  }
  
  .mobile-menu li a {
    font-size: 1.1rem;
    padding: 8px 12px;
  }
  
  /* Optionally hide text on very small screens, show only icon */
  @media (max-width: 360px) {
    .logo span {
      display: none;
    }
  }
}

/* Tablet responsiveness */
@media (min-width: 769px) and (max-width: 1024px) {
  .navbar {
    padding: 12px 25px;
  }
  
  .nav-links {
    gap: 15px;
  }
  
  #authLink {
    padding: 8px 18px;
  }
}

/* Glow Effect */
.navbar::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00e5ff, transparent);
  box-shadow: 0 0 10px #00e5ff, 0 0 20px #00e5ff;
  animation: glowPulse 3s infinite alternate;
}

@keyframes glowPulse {
  0% { opacity: 0.3; }
  100% { opacity: 0.8; }
}

/* ========================= */
/*   ADDITIONAL STATES       */
/* ========================= */

/* Focus accessibility styling */
#authLink:focus {
  outline: 2px solid #00e5ff;
  outline-offset: 3px;
  box-shadow: 
      0 0 0 4px rgba(0, 229, 255, 0.2),
      0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Loading state styling (optional - can be added with JS) */
#authLink.loading {
  pointer-events: none;
  opacity: 0.8;
}

#authLink.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Signed in state (optional - can be added with JS) */
#authLink.signed-in {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 184, 92, 0.15) 100%);
  border-color: rgba(0, 255, 136, 0.2);
}

#authLink.signed-in i {
  color: #00ff88;
  text-shadow: 0 0 5px rgba(0, 255, 136, 0.7);
}

#authLink.signed-in:hover {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.25) 0%, rgba(0, 184, 92, 0.25) 100%);
  border-color: rgba(0, 255, 136, 0.3);
}

/* Signed out state (optional - can be added with JS) */
#authLink.signed-out {
  background: linear-gradient(135deg, rgba(255, 77, 77, 0.15) 0%, rgba(184, 0, 0, 0.15) 100%);
  border-color: rgba(255, 77, 77, 0.2);
}

#authLink.signed-out i {
  color: #ff5555;
  text-shadow: 0 0 5px rgba(255, 85, 85, 0.7);
}

#authLink.signed-out:hover {
  background: linear-gradient(135deg, rgba(255, 77, 77, 0.25) 0%, rgba(184, 0, 0, 0.25) 100%);
  border-color: rgba(255, 77, 77, 0.3);
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  #authLink,
  #authLink i,
  #authText,
  .navbar,
  .logo-img,
  .mobile-menu li {
    transition: none;
    animation: none;
  }
  
  #authLink:hover {
    transform: none;
  }
  
  #authLink:hover i {
    transform: none;
  }
}