/* ============================================================
   SafeCloud — Navigation & Mobile Menu
   ============================================================ */

/* --- Top Nav Bar --- */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  background: rgba(10, 15, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-inner {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- Logo --- */
.nav-logo {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  text-decoration: none;
}

.nav-logo-mark {
  width: 2.125rem;
  height: 2.125rem;
  flex-shrink: 0;
  /* subtle drop shadow to lift the cloud off the dark nav */
  filter: drop-shadow(0 1px 6px rgba(56, 189, 248, 0.35));
  transition: filter 0.3s;
}

.nav-logo:hover .nav-logo-mark {
  filter: drop-shadow(0 2px 10px rgba(0, 212, 170, 0.5));
}

.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: 0.05em;
}

.logo-txt-cloud {
  color: var(--accent);
}

/* --- Desktop nav links --- */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--txt-dim);
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  width: 100%;
}

/* --- Nav CTA button --- */
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--bg);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 255, 136, 0.3);
}

/* --- Mobile hamburger toggle --- */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--txt-dim);
  cursor: pointer;
  padding: 0.25rem;
}

/* --- Mobile menu overlay --- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 15, 26, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: 5rem 2rem 2rem;
  gap: 0.5rem;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--txt-dim);
  cursor: pointer;
  padding: 0.25rem;
}

.mobile-menu a,
.mobile-menu button.mobile-link {
  font-size: 1.125rem;
  color: var(--txt-dim);
  padding: 0.625rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  font-family: var(--font-body);
  cursor: pointer;
  transition: color 0.2s;
  width: 100%;
  display: block;
}

.mobile-menu a:hover,
.mobile-menu button.mobile-link:hover {
  color: var(--accent);
}

.mobile-menu .mobile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--bg);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.875rem 1.5rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  margin-top: 1rem;
  font-family: var(--font-body);
  width: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}
.mobile-menu .mobile-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 255, 136, 0.3);
}

/* --- Services Dropdown --- */
.has-dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.dropdown-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.has-dropdown:hover .dropdown-chevron,
.has-dropdown:focus-within .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 230px;
  background: rgba(12, 18, 32, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.875rem;
  padding: 0.375rem;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0,255,136,0.04);
  z-index: 100;
}

/* small arrow pointing up */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: rgba(12, 18, 32, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: var(--txt-dim);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  width: 100%;
}

/* override the underline animation for dropdown items */
.dropdown-menu li a::after {
  display: none;
}

.dropdown-menu li a:hover {
  background: rgba(0, 255, 136, 0.08);
  color: var(--accent);
}

.dropdown-menu .dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 0.25rem 0.75rem;
}

/* --- Mobile services submenu --- */
.mobile-services-toggle {
  display: flex;
  align-items: center;
}

.mobile-services-submenu {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.mobile-services-submenu.open {
  max-height: 400px;
}

.mobile-sub-link {
  font-size: 1rem !important;
  color: var(--txt-dim) !important;
  padding: 0.5rem 0 0.5rem 1.25rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  text-decoration: none;
  display: block;
  transition: color 0.2s;
}

.mobile-sub-link:hover {
  color: var(--accent) !important;
}

/* --- Responsive breakpoints --- */
@media (max-width: 1024px) {
  .nav-links,
  .nav-cta {
    display: none;
  }
  .mobile-toggle {
    display: block;
  }
}
