/* ====================== */
/* === NAVBAR CORE === */
/* ====================== */

.navbar {
  background-color: #161616;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
  height: 30px;
  position: fixed;
  top: -100px;
  left: 0;
  right: 0;
  z-index: 1000;
  animation: slideDown 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

/* Enhanced slide-down animation with bounce */
@keyframes slideDown {
  0% { 
    top: -100px;
    opacity: 0;
    transform: scale(0.95);
  }
  70% {
    transform: scale(1.02);
  }
  100% { 
    top: 0;
    opacity: 1;
    transform: scale(1);
  }
}

/* ====================== */
/* === NAVBAR ELEMENTS === */
/* ====================== */

/* Logo with subtle pulse animation */
.logo {
  position: relative;
  overflow: hidden;
}

.logo img {
  height: 32px;
  width: auto;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.logo:hover img {
  transform: scale(1.1) rotate(-5deg);
}

/* Navigation links with advanced hover effects */
.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  position: relative;
  padding: 8px 0;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.nav-links a::before {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, #ff6600, #ff0066);
  transition: width 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.nav-links a:hover {
  color: #ffffff;
}

.nav-links a:hover::before {
  width: 100%;
}

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Dropdown arrow with animation */
.arrow {
  display: inline-block;
  margin-left: 6px;
  transition: all 0.3s ease;
}

.nav-links a:hover .arrow {
  transform: translateY(2px) rotate(180deg);
}


.user-area {
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 1001;
}

.nav-links a:hover .arrow {
  transform: translateY(2px) rotate(180deg);
}

/* ====================== */
/* === BUTTONS & CTAs === */
/* ====================== */

.login-btn {

  color: white;
  padding: 10px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
 
  border: none;
  cursor: pointer;
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  transition: all 0.6s ease;
}

.login-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.login-btn:hover::before {
  left: 100%;
}

.login-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(255, 102, 0, 0.5);
}

/* ====================== */
/* === USER DROPDOWN === */
/* ====================== */

/* Ensure login button is positioned normally in the navbar */
.navbar .login-btn {
  position: static !important;
  cursor: pointer;
}

.dp-wrapper {
  position: relative;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dp {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #626262, #4c4c4c);
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid transparent;
}

.dp:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.353);
  box-shadow: 0 0 25px rgba(227, 119, 119, 0.186);
}

.imgdp {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.dp:hover .imgdp {
  transform: scale(1);
}

.user-name {
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  opacity: 0.9;
}

.dp-wrapper:hover .user-name {
  opacity: 1;
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

/* Dropdown menu with advanced animation */
.dp-dropdown {
  position: absolute;
  top: 65px;
  right: 0;
  background: rgba(30, 30, 30, 0.95);
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
  min-width: 150px;
  z-index: 2000; /* was 1000 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(185, 185, 185, 0.1);
  overflow: hidden;
  padding: 12px;

}

.dp-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dp-dropdown::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(50, 50, 50, 0.1), rgba(0, 0, 0, 0.1));
  z-index: -1;
}

.dp-dropdown button {
  background: transparent;
  border: none;
  padding: 12px 20px;
  color: #ffffff;
  text-align: left;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dp-dropdown button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  transition: all 0.6s ease;
}

.dp-dropdown button:hover {
  background: rgba(255,255,255,0.05);

}

.dp-dropdown button:hover::before {
  left: 100%;
}

.dp-dropdown button i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

/* ====================== */
/* === MOBILE NAV === */
/* ====================== */

.nav-toggle {
  display: none;
  width: 30px;
  height: 22px;
  position: relative;
  cursor: pointer;
  z-index: 1100;
}

.nav-toggle span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: #ffffff;
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-toggle span:nth-child(1) {
  top: 0;
  transform-origin: left center;
}

.nav-toggle span:nth-child(2) {
  top: 9px;
  transform-origin: left center;
}

.nav-toggle span:nth-child(3) {
  top: 18px;
  transform-origin: left center;
}

/* === MOBILE NAV === */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(80vw, 320px); /* responsive width */
  height: 100vh;
  background: rgba(22, 22, 22, 0.98);
  box-shadow: -5px 0 30px rgba(0,0,0,0.5);
  padding: 100px 30px 30px;
  z-index: 1099;
  transition: right 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow-y: auto;
}

.mobile-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,102,0,0.05), rgba(255,0,102,0.05));
  z-index: -1;
}

.mobile-menu a {
  display: block;
  color: #ffffff;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 16px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.mobile-menu a::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  transition: all 0.6s ease;
}

.mobile-menu a:hover {
  color: #ff6600;
  padding-left: 15px;
}

.mobile-menu a:hover::after {
  left: 100%;
}

/* Active states */
.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg);
  top: -1px;
  left: 4px;
}

.nav-toggle.active span:nth-child(2) {
  width: 0%;
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 20px;
  left: 4px;
}

.mobile-menu.active {
  right: 0;
}

/* ====================== */
/* === RESPONSIVE === */
/* ====================== */

@media (max-width: 1024px) {
  .navbar {
    padding: 14px 30px;
  }
  
  .nav-links {
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 12px 20px;
    height: 30px;
  }
  
  .nav-links,
  .login-btn {
    display: none;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .dp-dropdown {
    top: 70px;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 10px 15px;
  }
  
  .mobile-menu {
    width: min(85vw, 320px); /* previously 35% */
    padding: 90px 20px 20px;
  }
  
  .dp-wrapper .user-name {
    display: none;
  }
}

/* Hide avatar wrapper by default to prevent pre-JS flicker */
.dp-wrapper {
  position: relative;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
/* 🔹 Reversed Animated Background on Hover */
.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
background: linear-gradient(120deg, transparent 0%, #999 40%, #222 60%, transparent 100%);
  background-size: 100% 100%;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.navbar:hover::before {
  animation: navSweepReverse 3s ease-out forwards;
  opacity: 0.15;
}

/* 🔹 Reversed Sweep Animation (Right → Left) */
@keyframes navSweepReverse {
  0% {
    right: -100%;
    opacity: 0.15;
  }
  50% {
    right: 0%;
    opacity: 0.2;
  }
  100% {
    right: 100%;
    opacity: 0;
  }
}
