@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

.navbar {
  height: 80px;
  background: rgba(10, 30, 51, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 40px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.06);

  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);

  position: sticky;
  top: 0;
  z-index: 1000;

  font-family: 'Poppins', sans-serif;

  /* Hide initially to prevent layout/auth flickers, fade in smoothly */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.navbar.navbar-loaded {
  opacity: 1;
}

/* ── LOGO ── */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.logo img {
  height: 68px;
  width: auto;
  object-fit: contain;
  display: block;
}

.logo:hover {
  opacity: 0.88;
}

/* ── NAV LINKS ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links li {
  list-style: none;
}

.nav-links a {
  display: block;
  text-decoration: none;
  color: #B8C4D4;

  font-family: 'Poppins', sans-serif;

  font-size: 0.88rem;
  font-weight: 500;

  padding: 8px 14px;

  border-radius: 8px;
  border: 1px solid transparent; /* Prevent layout shifting */

  transition: all 0.25s ease;

  white-space: nowrap;

  letter-spacing: 0.1px;
}

/* HOVER */
.nav-links a:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ACTIVE PAGE */
.nav-links a.active {
  color: #FFFFFF !important;
  font-weight: 600;
  background: rgba(0, 229, 255, 0.08) !important;
  border: 1px solid rgba(0, 229, 255, 0.45) !important;
  box-shadow: 
    0 0 16px rgba(0, 229, 255, 0.18),
    inset 0 0 8px rgba(0, 229, 255, 0.08);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.nav-links a.active:hover {
  background: rgba(0, 229, 255, 0.14) !important;
  border-color: rgba(46, 217, 195, 0.6) !important;
  box-shadow: 
    0 0 20px rgba(46, 217, 195, 0.25),
    inset 0 0 10px rgba(46, 217, 195, 0.1);
}

/* ── LOGIN SPECIAL STYLE ── */
.nav-login {
  border: 1px solid rgba(63, 169, 245, 0.4) !important;
  background: transparent !important;
  color: #3FA9F5 !important;
}

.nav-login:hover {
  background: rgba(63, 169, 245, 0.1) !important;
  border-color: #3FA9F5 !important;
  color: #FFFFFF !important;
}

/* ── CTA ── */
.nav-cta {
  background: #00E5FF !important;
  color: #0A1E33 !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(0, 229, 255, 0.35);
}

.nav-cta:hover {
  background: #2ED9C3 !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.5) !important;
}

/* ────────────────────────────────────────
   HAMBURGER TOGGLE BUTTON
   (hidden on desktop, shown on mobile)
──────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.nav-toggle:hover {
  border-color: rgba(63, 169, 245, 0.5);
  background: rgba(63, 169, 245, 0.08);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #B8C4D4;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger → X animation */
.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ────────────────────────────────────────
   MOBILE OVERLAY (backdrop)
──────────────────────────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 80px 0 0 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .navbar { padding: 0 24px; }
  .nav-links { gap: 2px; }
  .nav-links a { font-size: 0.83rem; padding: 7px 11px; }
}

@media (max-width: 900px) {
  /* Show hamburger */
  .nav-toggle {
    display: flex;
  }

  /* Show overlay element in DOM */
  .nav-overlay {
    display: block;
  }

  /* Collapse nav links into a mobile drawer */
  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    z-index: 999;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10, 22, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s ease,
                border-color 0.3s ease;
  }

  .nav-links.open {
    max-height: 600px;
    padding: 12px 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-links li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    font-size: 0.95rem;
    padding: 14px 16px;
    border-radius: 10px;
    white-space: normal;
  }

  .nav-links a:hover {
    background: rgba(63, 169, 245, 0.1);
    color: #FFFFFF;
  }
}

@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .logo img { height: 52px; }
}

@media (max-width: 480px) {
  .navbar { padding: 0 12px; height: 70px; }
  .logo img { height: 44px; }

  .nav-links {
    top: 70px;
  }

  .nav-overlay {
    top: 70px;
  }
}

/* ============================================
   Authenticated Content Fade-In
   ============================================ */
.auth-content {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-content.loaded {
  opacity: 1;
}

/* ============================================
   Custom Modal Confirmation
   ============================================ */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 22, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.custom-modal-card {
  background: linear-gradient(145deg, rgba(23, 37, 55, 0.9) 0%, rgba(10, 30, 51, 0.95) 100%);
  border: 1px solid rgba(0, 229, 255, 0.25);
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 0 32px rgba(0, 229, 255, 0.1);
  padding: 36px 30px;
  border-radius: 20px;
  width: min(420px, calc(100% - 32px));
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-modal-overlay.visible .custom-modal-card {
  transform: translateY(0);
}

.custom-modal-icon {
  width: 60px;
  height: 60px;
  background: rgba(239, 68, 68, 0.1);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  color: #EF4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 20px;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}

.custom-modal-card h3 {
  font-size: 1.35rem;
  color: #FFFFFF;
  margin-bottom: 10px;
  font-weight: 700;
}

.custom-modal-card p {
  color: #B8C4D4;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 28px;
}

.custom-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn {
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
}

.modal-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.modal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
}

.modal-btn-danger {
  background: linear-gradient(135deg, #EF4444, #C22727);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

.modal-btn-danger:hover {
  background: linear-gradient(135deg, #FF5A5A, #EF4444);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}