/* nav.css — JavaOCP navigation styles */

.ocp-nav {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ocp-nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Brand */
.ocp-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #1f2937;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.ocp-nav-brand-icon {
  font-size: 24px;
}

/* Mobile toggle button */
.ocp-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
}

.ocp-nav-toggle span {
  width: 24px;
  height: 2px;
  background: #404040;
  border-radius: 2px;
}

/* Menu container */
.ocp-nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  justify-content: space-between;
  margin-left: 32px;
}

.ocp-nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.ocp-nav-item {
  position: relative;
}

.ocp-nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  color: #404040;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.ocp-nav-link:hover {
  background: #f5f5f5;
  color: #1f2937;
}

.ocp-nav-link.active {
  color: #1f2937;
  background: #e8e8e8;
}

.ocp-nav-arrow {
  font-size: 10px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.ocp-nav-dropdown.open .ocp-nav-arrow {
  transform: rotate(180deg);
}

/* Dropdown menu */
.ocp-nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    min-width: 260px;
    padding: 8px;
    margin-top: 0;       /* ✅ Remove the gap */
    padding-top: 12px;   /* ✅ Padding instead — invisible to user, but cursor stays "inside" the menu */
}

.ocp-nav-dropdown.open .ocp-nav-dropdown-menu {
  display: block;
}

.ocp-nav-dropdown-item {
  display: block;
  padding: 8px 12px;
  color: #404040;
  text-decoration: none;
  font-size: 13px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.ocp-nav-dropdown-item:hover {
  background: #f5f5f5;
  color: #1f2937;
}

/* Dropdown sections (with headings) */
.ocp-nav-section {
  padding: 8px 4px;
}

.ocp-nav-section + .ocp-nav-section {
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
}

.ocp-nav-section-heading {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 12px 4px;
}

.ocp-nav-empty {
  padding: 16px;
  color: #9ca3af;
  font-size: 13px;
  font-style: italic;
  text-align: center;
}

/* Action buttons */
.ocp-nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ocp-nav-action {
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.ocp-nav-action-secondary {
  color: #404040;
  border: 1px solid #d1d5db;
  background: white;
}

.ocp-nav-action-secondary:hover {
  background: #f5f5f5;
  border-color: #9ca3af;
}

.ocp-nav-action-primary {
  color: white;
  background: #404040;
  border: 1px solid #404040;
}

.ocp-nav-action-primary:hover {
  background: #1f2937;
  border-color: #1f2937;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .ocp-nav-toggle {
    display: flex;
  }

  .ocp-nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    flex-direction: column;
    padding: 16px;
    gap: 16px;
    margin-left: 0;
  }

  .ocp-nav-menu.open {
    display: flex;
  }

  .ocp-nav-links {
    flex-direction: column;
    width: 100%;
    gap: 4px;
  }

  .ocp-nav-item {
    width: 100%;
  }

  .ocp-nav-link {
    width: 100%;
    justify-content: space-between;
  }

  .ocp-nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: #fafafa;
    margin-top: 0;
    margin-left: 16px;
  }

  .ocp-nav-actions {
    width: 100%;
    flex-direction: column;
  }

  .ocp-nav-action {
    width: 100%;
    text-align: center;
  }
}